!load command for old console
This commit is contained in:
parent
618e29d5d4
commit
ba55da77a9
@ -11,9 +11,11 @@
|
||||
#include <strings.h>
|
||||
#include "CommandInterface.h"
|
||||
#include "game/GameModel.h"
|
||||
#include "game/GameController.h"
|
||||
|
||||
CommandInterface::CommandInterface(GameModel * m) {
|
||||
CommandInterface::CommandInterface(GameController * c, GameModel * m) {
|
||||
this->m = m;
|
||||
this->c = c;
|
||||
}
|
||||
|
||||
/*void CommandInterface::AttachGameModel(GameModel * m)
|
||||
|
@ -13,14 +13,16 @@
|
||||
//#include "game/GameModel.h"
|
||||
|
||||
class GameModel;
|
||||
class GameController;
|
||||
class CommandInterface {
|
||||
protected:
|
||||
std::string lastError;
|
||||
GameModel * m;
|
||||
GameController * c;
|
||||
public:
|
||||
enum LogType { LogError, LogWarning, LogNotice };
|
||||
enum FormatType { FormatInt, FormatString, FormatChar, FormatFloat };
|
||||
CommandInterface(GameModel * m);
|
||||
CommandInterface(GameController * c, GameModel * m);
|
||||
int GetPropertyOffset(std::string key_, FormatType & format);
|
||||
int GetParticleType(std::string type);
|
||||
void Log(LogType type, std::string message);
|
||||
|
@ -37,10 +37,10 @@
|
||||
#endif
|
||||
#include <time.h>
|
||||
|
||||
LuaScriptInterface::LuaScriptInterface(GameModel * m):
|
||||
CommandInterface(m),
|
||||
LuaScriptInterface::LuaScriptInterface(GameController * c, GameModel * m):
|
||||
CommandInterface(c, m),
|
||||
currentCommand(false),
|
||||
legacy(new TPTScriptInterface(m))
|
||||
legacy(new TPTScriptInterface(c, m))
|
||||
{
|
||||
luacon_model = m;
|
||||
luacon_sim = m->GetSimulation();
|
||||
|
@ -67,7 +67,7 @@ class LuaScriptInterface: public CommandInterface {
|
||||
public:
|
||||
ui::Window * Window;
|
||||
lua_State *l;
|
||||
LuaScriptInterface(GameModel * m);
|
||||
LuaScriptInterface(GameController * c, GameModel * m);
|
||||
virtual bool OnBrushChanged(int brushType, int rx, int ry);
|
||||
virtual bool OnMouseMove(int x, int y, int dx, int dy);
|
||||
virtual bool OnMouseDown(int x, int y, unsigned button);
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "game/GameModel.h"
|
||||
#include "simulation/Air.h"
|
||||
|
||||
TPTScriptInterface::TPTScriptInterface(GameModel * m): CommandInterface(m)
|
||||
TPTScriptInterface::TPTScriptInterface(GameController * c, GameModel * m): CommandInterface(c, m)
|
||||
{
|
||||
}
|
||||
|
||||
@ -365,7 +365,7 @@ AnyType TPTScriptInterface::tptS_load(std::deque<std::string> * words)
|
||||
//Arguments from stack
|
||||
NumberType saveID = eval(words);
|
||||
|
||||
throw GeneralException("Function not implemented");
|
||||
c->OpenSavePreview(saveID.Value(), 0);
|
||||
|
||||
return NumberType(0);
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ protected:
|
||||
AnyType tptS_bubble(std::deque<std::string> * words);
|
||||
ValueType testType(std::string word);
|
||||
public:
|
||||
TPTScriptInterface(GameModel * m);
|
||||
TPTScriptInterface(GameController * c, GameModel * m);
|
||||
virtual void Tick() {}
|
||||
virtual int Command(std::string command);
|
||||
virtual std::string FormatCommand(std::string command);
|
||||
|
@ -150,7 +150,7 @@ GameController::GameController():
|
||||
gameView->AttachController(this);
|
||||
gameModel->AddObserver(gameView);
|
||||
|
||||
commandInterface = new LuaScriptInterface(gameModel);//new TPTScriptInterface();
|
||||
commandInterface = new LuaScriptInterface(this, gameModel);//new TPTScriptInterface();
|
||||
((LuaScriptInterface*)commandInterface)->SetWindow(gameView);
|
||||
|
||||
//sim = new Simulation();
|
||||
|
Loading…
Reference in New Issue
Block a user