diff options
| author | jacob1 <jfu614@gmail.com> | 2013-05-30 00:35:46 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-05-30 00:35:46 (GMT) |
| commit | cbc80de6522b5562f9490b0cdb620371f25be2f9 (patch) | |
| tree | 3a041d9e3632e9f0eb7b85a3f958d6fe9343c187 /src/gui | |
| parent | d29b001d82547e3c2f2e5ef4cf30b84ce59934b7 (diff) | |
| download | powder-cbc80de6522b5562f9490b0cdb620371f25be2f9.zip powder-cbc80de6522b5562f9490b0cdb620371f25be2f9.tar.gz | |
some new sim and ren lua api functions
Diffstat (limited to 'src/gui')
| -rw-r--r-- | src/gui/game/GameController.cpp | 12 | ||||
| -rw-r--r-- | src/gui/game/GameController.h | 2 | ||||
| -rw-r--r-- | src/gui/game/GameView.cpp | 19 | ||||
| -rw-r--r-- | src/gui/game/GameView.h | 3 |
4 files changed, 27 insertions, 9 deletions
diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index d8ff3c6..f4992b2 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -661,7 +661,7 @@ bool GameController::KeyPress(int key, Uint16 character, bool shift, bool ctrl, SwitchGravity(); break; case 'd': - gameView->ToggleDebug(); + gameView->SetDebugHUD(!gameView->GetDebugHUD()); break; case 's': gameView->BeginStampSelection(); @@ -932,6 +932,16 @@ bool GameController::GetHudEnable() return gameView->GetHudEnable(); } +void GameController::SetDebugHUD(bool hudState) +{ + gameView->SetDebugHUD(hudState); +} + +bool GameController::GetDebugHUD() +{ + return gameView->GetDebugHUD(); +} + void GameController::SetActiveColourPreset(int preset) { gameModel->SetActiveColourPreset(preset); diff --git a/src/gui/game/GameController.h b/src/gui/game/GameController.h index b67df41..cc49f3b 100644 --- a/src/gui/game/GameController.h +++ b/src/gui/game/GameController.h @@ -101,6 +101,8 @@ public: void ShowGravityGrid(); void SetHudEnable(bool hudState); bool GetHudEnable(); + void SetDebugHUD(bool hudState); + bool GetDebugHUD(); void SetActiveMenu(int menuID); std::vector<Menu*> GetMenuList(); void SetActiveTool(int toolSelection, Tool * tool); diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index 12414c7..a3b1fe7 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -595,6 +595,18 @@ bool GameView::GetHudEnable() return showHud; } +void GameView::SetDebugHUD(bool mode) +{ + showDebug = mode; + if (ren) + ren->debugLines = showDebug; +} + +bool GameView::GetDebugHUD() +{ + return showDebug; +} + ui::Point GameView::GetMousePosition() { return mousePosition; @@ -1201,13 +1213,6 @@ void GameView::OnMouseWheel(int x, int y, int d) } } -void GameView::ToggleDebug() -{ - showDebug = !showDebug; - if (ren) - ren->debugLines = showDebug; -} - void GameView::BeginStampSelection() { selectMode = SelectStamp; diff --git a/src/gui/game/GameView.h b/src/gui/game/GameView.h index 328b67c..08709df 100644 --- a/src/gui/game/GameView.h +++ b/src/gui/game/GameView.h @@ -131,10 +131,11 @@ public: void SetSample(SimulationSample sample); void SetHudEnable(bool hudState); bool GetHudEnable(); + void SetDebugHUD(bool mode); + bool GetDebugHUD(); bool CtrlBehaviour(){ return ctrlBehaviour; } bool ShiftBehaviour(){ return shiftBehaviour; } void ExitPrompt(); - void ToggleDebug(); SelectMode GetSelectMode() { return selectMode; } void BeginStampSelection(); |
