Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7193 for code/trunk/src


Ignore:
Timestamp:
Aug 20, 2010, 9:55:50 PM (14 years ago)
Author:
dafrick
Message:

Added NotificationDispatcher, class that can, upon being triggered, dispatch (send/display) a specified Notification.
Additionally a NotificationDispatcher called CommandNotification, that, upon being triggered, displays a Notification with a message and the name of the key that the command is mapped to. It is envisioned to be used in the, soon to be, tutorial level.
Also: Small bugfix in Notification.

Location:
code/trunk/src/modules/notifications
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/notifications/CMakeLists.txt

    r7164 r7193  
    11SET_SOURCE_FILES(NOTIFICATIONS_SRC_FILES
    22  Notification.cc
     3  NotificationDispatcher.cc
    34  NotificationManager.cc
    45  NotificationOverlay.cc
    56  NotificationQueue.cc
    67)
     8
     9ADD_SUBDIRECTORY(dispatchers)
    710
    811ORXONOX_ADD_LIBRARY(notifications
  • code/trunk/src/modules/notifications/Notification.cc

    r7163 r7193  
    6060    Notification::Notification(BaseObject* creator, const std::string & message) : BaseObject(creator)
    6161    {
     62        RegisterObject(Notification);
     63        this->initialize();
    6264        this->message_ = message;
    6365    }
     
    104106    bool Notification::send(const std::string & sender)
    105107    {
     108        if(this->isSent()) //TODO: Needed?
     109            return false;
     110       
    106111        this->sender_ = sender;
    107112        bool successful = NotificationManager::getInstance().registerNotification(this);
  • code/trunk/src/modules/notifications/NotificationsPrereqs.h

    r7164 r7193  
    6666{
    6767    class Notification;
     68    class NotificationDispatcher;
    6869    class NotificationManager;
    6970    class NotificationOverlay;
    7071    class NotificationQueue;
     72   
     73    //dispatchers
     74    class CommandNotification;
    7175}
    7276
Note: See TracChangeset for help on using the changeset viewer.