![]() |
[Feature] Improved Security Camera Computer/ Old AI camera movement for computer - Printable Version +- Goonstation Forums (https://forum.ss13.co) +-- Forum: Discussion (https://forum.ss13.co/forumdisplay.php?fid=6) +--- Forum: Patches (https://forum.ss13.co/forumdisplay.php?fid=30) +---- Forum: Implemented (https://forum.ss13.co/forumdisplay.php?fid=31) +---- Thread: [Feature] Improved Security Camera Computer/ Old AI camera movement for computer (/showthread.php?tid=11439) |
[Feature] Improved Security Camera Computer/ Old AI camera movement for computer - kyle2143 - 01-15-2019 The security camera computer sucks and you all know it. You have to scroll through the whole list of cameras looking for one that sounds like where you want, as soon as you click it the menu moves all the way to the bottom so your point of reference is lost, pretty useless for all but a few specific scenarios. This patch does several things: 1. Allows you to move between security cameras in the network similar to how the old AI movement worked. Use arrow keys, wasd, or ijkl to move from your current camera to the camera nearest to you in your chosen cardinal direction (N/S/E/W). 2. Improves the actual menu screen a great deal. Instead of an unparsable list of over a hundred entries where you can only see like 10 at a time, now you can see much more!. There is also a searchbar on top of the list that will allow you to see only the cameras you want. 3. I added a "favorites list" of cameras. It removes the selected camera from the main list, and moves it to a list on the right. Only 5 favorites allowed right now. Images (resized) Original: ![]() New: ![]() Video Demo: https://streamable.com/g4hw9 Notes: - This only effects the security/wooden/detective camera computers, not the handheld computer monitors like you'll find around. - While I think this screen is better than before. It's still rather bad/bare bones. I'm not really one for front end/UI work, especially html/js stuff. So here is a JSFiddle page of what I was using to test the web changes for anyone who wants to try their hand and improving it. It has most of the stuff that is in the new menu, but none of the chui stuff. https://jsfiddle.net/kyle2143/whmkfjc7/6/ Technical Notes: - If you take the time to read the actual code, you may notice that the js I wrote for this is really ugly. Sorry, but I'm too afraid to try to clean it up and trying to do so would only lead to me getting way too angry and frustrated. I don't want to risk it. - The camera movement calls from the arrow keys are in a debounce function, to cut down on topic calls. I set it to 50ms, could probably go lower. Essentially it just makes it so that you can't hold down a key and fire off 100 topic calls in a second. - Similarly I debounced the js function for adding/removing favorites. This is probably completely unnecessary since the actual camera selecting is not debounced. (but it was that way in the original computer so I didn't change it). - For camera movement. Keys pressed are checked client-side and server-side to validate and prevent extraneous topic calls. - The camera movement code is mostly repurposed from how the AI movement works. The reason that I included the ai/move.dm file in this commit is because I added a new file for moving the security camera around, and it uses the same name as the proc in move.dm. It's my understanding that that has been removed in productions so it shouldn't matter really except for testing in 2016. Bugs: - Due to either me being too stupid or chui hating me too much, there was a bug with closing the chui screen. If you click the chui 'X' button at the top right, it closes the menu, but it doesn't send a 'close' topic call like the regular browser does. So I can't reset the player's eye back to themself. - To get around said bug above, currently I added an 'X' anchor to click at the top right that will close it like normal. Unfortunately the 'can_close=0' option doesn't want to work for me. I suspect sabotage. - EDIT: - Oh there is one other bug I forgot to mention. When using the AI movement mode, you can use the arrow keys to move around. Pressing the down or up arrow keys will move the scrollbar up and down. I couldn't really get it to stop. JS prevent_default doesn't seem to work in a JQuery delegate function. https://github.com/goonstation/goonstation-2016/pull/102 RE: [Feature] Improved Security Camera Computer/ Old AI camera movement for computer - New525 - 01-21-2019 This is an excellent QoL improvement RE: [Feature] Improved Security Camera Computer/ Old AI camera movement for computer - Technature - 01-21-2019 This is a good. You do the good. Thank. RE: [Feature] Improved Security Camera Computer/ Old AI camera movement for computer - Spy_Guy - 01-23-2019 This looks pretty cool. Question: You mention some code is copied from various sources. What licenses apply to those snippets? RE: [Feature] Improved Security Camera Computer/ Old AI camera movement for computer - kyle2143 - 01-23-2019 (01-23-2019, 02:31 AM)Spy_Guy Wrote: This looks pretty cool. Yeah one was a debounce function from somewhere, I think that was ok, but I've removed it because I don't actually need it, I needed to throttle functions. So I"m using another that's a jquery debounce/throttle file under the MIT license. https://code.google.com/archive/p/jquery-debounce/ The other is a snippet from a that W3 schools site. Technically they say all the code on their website is copyrighted, but they can't try to enforce a copyright of such a small, obvious function that is used as ubiquitously as this is. It's only several lines long, and probably literally one of the simplest ways to do it in pure js. The notion of a copyright on that is offensive to me. Anyway, in searching for the w3schools license info I found a rather better version of literally the same function on stackoverflow (of which I'm fairly sure all snippets are considered released under MIT), just it leverages jquery. So I'll just change it to that. Fucking hell, I wonder if there's a search setting or browser app I can use to filter out all w3 Schools results. Those fuckers. Edit: No, stackoverflow comments are creative commons Edit 2: I changed my mind about that table filtering. I think I'll just leave it as is, it's such a simple piece of code. You can't copywright iterating through a list and displaying/hiding items. There's nothing unique about it at all. I only picked it because I hate/am bad at javascript and didn't want to have to think to solve a basic solved problem. Having considered this I'm not sure I'll keep the crediting comment. But it's up to you guys if you want to add that. RE: [Feature] Improved Security Camera Computer/ Old AI camera movement for computer - kyle2143 - 01-24-2019 Update: Finished. (the "Favorite Cameras" header is actually green, but I'm not going to re take this picture for that") ![]()
Issues:
RE: [Feature] Improved Security Camera Computer/ Old AI camera movement for computer - qwertyquerty - 01-28-2019 Mmmm yes RE: [Feature] Improved Security Camera Computer/ Old AI camera movement for computer - Gannets - 02-04-2019 well this looks great RE: [Feature] Improved Security Camera Computer/ Old AI camera movement for computer - kyle2143 - 02-04-2019 (02-04-2019, 11:44 AM)Gannets Wrote: well this looks great TY Gannets, you inspired me to finally fix that last issue. Here's an image of the final version. (I'm really done with this forever now.) ![]() Here's a video of it as well. I don't think I made one with my previous update so this is the final copy. https://streamable.com/xrx8n https://github.com/goonstation/goonstation-2016/pull/102 RE: [Feature] Improved Security Camera Computer/ Old AI camera movement for computer - The Grim Sleeper - 03-02-2019 So it's been almost a month since the last post on this [Feature][Vital Improvement], and I am curious as to the state of development?
RE: [Feature] Improved Security Camera Computer/ Old AI camera movement for computer - qwertyquerty - 03-02-2019 (03-02-2019, 01:10 AM)The Grim Sleeper Wrote: So it's been almost a month since the last post on this [Feature][Vital Improvement], and I am curious as to the state of development? Patches are generally laid out to dry for good portions of time especially if they are large patches. Due to codebase differences the coders can't simply merge most patches, and have to do manual work rewriting parts and fully testing. I do agree patches should be paid a bit more attention to, but they are a lot of work to merge, so.. |