Please sign in to comment.
add new events api, replaces legacy event functions
event.register(event.mousedown, function(...) print(...) end) event.unregister(event.mousedown, somefunc) mouseclick event split into mousedown, mouseup, mousemove, mousewheel keypress event split into keypress, keyrelease, textinput. key* events only contain keycode and scancode, don't attempt to represent a letter (was very broken at this before). Also have helpful shift/ctrl/alt flags passed in. textinput just represents inserted text, can probably even handle foreign characters. register_step replaced with event.tick event All legacy register_* and unregister_ functions are removed. There is a compatibility lua script, might embed it later. tpt.set_shortcuts / tpt.test also removed. event.getmodifiers added, just a misc function to get the currently held modifiers Lots of code duplication to handle each event is removed, it's not handled in a more generic way. Although the Event class / child classes could use some work.
- Loading branch information...
Showing with 490 additions and 552 deletions.
- +12 −21 src/gui/game/GameController.cpp
- +1 −2 src/gui/game/GameController.h
- +7 −17 src/gui/game/GameView.cpp
- +1 −1 src/gui/game/GameView.h
- +9 −10 src/lua/CommandInterface.h
- +1 −369 src/lua/LegacyLuaAPI.cpp
- +25 −0 src/lua/LuaCompat.c
- +1 −0 src/lua/LuaCompat.h
- +244 −0 src/lua/LuaEvents.cpp
- +122 −0 src/lua/LuaEvents.h
- +1 −14 src/lua/LuaScriptHelper.h
- +56 −110 src/lua/LuaScriptInterface.cpp
- +10 −8 src/lua/LuaScriptInterface.h
Oops, something went wrong.