Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7341


Ignore:
Timestamp:
Sep 3, 2010, 4:53:51 PM (14 years ago)
Author:
dafrick
Message:

Fixed Esc Problem in MainMenu.

Location:
code/branches/notifications
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/notifications/data/gui/scripts/SheetManager.lua

    r7340 r7341  
    210210
    211211    -- If the first sheet that needs input is the MainMenu.
    212     if counter > 0 and activeMenuSheets.size == counter and activeMenuSheets[counter].sheet.name == "MainMenu" then
     212    if counter == 1 and activeMenuSheets[1].sheet.name == "MainMenu" then
    213213        orxonox.execute("exit")
    214214    -- If there is at least one sheet that needs input.
  • code/branches/notifications/src/modules/notifications/NotificationManager.cc

    r7338 r7341  
    6161        this->highestIndex_ = 0;
    6262
    63         //TODO: What if no graphics?
    64         GUIManager::getInstance().loadGUI("NotificationLayer");
    65         // Create first queue:
    66         NotificationQueue* queue = new NotificationQueue("general");
     63        if(GameMode::showsGraphics())
     64        {
     65            GUIManager::getInstance().loadGUI("NotificationLayer");
     66
     67            // Create first queue:
     68            NotificationQueue* queue = new NotificationQueue("all");
     69        }
    6770    }
    6871
     
    9497        this->allNotificationsList_.insert(std::pair<std::time_t,Notification*>(time,notification));
    9598
    96         if(notification->getSender() == NONE) //!< If the sender has no specific name, then the Notification is only added to the list of all Notifications.
     99        if(notification->getSender() == NONE) // If the sender has no specific name, then the Notification is only added to the list of all Notifications.
    97100            return true;
    98101
    99102        bool all = false;
    100         if(notification->getSender() == ALL) //!< If all are the sender, then the Notifications is added to every NotificationListener.
     103        if(notification->getSender() == ALL) // If all are the sender, then the Notifications is added to every NotificationListener.
    101104            all = true;
    102105
    103         //!< Insert the notification in all listeners that have its sender as target.
    104         for(std::map<NotificationListener*,int>::iterator it = this->listenerList_.begin(); it != this->listenerList_.end(); it++) //!< Iterate through all listeners.
     106        // Insert the notification in all listeners that have its sender as target.
     107        for(std::map<NotificationListener*,int>::iterator it = this->listenerList_.begin(); it != this->listenerList_.end(); it++) // Iterate through all listeners.
    105108        {
    106109            std::set<std::string> set = it->first->getTargetsSet();
    107110            if(all || set.find(notification->getSender()) != set.end() || set.find(ALL) != set.end()) //TODO: Make sure this works.
    108111            {
    109                 this->notificationLists_[it->second]->insert(std::pair<std::time_t,Notification*>(time,notification)); //!< Insert the Notification in the Notifications list of the current NotificationListener.
    110                 it->first->update(notification, time); //!< Update the listener.
     112                this->notificationLists_[it->second]->insert(std::pair<std::time_t,Notification*>(time,notification)); // Insert the Notification in the Notifications list of the current NotificationListener.
     113                it->first->update(notification, time); // Update the listener.
    111114                std::map<Notification*, unsigned int>::iterator counterIt = this->listenerCounter_.find(notification);
    112115                if(counterIt == this->listenerCounter_.end())
     
    160163        Returns true if successful.
    161164    */
     165    //TODO: Needed?
    162166    bool NotificationManager::removeNotification(Notification* notification, std::multimap<std::time_t, Notification*>& map)
    163167    {
     
    188192        int index = this->highestIndex_;
    189193
    190         this->listenerList_[listener] = index; //!< Add the NotificationListener to the list of listeners.
     194        this->listenerList_[listener] = index; // Add the NotificationListener to the list of listeners.
    191195
    192196        std::set<std::string> set = listener->getTargetsSet(); //TODO: Does this work?
    193197
    194         //! If all senders are the target of the listener, then the list of notification for that specific listener is te same as the list of all Notifications.
     198        // If all senders are the target of the listener, then the list of notification for that specific listener is te same as the list of all Notifications.
    195199        if(set.find(ALL) != set.end())
    196200        {
     
    203207        std::multimap<std::time_t,Notification*> map = *this->notificationLists_[index];
    204208
    205         //! Iterate through all Notifications to determine whether any of them should belong to the newly registered NotificationListener.
     209        // Iterate through all Notifications to determine whether any of them should belong to the newly registered NotificationListener.
    206210        for(std::multimap<std::time_t,Notification*>::iterator it = this->allNotificationsList_.begin(); it != this->allNotificationsList_.end(); it++)
    207211        {
    208             if(set.find(it->second->getSender()) != set.end()) //!< Checks whether the overlay has the sender of the current notification as target.
     212            if(set.find(it->second->getSender()) != set.end()) // Checks whether the overlay has the sender of the current notification as target.
    209213            {
    210214                map.insert(std::pair<std::time_t, Notification*>(it->first, it->second));
     
    217221        }
    218222
    219         listener->update(); //!< Update the listener.
     223        listener->update(); // Update the listener.
    220224
    221225        COUT(4) << "NotificationListener registered with the NotificationManager." << std::endl;
     
    272276            return false;
    273277
    274         std::multimap<std::time_t,Notification*>* notifications = this->notificationLists_[this->listenerList_[listener]]; //!< The Notifications for the input NotificationListener.
    275 
    276         if(notifications == NULL) //!< Returns NULL, if there are no Notifications.
     278        std::multimap<std::time_t,Notification*>* notifications = this->notificationLists_[this->listenerList_[listener]]; // The Notifications for the input NotificationListener.
     279
     280        if(notifications == NULL) // Returns NULL, if there are no Notifications.
    277281            return true;
    278282
     
    281285        itHighest = notifications->upper_bound(timeFrameStart);
    282286
    283         for(it = itLowest; it != itHighest; it++) //!< Iterate through the Notifications from the start of the time Frame to the end of it.
    284         {
    285             map->insert(std::pair<std::time_t,Notification*>(it->first,it->second)); //!< Add the found Notifications to the map.
     287        for(it = itLowest; it != itHighest; it++) // Iterate through the Notifications from the start of the time Frame to the end of it.
     288        {
     289            map->insert(std::pair<std::time_t,Notification*>(it->first,it->second)); // Add the found Notifications to the map.
    286290        }
    287291
Note: See TracChangeset for help on using the changeset viewer.