X-Git-Url: https://fortfriendship.online/gitweb/gnargle.github.io.git/blobdiff_plain/240e81b86bd3caa1bf56eb93d676608e2d6e01cd..d7eeb50a66b73abbd821cae38570b321f7b464af:/projects/pipboy.html?ds=sidebyside diff --git a/projects/pipboy.html b/projects/pipboy.html index 75e29cf..8fbada2 100644 --- a/projects/pipboy.html +++ b/projects/pipboy.html @@ -748,6 +748,68 @@ What that isn't, though, is input. Which was the title of this update (I've changed it now). So I'll tackle that next!

+
+

Actually doing input this time

+

22/03/2025

+
+

+ OK we're back again baby. And this time I sweart I am going to + do input. To show willing I've even already started diving into + the firmware to work out how it's done! +

+ + A
+                screenshot of the dumped firmware. It notably shows a function
+                'd' and a call Pip.on('knob1', d) + +

+ So that firmware screenshot tells us all we need to know, + really. The Pip object has some events (in this case, 'knob1', + which is a) funny and b) the left hand wheel control) one which + you can register functions to call. +

+

+ This screenshot is from the portion of the code that handles + switching between the different health animations, but this + applies anywhere really. So what we need to do is: +

+ +

Pretty simple! OK, lets go do that.

+ Code Updated. Check the github link to keep up. +

And look at that! We're done.

+ +

+ Nothing really special to talk about here, just some basic + increment/decrement handling and looping back to the start of + the list when necessary. +

+

+ There is a specific wrinkle of having to deregister the input + event. Early on in my testing I hadn't done that and it kept the + .js loaded even after removing the SD card, which meant it + looked like any edits I made weren't actually working. In order + to prevent this I added gracefulClose() which deregisters the + handler and shows the main menu again. +

+

+ Last thing here is really to handle what happens when we have + more perks than will fit in our available space. Then this + screen is basically done! +