01-24-2019, 12:23 AM
(This post was last modified: 01-24-2019, 12:28 AM by kyle2143. Edited 2 times in total.)
Update: Finished. (the "Favorite Cameras" header is actually green, but I'm not going to re take this picture for that")
![[Image: VF9nDBk.png]](https://i.imgur.com/VF9nDBk.png)
Issues:
![[Image: VF9nDBk.png]](https://i.imgur.com/VF9nDBk.png)
- Slight improvement to the UI (shown above)
- This implements a new chui/window. But it technically doesn't really take advantage of the features to the fullest, namely sending off js function calls from sever side. But I only had one use case for it in this project (saving/unsaving cameras) and it isn't really going to cause problems without it. Sorry Somepotato.
- Debouncing the keyboard inputs for moving the camera around did not work. Well it did work, but it wasn't doing what I wanted to do. What I wanted to do was throttle it. Now I do.
- Related to debouncing, previously I just copy pasted some code for that because I'm dumb. Now I'm importing a tiny (70 lines) js library that handle throttling and debouncing. https://code.google.com/archive/p/jquery-debounce/.
- I mention it on a comment on my PR, but for maximum clarity, the file is added in commit cd3b411. Then in the subsequent commits I add that file to be imported in chui/template.
- Another note for merging, also mentioned in a comment, in my security_cameras_chui.dm file, I use a var called 'windowSize'. This var should be declared in chui/window, and is in production code, but it doesn't exist in 2016. In commit [url=https://github.com/goonstation/goonstation-2016/pull/102/commits/0f7cb88e3b9a9e19a8aeff28587779ea0993daa4]0f7cb88
- Also, previously camera's didn't correctly skip over broken camera's on the network. Because I was lied to! Well tricked, tricked by how that original movement code worked since it was damn near incomprehensible. There were like 3 different ways that it calculated the movement, sometimes rolling over into another. I dunno, I never really bothered with trying to understand that.
- Anyway, you can't skip over broken cameras in the keyboard movement mode, you get a message and the computer beeps a bit in disgust when you try it. I actually think it's good that it can't skip over broken cameras now though, because then it might be too good.
- Remove scroll bar in the main camera list, thanks to qwerty.
Issues:
- The only issue I can think of is that for you to be able to move cameras with the AI movement/keyboard controls. You need to have that long button at the top in focus. That might not be completely obvious and I 'm not sure how to make it so.