Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 14, 2011, 11:02:58 PM (13 years ago)
Author:
dafrick
Message:

Some extension of NotificationQueue, font size and color can now be specified.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tutoriallevel/src/modules/notifications/NotificationQueue.cc

    r7489 r7894  
    159159    {
    160160        this->tickTime_ += dt; // Add the time interval that has passed to the time counter.
    161         if(this->tickTime_ >= 1.0) // If the time counter is greater than 1s all Notifications that have expired are removed, if it is smaller we wait to the next tick.
     161        if(this->displayTime_ != INF && this->tickTime_ >= 1.0) // If the time counter is greater than 1s all Notifications that have expired are removed, if it is smaller we wait to the next tick.
    162162        {
    163163            this->timeLimit_.time = std::time(0)-this->displayTime_; // Container containig the current time.
     
    187187        std::multimap<std::time_t, Notification*>* notifications = new std::multimap<std::time_t, Notification*>;
    188188        // Get the Notifications sent in the interval from now to now minus the display time.
    189         NotificationManager::getInstance().getNotifications(this, notifications, this->displayTime_);
     189        if(this->displayTime_ == INF)
     190            NotificationManager::getInstance().getNewestNotifications(this, notifications, this->getMaxSize());
     191        else
     192            NotificationManager::getInstance().getNotifications(this, notifications, this->displayTime_);
    190193
    191194        if(!notifications->empty())
     
    355358        Sets the maximum number of seconds a Notification is displayed.
    356359    @param time
    357         The number of seconds the Notifications is displayed.
    358     @return
    359         Returns true if successful.
    360     */
    361     void NotificationQueue::setDisplayTime(unsigned int time)
     360        The number of seconds a Notification is displayed.
     361    */
     362    void NotificationQueue::setDisplayTime(int time)
    362363    {
    363364        if(this->displayTime_ == time)
Note: See TracChangeset for help on using the changeset viewer.