ctrl+p shortcut to select prop tool

This commit is contained in:
jacob1 2018-02-03 17:39:23 -05:00
parent 3d66b7e263
commit 0d1c3f5f49
3 changed files with 18 additions and 1 deletions

View File

@ -1166,6 +1166,14 @@ void GameController::SetActiveTool(int toolSelection, Tool * tool)
((PropertyTool *)tool)->OpenWindow(gameModel->GetSimulation()); ((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) void GameController::SetLastTool(Tool * tool)
{ {
gameModel->SetLastTool(tool); gameModel->SetLastTool(tool);

View File

@ -109,6 +109,7 @@ public:
void RebuildFavoritesMenu(); void RebuildFavoritesMenu();
Tool * GetActiveTool(int selection); Tool * GetActiveTool(int selection);
void SetActiveTool(int toolSelection, Tool * tool); void SetActiveTool(int toolSelection, Tool * tool);
void SetActiveTool(int toolSelection, std::string identifier);
void SetLastTool(Tool * tool); void SetLastTool(Tool * tool);
int GetReplaceModeFlags(); int GetReplaceModeFlags();
void SetReplaceModeFlags(int flags); void SetReplaceModeFlags(int flags);

View File

@ -1481,7 +1481,15 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
break; break;
case 'p': case 'p':
case SDLK_F2: case SDLK_F2:
screenshot(); if (ctrl)
{
if (shift)
c->SetActiveTool(1, "DEFAULT_UI_PROPERTY");
else
c->SetActiveTool(0, "DEFAULT_UI_PROPERTY");
}
else
screenshot();
break; break;
case SDLK_F3: case SDLK_F3:
SetDebugHUD(!GetDebugHUD()); SetDebugHUD(!GetDebugHUD());