summaryrefslogtreecommitdiff
path: root/src/game/GameView.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-07-17 15:57:12 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-07-17 15:57:12 (GMT)
commit2329f98f0af9dffda5375aca7b05f9e76a84d06a (patch)
treea0385c88d74e970343a689fed417e5e8d5f05a3d /src/game/GameView.cpp
parent52c9a9052a63cf124c1fca7504c267a03553d8b0 (diff)
downloadpowder-2329f98f0af9dffda5375aca7b05f9e76a84d06a.zip
powder-2329f98f0af9dffda5375aca7b05f9e76a84d06a.tar.gz
Varying update notifications
Diffstat (limited to 'src/game/GameView.cpp')
-rw-r--r--src/game/GameView.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp
index dd03987..8adb9e1 100644
--- a/src/game/GameView.cpp
+++ b/src/game/GameView.cpp
@@ -975,16 +975,18 @@ void GameView::NotifyNotificationsChanged(GameModel * sender)
}
};
- for(std::vector<ui::Component*>::iterator iter = notificationComponents.begin(); iter != notificationComponents.end(); ++iter) {
- RemoveComponent(*iter);
- delete *iter;
+ for(std::vector<ui::Component*>::const_iterator iter = notificationComponents.begin(), end = notificationComponents.end(); iter != end; ++iter) {
+ ui::Component * cNotification = *iter;
+ RemoveComponent(cNotification);
+ delete cNotification;
}
notificationComponents.clear();
+
std::vector<Notification*> notifications = sender->GetNotifications();
int currentY = YRES-17;
- for(std::vector<Notification*>::iterator iter = notifications.begin(); iter != notifications.end(); ++iter)
+ for(std::vector<Notification*>::iterator iter = notifications.begin(), end = notifications.end(); iter != end; ++iter)
{
int width = (Graphics::textwidth((*iter)->Message.c_str()))+8;
ui::Button * tempButton = new ui::Button(ui::Point(XRES-width-22, currentY), ui::Point(width, 15), (*iter)->Message);