Changeset 2346 for code/branches/questsystem3/src/orxonox/overlays/notifications/NotificationManager.cc
- Timestamp:
- Dec 5, 2008, 7:38:53 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem3/src/orxonox/overlays/notifications/NotificationManager.cc
r2328 r2346 87 87 updateQueue(); 88 88 89 COUT( 3) << "Notification inserted, title: " << notification->getTitle() << ", message: " << notification->getMessage() << std::endl;89 COUT(4) << "Notification inserted. Title: " << notification->getTitle() << std::endl; 90 90 91 91 return true; … … 104 104 continue; 105 105 106 COUT(3) << "Update, title: " << container->notification->getTitle() << ", message: " << container->notification->getMessage() << std::endl; 107 108 text = text + "\n\n\n------------" + container->notification->getTitle() + "\n\n" + container->notification->getMessage(); 106 text = text + "\n\n\n------------\n\n" + container->notification->getTitle() + "\n\n" + container->notification->getMessage(); 109 107 } 110 111 COUT(3) << "Queue updated: " << text << std::endl;112 108 113 109 NotificationQueue::queue_s->setQueueText(text); 114 110 } 111 112 const std::string & NotificationManager::clipMessage(const std::string & message) 113 { 114 std::string* clippedMessageP = new std::string(); 115 std::string clippedMessage = *clippedMessageP; 116 clippedMessage = ""; 117 std::string tempWord = ""; 118 int wordLength = 0; 119 signed int i = 0; 120 int widthLeft = NotificationQueue::queue_s->getWidth(); 121 while(i < message.length()) 122 { 123 while(i < message.length() && message[i] != ' ' && message[i] != '\n') 124 { 125 tempWord = tempWord + message[i]; 126 i++; 127 wordLength++; 128 } 129 130 if(wordLength <= widthLeft) 131 { 132 clippedMessage = clippedMessage + tempWord + message[i]; 133 widthLeft -= (wordLength+1); 134 wordLength = 0; 135 tempWord = ""; 136 i++; 137 } 138 else 139 { 140 clippedMessage = clippedMessage + '\n' + tempWord + message[i]; 141 widthLeft = NotificationQueue::queue_s->getWidth() - (wordLength+1); 142 i++; 143 wordLength = 0; 144 tempWord = ""; 145 } 146 } 147 148 return clippedMessage; 149 } 115 150 116 151 }
Note: See TracChangeset
for help on using the changeset viewer.