diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-31 18:39:11 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-31 18:39:11 (GMT) |
| commit | 493a32a1b28f15cf02bb69c3735b9a411448c523 (patch) | |
| tree | 838b39db197c1f9cab5740703bb03f9b24702c56 /src/cat/LuaScriptInterface.h | |
| parent | 322d224fa7a1d5f155c87596bb2f5927989e9933 (diff) | |
| download | powder-493a32a1b28f15cf02bb69c3735b9a411448c523.zip powder-493a32a1b28f15cf02bb69c3735b9a411448c523.tar.gz | |
Some Lua interface API stuff
Diffstat (limited to 'src/cat/LuaScriptInterface.h')
| -rw-r--r-- | src/cat/LuaScriptInterface.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cat/LuaScriptInterface.h b/src/cat/LuaScriptInterface.h index 96fd66b..37adc65 100644 --- a/src/cat/LuaScriptInterface.h +++ b/src/cat/LuaScriptInterface.h @@ -18,6 +18,11 @@ extern "C" #include "CommandInterface.h" #include "simulation/Simulation.h" +namespace ui +{ + class Window; +} + //Because lua only has bindings for C, we're going to have to go outside "outside" the LuaScriptInterface, this means we can only have one instance :( #define LOCAL_LUA_DIR "Lua" @@ -53,7 +58,14 @@ class LuaScriptInterface: public CommandInterface { static int elements_property(lua_State * l); static int elements_loadDefault(lua_State * l); static int elements_free(lua_State * l); + + //Interface + void initInterfaceAPI(); + static int interface_showWindow(lua_State * l); + static int interface_closeWindow(lua_State * l); + static int interface_addComponent(lua_State * l); public: + ui::Window * Window; lua_State *l; LuaScriptInterface(GameModel * m); virtual bool OnBrushChanged(int brushType, int rx, int ry); @@ -64,6 +76,8 @@ public: virtual bool OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt); virtual bool OnKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool alt); virtual void OnTick(); + virtual void Init(); + virtual void SetWindow(ui::Window * window); virtual int Command(std::string command); virtual std::string FormatCommand(std::string command); virtual ~LuaScriptInterface(); |
