- Timestamp:
- Sep 24, 2010, 12:01:57 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/notifications/NotificationManager.cc
r7486 r7488 58 58 DeclareToluaInterface(Notifications); 59 59 60 ManageScopedSingleton(NotificationManager, ScopeID:: Graphics, false);60 ManageScopedSingleton(NotificationManager, ScopeID::Root, false); 61 61 62 62 // Setting console command to enter the edit mode. … … 88 88 ModifyConsoleCommand("enterEditMode").setObject(NULL); 89 89 90 // Destroys all Notifications. 91 for(std::multimap<std::time_t, Notification*>::iterator it = this->allNotificationsList_.begin(); it!= this->allNotificationsList_.end(); it++) 92 it->second->destroy(); 93 this->allNotificationsList_.clear(); 94 90 95 COUT(3) << "NotificationManager destroyed." << std::endl; 91 96 } … … 98 103 { 99 104 // Destroys all NotificationQueues that have been registered with the NotificationManager. 100 for(std::map<const std::string, NotificationQueue*>::iterator it = this->queues_.begin(); it != this->queues_.end(); ) 101 { 102 NotificationQueue* queue = (*it).second; 103 it++; 104 queue->destroy(); 105 for(std::map<const std::string, NotificationQueue*>::iterator it = this->queues_.begin(); it != this->queues_.end(); it++) 106 { 107 it->second->destroy(true); 105 108 } 106 109 this->queues_.clear(); … … 124 127 if(GameMode::isStandalone() || isLocal || Host::getPlayerID() == clientId) 125 128 { 126 Notification* notification = new Notification(message); 127 notification->send(sender); 129 Notification* notification = new Notification(message, sender); 130 if(NotificationManager::getInstance().registerNotification(notification)) 131 COUT(3) << "Notification \"" << notification->getMessage() << "\" sent." << std::endl; 128 132 } 129 133 // If we're on the server (and the server is not the intended recipient of the Notification) we send it over the network.
Note: See TracChangeset
for help on using the changeset viewer.