summaryrefslogtreecommitdiff
path: root/src/game/GameModel.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-04-04 17:52:34 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-04-04 17:52:34 (GMT)
commit89cdeef9ad9c164e9f484cded3096bcbc72b7207 (patch)
tree6a26f6313e7cf45a277756890e087201704bab90 /src/game/GameModel.cpp
parent299c1da9ae6b79ddb6cc39477ad31fb1d2a3c566 (diff)
downloadpowder-89cdeef9ad9c164e9f484cded3096bcbc72b7207.zip
powder-89cdeef9ad9c164e9f484cded3096bcbc72b7207.tar.gz
CommandInterface, Mouse, Keyboard and Tick events, on screen log, print redirected to tpt.log
Diffstat (limited to 'src/game/GameModel.cpp')
-rw-r--r--src/game/GameModel.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp
index 2a9b69e..6a8f3d8 100644
--- a/src/game/GameModel.cpp
+++ b/src/game/GameModel.cpp
@@ -457,6 +457,19 @@ void GameModel::SetStamp(Save * newStamp)
notifyStampChanged();
}
+void GameModel::Log(string message)
+{
+ consoleLog.push_front(message);
+ if(consoleLog.size()>100)
+ consoleLog.pop_back();
+ notifyLogChanged(message);
+}
+
+deque<string> GameModel::GetLog()
+{
+ return consoleLog;
+}
+
void GameModel::notifyColourSelectorColourChanged()
{
for(int i = 0; i < observers.size(); i++)
@@ -576,3 +589,11 @@ void GameModel::notifyClipboardChanged()
observers[i]->NotifyClipboardChanged(this);
}
}
+
+void GameModel::notifyLogChanged(string entry)
+{
+ for(int i = 0; i < observers.size(); i++)
+ {
+ observers[i]->NotifyLogChanged(this, entry);
+ }
+}