Draft, loads cursors, animated and not animated, handles switching between cursors.
Currently contains code just for testing/demoing: right click the mouse to cycle through loaded cursors. The watch is set as an i-beam cursor so that you can try hovering over a text field (ex. in the new-game menu) to observe how the Cursor Manager handles auto-switching between animated cursors.
Loading of the cursors and generating new resolutions handled by the c++ side CursorSingleton. Managing what frame to display, and when to switch cursors handled by gdscript side CursorManager. This architecture is because we want a c++ dataloader, but we also need to listen to the scene tree to know when its safe to call a hardware cursor change.
Possible improvements:
Doesn't support the full image spec (unhandled things like 16bit colour images that vic2 doesn't use)
Might want to change how I handle collecting both .cur and .CUR files in the loading function (perhaps a new, "ignore-case" parameter for .lookup_files_in_dir_recursive?
CursorManager creates a new compat_Cursor inner class whenever we switch cursors, which re-fetches the cursor stored in CursorSingleton. We can store a list of all compat_cursors to avoid this.
Draft, loads cursors, animated and not animated, handles switching between cursors. Currently contains code just for testing/demoing: right click the mouse to cycle through loaded cursors. The watch is set as an i-beam cursor so that you can try hovering over a text field (ex. in the new-game menu) to observe how the Cursor Manager handles auto-switching between animated cursors.
Loading of the cursors and generating new resolutions handled by the c++ side CursorSingleton. Managing what frame to display, and when to switch cursors handled by gdscript side CursorManager. This architecture is because we want a c++ dataloader, but we also need to listen to the scene tree to know when its safe to call a hardware cursor change.
Possible improvements:
.lookup_files_in_dir_recursive
?compat_Cursor
inner class whenever we switch cursors, which re-fetches the cursor stored in CursorSingleton. We can store a list of all compat_cursors to avoid this.