summaryrefslogtreecommitdiff
path: root/src/game/GameModel.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-01-23 10:50:48 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-01-23 10:50:48 (GMT)
commit8a65c395f490baea3b55f1418207c4ee172a2b3a (patch)
tree261957afa7218bd67d4a59c32594488aff269861 /src/game/GameModel.cpp
parent8c0678fa48f9598a5ade2d4960c46bfea7e6abef (diff)
downloadpowder-8a65c395f490baea3b55f1418207c4ee172a2b3a.zip
powder-8a65c395f490baea3b55f1418207c4ee172a2b3a.tar.gz
Element menu
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);
+ }
+}