- Timestamp:
- May 2, 2011, 10:20:45 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tutoriallevel2/src/modules/notifications/NotificationQueue.cc
r8371 r8374 90 90 this->create(); // Creates the NotificationQueue in lua. 91 91 92 // Register the NotificationQueue as NotificationListener with the NotificationManager.93 bool listenerRegistered = NotificationManager::getInstance().registerListener(this);94 if(!listenerRegistered) // If the registration has failed.95 {96 this->registered_ = false;97 // Remove the NotificationQueue in lua.98 if(GameMode::showsGraphics())99 GUIManager::getInstance().getLuaState()->doString("NotificationLayer.removeQueue(\"" + this->getName() + "\")");100 NotificationManager::getInstance().unregisterQueue(this);101 COUT(1) << "Error: NotificationQueue '" << this->getName() << "' could not be registered." << std::endl;102 return;103 }104 105 92 COUT(3) << "NotificationQueue '" << this->getName() << "' created." << std::endl; 106 93 } … … 119 106 120 107 // Unregister with the NotificationManager. 121 NotificationManager::getInstance().unregisterListener(this);122 108 NotificationManager::getInstance().unregisterQueue(this); 123 109 } … … 181 167 Updates the NotificationQueue. 182 168 Updates by clearing the queue and requesting all relevant Notifications from the NotificationManager and inserting them into the queue. 169 This is called by the NotificationManager when the Notifications have changed so much, that the NotificationQueue may have to re-initialize his operations. 183 170 */ 184 171 void NotificationQueue::update(void) … … 418 405 this->targets_.insert(string[i]); 419 406 407 // TODO: Why? 420 408 if(this->registered_) 421 409 { 422 NotificationManager::getInstance().unregister Listener(this);423 NotificationManager::getInstance().register Listener(this);410 NotificationManager::getInstance().unregisterQueue(this); 411 NotificationManager::getInstance().registerQueue(this); 424 412 } 425 413 }
Note: See TracChangeset
for help on using the changeset viewer.