moving gameModel was a bad idea, so i just made an alias function

This commit is contained in:
mniip 2013-01-11 22:28:57 +04:00
parent 269420c6c7
commit df628c7fe3
3 changed files with 12 additions and 6 deletions

View File

@ -146,7 +146,7 @@ GameController::GameController():
commandInterface = new LuaScriptInterface(this, gameModel);//new TPTScriptInterface();
((LuaScriptInterface*)commandInterface)->SetWindow(gameView);
commandInterface->OnBrushChanged(gameModel->GetBrushID(), gameModel->GetBrush()->GetRadius().X, gameModel->GetBrush()->GetRadius().X);
commandInterface->OnActiveToolChanged(0, gameModel->GetActiveTool(0));
commandInterface->OnActiveToolChanged(1, gameModel->GetActiveTool(1));
@ -937,7 +937,7 @@ void GameController::SetActiveTool(int toolSelection, Tool * tool)
{
gameModel->GetRenderer()->gravityZonesEnabled = true;
}
}
}
}
void GameController::OpenSearch()
@ -1166,7 +1166,7 @@ void GameController::OpenSaveWindow()
new ServerSaveActivity(tempSave, new SaveUploadedCallback(this));
}
else
{
{
SaveInfo tempSave(0, 0, 0, 0, gameModel->GetUser().Username, "");
tempSave.SetGameSave(gameSave);
new ServerSaveActivity(tempSave, new SaveUploadedCallback(this));
@ -1217,7 +1217,7 @@ void GameController::SaveAsCurrent()
new ServerSaveActivity(tempSave, true, new SaveUploadedCallback(this));
}
else
{
{
SaveInfo tempSave(0, 0, 0, 0, gameModel->GetUser().Username, "");
tempSave.SetGameSave(gameSave);
new ServerSaveActivity(tempSave, true, new SaveUploadedCallback(this));
@ -1388,3 +1388,8 @@ void GameController::RunUpdater()
new UpdateActivity();
}
std::vector<Menu*> GameController::GetMenuList()
{
return gameModel->GetMenuList();
}

View File

@ -36,6 +36,7 @@ private:
int screenshotIndex;
PreviewController * activePreview;
GameView * gameView;
GameModel * gameModel;
SearchController * search;
RenderController * renderOptions;
LoginController * loginWindow;
@ -56,7 +57,6 @@ public:
class SaveOpenCallback;
friend class SaveOpenCallback;
GameController();
GameModel * gameModel;
~GameController();
GameView * GetView();
@ -148,6 +148,7 @@ public:
virtual void NotifyAuthUserChanged(Client * sender);
virtual void NotifyNewNotification(Client * sender, std::pair<std::string, std::string> notification);
void RunUpdater();
std::vector<Menu*> GetMenuList();
};
#endif // GAMECONTROLLER_H

View File

@ -1323,7 +1323,7 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
if(ctrl)
c->SetDecoration();
else
c->SetActiveMenu(c->gameModel->GetMenuList()[SC_DECO]);
c->SetActiveMenu(c->GetMenuList()[SC_DECO]);
break;
case 'y':
c->SwitchAir();