diff --git a/src/gui/game/GameModel.cpp b/src/gui/game/GameModel.cpp index 8e193ae90..acaf5e359 100644 --- a/src/gui/game/GameModel.cpp +++ b/src/gui/game/GameModel.cpp @@ -353,21 +353,20 @@ void GameModel::BuildMenus() decoToolset[2] = GetToolFromIdentifier("DEFAULT_UI_SAMPLE"); decoToolset[3] = GetToolFromIdentifier("DEFAULT_PT_NONE"); + regularToolset[0] = GetToolFromIdentifier(activeToolIdentifiers[0]); + regularToolset[1] = GetToolFromIdentifier(activeToolIdentifiers[1]); + regularToolset[2] = GetToolFromIdentifier(activeToolIdentifiers[2]); + regularToolset[3] = GetToolFromIdentifier(activeToolIdentifiers[3]); + //Set default tools - regularToolset[0] = GetToolFromIdentifier("DEFAULT_PT_DUST"); - regularToolset[1] = GetToolFromIdentifier("DEFAULT_PT_NONE"); - regularToolset[2] = GetToolFromIdentifier("DEFAULT_UI_SAMPLE"); - regularToolset[3] = GetToolFromIdentifier("DEFAULT_PT_NONE"); - - - if(activeToolIdentifiers[0].length()) - regularToolset[0] = GetToolFromIdentifier(activeToolIdentifiers[0]); - if(activeToolIdentifiers[1].length()) - regularToolset[1] = GetToolFromIdentifier(activeToolIdentifiers[1]); - if(activeToolIdentifiers[2].length()) - regularToolset[2] = GetToolFromIdentifier(activeToolIdentifiers[2]); - if(activeToolIdentifiers[3].length()) - regularToolset[3] = GetToolFromIdentifier(activeToolIdentifiers[3]); + if (!regularToolset[0]) + regularToolset[0] = GetToolFromIdentifier("DEFAULT_PT_DUST"); + if (!regularToolset[1]) + regularToolset[1] = GetToolFromIdentifier("DEFAULT_PT_NONE"); + if (!regularToolset[2]) + regularToolset[2] = GetToolFromIdentifier("DEFAULT_UI_SAMPLE"); + if (!regularToolset[3]) + regularToolset[3] = GetToolFromIdentifier("DEFAULT_PT_NONE"); lastTool = activeTools[0]; @@ -412,24 +411,26 @@ void GameModel::BuildFavoritesMenu() notifyLastToolChanged(); } -Tool * GameModel::GetToolFromIdentifier(ByteString identifier) +Tool *GameModel::GetToolFromIdentifier(ByteString const &identifier) { - for (std::vector