summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-01-09 03:00:45 (GMT)
committer jacob1 <jfu614@gmail.com>2013-01-09 03:00:45 (GMT)
commit162a8ecba57a3cea84149aa89d6eee742c1e2cea (patch)
tree9ea3a82a3b0ba704769830eebd362e25b02ad5d8 /src/game
parent6dad17c2e170abe561da0ba055c99b0c613e74bc (diff)
downloadpowder-162a8ecba57a3cea84149aa89d6eee742c1e2cea.zip
powder-162a8ecba57a3cea84149aa89d6eee742c1e2cea.tar.gz
readd tpt.hud and tpt.set_console commands
Diffstat (limited to 'src/game')
-rw-r--r--src/game/GameController.cpp16
-rw-r--r--src/game/GameController.h2
-rw-r--r--src/game/GameView.cpp5
-rw-r--r--src/game/GameView.h1
4 files changed, 23 insertions, 1 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp
index 2ec2cfc..3b9a64e 100644
--- a/src/game/GameController.cpp
+++ b/src/game/GameController.cpp
@@ -892,6 +892,11 @@ void GameController::ShowGravityGrid()
gameModel->UpdateQuickOptions();
}
+void GameController::SetHudEnable(bool hudState)
+{
+ gameView->SetHudEnable(hudState);
+}
+
void GameController::SetActiveColourPreset(int preset)
{
gameModel->SetActiveColourPreset(preset);
@@ -1107,7 +1112,16 @@ void GameController::ShowConsole()
{
if(!console)
console = new ConsoleController(NULL, commandInterface);
- ui::Engine::Ref().ShowWindow(console->GetView());
+ if (console->GetView() != ui::Engine::Ref().GetWindow())
+ ui::Engine::Ref().ShowWindow(console->GetView());
+}
+
+void GameController::HideConsole()
+{
+ if(!console)
+ return;
+ if (console->GetView() == ui::Engine::Ref().GetWindow())
+ ui::Engine::Ref().CloseWindow();
}
void GameController::OpenRenderOptions()
diff --git a/src/game/GameController.h b/src/game/GameController.h
index 2e02b25..a3057d2 100644
--- a/src/game/GameController.h
+++ b/src/game/GameController.h
@@ -96,6 +96,7 @@ public:
void SetDecoration(bool decorationState);
void SetDecoration();
void ShowGravityGrid();
+ void SetHudEnable(bool hudState);
void SetActiveMenu(Menu * menu);
void SetActiveTool(int toolSelection, Tool * tool);
void SetActiveColourPreset(int preset);
@@ -123,6 +124,7 @@ public:
void Vote(int direction);
void ChangeBrush();
void ShowConsole();
+ void HideConsole();
void FrameStep();
void TranslateSave(ui::Point point);
void TransformSave(matrix2d transform);
diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp
index 5118d17..d6f519c 100644
--- a/src/game/GameView.cpp
+++ b/src/game/GameView.cpp
@@ -564,6 +564,11 @@ void GameView::SetSample(SimulationSample sample)
this->sample = sample;
}
+void GameView::SetHudEnable(bool hudState)
+{
+ showHud = hudState;
+}
+
ui::Point GameView::GetMousePosition()
{
return mousePosition;
diff --git a/src/game/GameView.h b/src/game/GameView.h
index e17279f..7474da0 100644
--- a/src/game/GameView.h
+++ b/src/game/GameView.h
@@ -126,6 +126,7 @@ public:
//Breaks MVC, but any other way is going to be more of a mess.
ui::Point GetMousePosition();
void SetSample(SimulationSample sample);
+ void SetHudEnable(bool hudState);
bool CtrlBehaviour(){ return ctrlBehaviour; }
bool ShiftBehaviour(){ return shiftBehaviour; }
void ExitPrompt();