beyond-all-reason / spring

A powerful free cross-platform RTS game engine
https://beyond-all-reason.github.io/spring/
Other
182 stars 95 forks source link

Add input emulation funcs to Lua `debug.` API #1439

Open sprunk opened 3 months ago

sprunk commented 3 months ago

Add a bunch of functions to the debug lib:

The difference between, say, debug.mousepress(LMB) and Script.LuaUI.MousePress(LMB) is that the engine would be able to consume it (for example to do a native drag-a-box selection).

The use case is for testing input.

salinecitrine commented 3 months ago

A significant use case in BAR would be https://github.com/beyond-all-reason/Beyond-All-Reason/pull/2625, where it would allow properly testing many features of the UI. Some events are easier than others; mouse dragging, for example, is something I haven't been able to get working from the Lua side.