diff options
| author | Simon 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) |
| commit | 89cdeef9ad9c164e9f484cded3096bcbc72b7207 (patch) | |
| tree | 6a26f6313e7cf45a277756890e087201704bab90 /src/game/GameModel.cpp | |
| parent | 299c1da9ae6b79ddb6cc39477ad31fb1d2a3c566 (diff) | |
| download | powder-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.cpp | 21 |
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); + } +} |
