Console Show quickoption
(best way I could think of)
This commit is contained in:
parent
72b00ca5e1
commit
a9619fad33
@ -146,6 +146,7 @@ GameController::GameController():
|
|||||||
{
|
{
|
||||||
gameView = new GameView();
|
gameView = new GameView();
|
||||||
gameModel = new GameModel();
|
gameModel = new GameModel();
|
||||||
|
gameModel->BuildQuickOptionMenu(this);
|
||||||
|
|
||||||
gameView->AttachController(this);
|
gameView->AttachController(this);
|
||||||
gameModel->AddObserver(gameView);
|
gameModel->AddObserver(gameView);
|
||||||
|
@ -98,7 +98,6 @@ GameModel::GameModel():
|
|||||||
}
|
}
|
||||||
|
|
||||||
BuildMenus();
|
BuildMenus();
|
||||||
BuildQuickOptionMenu();
|
|
||||||
|
|
||||||
//Set default decoration colour
|
//Set default decoration colour
|
||||||
unsigned char colourR = min(Client::Ref().GetPrefInteger("Decoration.Red", 200), 255);
|
unsigned char colourR = min(Client::Ref().GetPrefInteger("Decoration.Red", 200), 255);
|
||||||
@ -173,7 +172,7 @@ void GameModel::UpdateQuickOptions()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameModel::BuildQuickOptionMenu()
|
void GameModel::BuildQuickOptionMenu(GameController * controller)
|
||||||
{
|
{
|
||||||
for(std::vector<QuickOption*>::iterator iter = quickOptions.begin(), end = quickOptions.end(); iter != end; ++iter)
|
for(std::vector<QuickOption*>::iterator iter = quickOptions.begin(), end = quickOptions.end(); iter != end; ++iter)
|
||||||
{
|
{
|
||||||
@ -186,6 +185,7 @@ void GameModel::BuildQuickOptionMenu()
|
|||||||
quickOptions.push_back(new DecorationsOption(this));
|
quickOptions.push_back(new DecorationsOption(this));
|
||||||
quickOptions.push_back(new NGravityOption(this));
|
quickOptions.push_back(new NGravityOption(this));
|
||||||
quickOptions.push_back(new AHeatOption(this));
|
quickOptions.push_back(new AHeatOption(this));
|
||||||
|
quickOptions.push_back(new ConsoleShowOption(this, controller));
|
||||||
|
|
||||||
notifyQuickOptionsChanged();
|
notifyQuickOptionsChanged();
|
||||||
UpdateQuickOptions();
|
UpdateQuickOptions();
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "interface/Colour.h"
|
#include "interface/Colour.h"
|
||||||
#include "graphics/Renderer.h"
|
#include "graphics/Renderer.h"
|
||||||
#include "GameView.h"
|
#include "GameView.h"
|
||||||
|
#include "GameController.h"
|
||||||
#include "Brush.h"
|
#include "Brush.h"
|
||||||
#include "client/User.h"
|
#include "client/User.h"
|
||||||
#include "Notification.h"
|
#include "Notification.h"
|
||||||
@ -18,6 +19,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
class GameView;
|
class GameView;
|
||||||
|
class GameController;
|
||||||
class Simulation;
|
class Simulation;
|
||||||
class Renderer;
|
class Renderer;
|
||||||
|
|
||||||
@ -126,7 +128,7 @@ public:
|
|||||||
std::string GetInfoTip();
|
std::string GetInfoTip();
|
||||||
|
|
||||||
void BuildMenus();
|
void BuildMenus();
|
||||||
void BuildQuickOptionMenu();
|
void BuildQuickOptionMenu(GameController * controller);
|
||||||
|
|
||||||
std::deque<Snapshot*> GetHistory();
|
std::deque<Snapshot*> GetHistory();
|
||||||
void SetHistory(std::deque<Snapshot*> newHistory);
|
void SetHistory(std::deque<Snapshot*> newHistory);
|
||||||
|
@ -62,7 +62,7 @@ private:
|
|||||||
std::string infoTip;
|
std::string infoTip;
|
||||||
int toolTipPresence;
|
int toolTipPresence;
|
||||||
|
|
||||||
queue<ui::Point> pointQueue;
|
queue<ui::Point> pointQueue;
|
||||||
GameController * c;
|
GameController * c;
|
||||||
Renderer * ren;
|
Renderer * ren;
|
||||||
Brush * activeBrush;
|
Brush * activeBrush;
|
||||||
@ -168,7 +168,7 @@ public:
|
|||||||
virtual void OnDraw();
|
virtual void OnDraw();
|
||||||
virtual void OnBlur();
|
virtual void OnBlur();
|
||||||
|
|
||||||
//Top-level handers, for Lua interface
|
//Top-level handlers, for Lua interface
|
||||||
virtual void DoDraw();
|
virtual void DoDraw();
|
||||||
virtual void DoMouseMove(int x, int y, int dx, int dy);
|
virtual void DoMouseMove(int x, int y, int dx, int dy);
|
||||||
virtual void DoMouseDown(int x, int y, unsigned button);
|
virtual void DoMouseDown(int x, int y, unsigned button);
|
||||||
|
@ -99,3 +99,22 @@ public:
|
|||||||
m->SetAHeatEnable(!m->GetAHeatEnable());
|
m->SetAHeatEnable(!m->GetAHeatEnable());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ConsoleShowOption: public QuickOption
|
||||||
|
{
|
||||||
|
GameController * c;
|
||||||
|
public:
|
||||||
|
ConsoleShowOption(GameModel * m, GameController * c_):
|
||||||
|
QuickOption("C", "Show Console", m, Toggle)
|
||||||
|
{
|
||||||
|
c = c_;
|
||||||
|
}
|
||||||
|
virtual bool GetToggle()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
virtual void perform()
|
||||||
|
{
|
||||||
|
c->ShowConsole();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Reference in New Issue
Block a user