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/game/GameController.cpp | |
| parent | 322d224fa7a1d5f155c87596bb2f5927989e9933 (diff) | |
| download | powder-493a32a1b28f15cf02bb69c3735b9a411448c523.zip powder-493a32a1b28f15cf02bb69c3735b9a411448c523.tar.gz | |
Some Lua interface API stuff
Diffstat (limited to 'src/game/GameController.cpp')
| -rw-r--r-- | src/game/GameController.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index 2258239..ffa763f 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -140,7 +140,8 @@ GameController::GameController(): options(NULL), activePreview(NULL), localBrowser(NULL), - HasDone(false) + HasDone(false), + firstTick(true) { gameView = new GameView(); gameModel = new GameModel(); @@ -149,7 +150,7 @@ GameController::GameController(): gameModel->AddObserver(gameView); commandInterface = new LuaScriptInterface(gameModel);//new TPTScriptInterface(); - //commandInterface->AttachGameModel(gameModel); + ((LuaScriptInterface*)commandInterface)->SetWindow(gameView); //sim = new Simulation(); Client::Ref().AddListener(this); @@ -658,6 +659,11 @@ bool GameController::KeyRelease(int key, Uint16 character, bool shift, bool ctrl void GameController::Tick() { + if(firstTick) + { + ((LuaScriptInterface*)commandInterface)->Init(); + firstTick = false; + } commandInterface->OnTick(); } |
