Permalink
Browse files

ctrl+p shortcut to select prop tool

  • Loading branch information...
jacob1 committed Feb 3, 2018
1 parent 3d66b7e commit 0d1c3f5f497638f8a1d38c7c416ecd4ccf683c8b
Showing with 18 additions and 1 deletion.
  1. +8 −0 src/gui/game/GameController.cpp
  2. +1 −0 src/gui/game/GameController.h
  3. +9 −1 src/gui/game/GameView.cpp
@@ -1166,6 +1166,14 @@ void GameController::SetActiveTool(int toolSelection, Tool * tool)
((PropertyTool *)tool)->OpenWindow(gameModel->GetSimulation());
}
void GameController::SetActiveTool(int toolSelection, std::string identifier)
{
Tool *tool = gameModel->GetToolFromIdentifier(identifier);
if (!tool)
return;
SetActiveTool(toolSelection, tool);
}
void GameController::SetLastTool(Tool * tool)
{
gameModel->SetLastTool(tool);
@@ -109,6 +109,7 @@ class GameController: public ClientListener
void RebuildFavoritesMenu();
Tool * GetActiveTool(int selection);
void SetActiveTool(int toolSelection, Tool * tool);
void SetActiveTool(int toolSelection, std::string identifier);
void SetLastTool(Tool * tool);
int GetReplaceModeFlags();
void SetReplaceModeFlags(int flags);
@@ -1481,7 +1481,15 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
break;
case 'p':
case SDLK_F2:
screenshot();
if (ctrl)
{
if (shift)
c->SetActiveTool(1, "DEFAULT_UI_PROPERTY");
else
c->SetActiveTool(0, "DEFAULT_UI_PROPERTY");
}
else
screenshot();
break;
case SDLK_F3:
SetDebugHUD(!GetDebugHUD());

0 comments on commit 0d1c3f5

Please sign in to comment.