I'm working on a simple mod to switch between 4 environment "states" when clicked (morning, noon, dusk & night).
I have the code that defines those 4 states (https://github.com/Pentasis/pe…pts/time_of_day_cycle.lua) and right now I switch between them by changing an argument in runFn call. But obviously I'd like to be able to click a button during gameplay to toggle between them.
I am stumped as to how to create such a button and then how (or rather where) to update the gamethread.
Can anyone help please?