- Timestamp:
- May 28, 2011, 4:21:14 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tutoriallevel3/src/modules/notifications/NotificationQueueCEGUI.cc
r8453 r8636 47 47 { 48 48 49 CreateFactory(NotificationQueueCEGUI); 50 49 51 // Register tolua_open function when loading the library. 50 52 DeclareToluaInterface(Notifications); … … 52 54 /*static*/ const std::string NotificationQueueCEGUI::NOTIFICATION_LAYER("NotificationLayer"); 53 55 54 NotificationQueueCEGUI::NotificationQueueCEGUI( const std::string& name, const std::string& senders, unsigned int size, unsigned int displayTime) : NotificationQueue(name, senders, size, displayTime)56 NotificationQueueCEGUI::NotificationQueueCEGUI(BaseObject* creator) : NotificationQueue(creator) 55 57 { 56 58 RegisterObject(NotificationQueueCEGUI); 57 59 60 this->initialize(); 61 } 62 63 NotificationQueueCEGUI::~NotificationQueueCEGUI() 64 { 65 if(GameMode::showsGraphics()) 66 GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".removeQueue(\"" + this->getName() + "\")"); 67 } 68 69 /** 70 @brief 71 Initializes The NotificationQueueCEGUI. 72 */ 73 void NotificationQueueCEGUI::initialize(void) 74 { 58 75 this->displaySize_ = Vector4(1.0, 0.0, 0.0, 0.0); 59 76 this->position_ = Vector4(0.0, 0.0, 0.0, 0.0); … … 62 79 this->fontColor_ = Vector4(1.0, 1.0, 1.0, 1.0); 63 80 this->fontColorStr_ = "FFFFFFFF"; 64 65 // Create the NotificationQueueCEGUI in lua. 66 this->create(); 67 } 68 69 NotificationQueueCEGUI::~NotificationQueueCEGUI() 70 { 71 81 } 82 83 void NotificationQueueCEGUI::XMLPort(Element& xmlelement, XMLPort::Mode mode) 84 { 85 SUPER(NotificationQueueCEGUI, XMLPort, xmlelement, mode); 86 87 XMLPortParam(NotificationQueueCEGUI, "position", setPosition, getPosition, xmlelement, mode); 88 XMLPortParam(NotificationQueueCEGUI, "fontSize", setFontSize, getFontSize, xmlelement, mode); 89 XMLPortParam(NotificationQueueCEGUI, "fontColor", setFontColor, getFontColor, xmlelement, mode); 90 XMLPortParam(NotificationQueueCEGUI, "alignment", setAlignment, getAlignment, xmlelement, mode); 91 XMLPortParam(NotificationQueueCEGUI, "displaySize", setDisplaySize, getDisplaySize, xmlelement, mode); 72 92 } 73 93 … … 266 286 void NotificationQueueCEGUI::create(void) 267 287 { 268 if(GameMode::showsGraphics()) 288 this->NotificationQueue::create(); 289 290 if(this->isRegistered() && GameMode::showsGraphics()) 269 291 GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".createQueue(\"" + this->getName() + "\", " + multi_cast<std::string>(this->getMaxSize()) + ")"); 270 292 }
Note: See TracChangeset
for help on using the changeset viewer.