TinyCircuits / TinyCircuits-Thumby-Code-Editor

https://code.thumby.us/
GNU General Public License v3.0
30 stars 20 forks source link

Replaced emulator-player mode hot patches with updates to menu.py #61

Open fuglaro opened 1 year ago

fuglaro commented 1 year ago

The stand-alone emulator previously used the same menu.py file that runs on the device, but manipulated the python code with some hot patches to be able to dynamically load all the games from the Arcade.

This change avoids this hot patching by making some minimal fallback behaviour in menu.py:

There is also a related change in play.js that cleans up better when games end and it goes back to the menu. Previously, lots of hidden Editor widgets would be left open.

There should be no other behavioural changes with this update expect code that is less brittle to future changes.

Tests on the the following looked good to me:

ghost commented 1 year ago

Seems reasonable. My only issue is that regular hardware users will see that message HEYTHUMBY!LOAD:TinyBlocks printed. Would be nice if it only occurred in the emulator. Would it be possible to only print that if running in the emulator? Like when the emulator module exists?

fuglaro commented 1 year ago

Good point and that sounds great! I'll take a look at that soon. Thank you!