summaryrefslogtreecommitdiff
path: root/src/game/GameModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/GameModel.cpp')
-rw-r--r--src/game/GameModel.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp
index 090f46a..91b1c8d 100644
--- a/src/game/GameModel.cpp
+++ b/src/game/GameModel.cpp
@@ -26,7 +26,7 @@ GameModel::GameModel():
{
if(sim->ptypes[i].menusection < 12)
{
- Tool * tempTool = new ElementTool(i, sim->ptypes[i].name, 0, 0, 0);
+ Tool * tempTool = new ElementTool(i, sim->ptypes[i].name, PIXR(sim->ptypes[i].pcolors), PIXG(sim->ptypes[i].pcolors), PIXB(sim->ptypes[i].pcolors));
menuList[sim->ptypes[i].menusection]->AddTool(tempTool);
}
}
@@ -96,6 +96,7 @@ Tool * GameModel::GetActiveTool()
void GameModel::SetActiveTool(Tool * tool)
{
activeTool = tool;
+ notifyActiveToolChanged();
}
vector<Menu*> GameModel::GetMenuList()
@@ -195,3 +196,11 @@ void GameModel::notifyToolListChanged()
observers[i]->NotifyToolListChanged(this);
}
}
+
+void GameModel::notifyActiveToolChanged()
+{
+ for(int i = 0; i < observers.size(); i++)
+ {
+ observers[i]->NotifyActiveToolChanged(this);
+ }
+}