Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 5, 2016, 3:59:27 PM (8 years ago)
Author:
dmoritz
Message:

Picture added

Location:
code/branches/Dialog_HS16/src/modules/notifications/dispatchers
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Dialog_HS16/src/modules/notifications/dispatchers/CMakeLists.txt

    r11292 r11317  
    33  SimpleNotification.cc
    44  Dialogue.cc
    5   DialogueManager.cc
    65)
  • code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.cc

    r11270 r11317  
     1
    12
    23
     
    56#include "core/EventIncludes.h"
    67#include "core/XMLPort.h"
     8
     9#include "overlays/hud/HUDDialogue.h"
     10
     11#include "NotificationDispatcher.h"
    712
    813namespace orxonox{
     
    2833        XMLPortParam(Dialogue, "speaker", setSpeaker, getSpeaker, xmlelement, mode);
    2934        XMLPortParam(Dialogue, "message", setMessage, getMessage, xmlelement, mode);
     35        XMLPortParam(Dialogue, "portrait", setPortrait, getPortrait, xmlelement, mode);
    3036       
    3137    }
     38     void Dialogue::update()
     39   {   
     40       for(HUDDialogue* huddialogue : ObjectList<HUDDialogue>())
     41                       huddialogue->updateTarget(portrait_);
     42    }
     43   
    3244    const std::string& Dialogue::createNotificationMessage(void)
    3345                {       
    34                         dialogue_ = speaker_ + message_;
     46                        dialogue_ = speaker_ + ": " + message_;
     47                    this->update();
    3548                        return this->dialogue_ ;
    3649                }
  • code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.h

    r11292 r11317  
    2020
    2121            const std::string& getMessage(void)
    22                 { return this->message_; }
     22                        { return this->message_; }
    2323                const std::string& getSpeaker(void)
    2424                        {return this->speaker_;}
     25            const std::string& getPortrait(void)
     26                        { return this->portrait_;}
     27
    2528    protected:
    2629        virtual const std::string& createNotificationMessage(void);
    27                
     30        virtual void update(void);
    2831       
    2932    private:
     
    3134                std::string speaker_;
    3235                std::string dialogue_;
     36                std::string portrait_;
    3337
    3438                void setSpeaker(const std::string& speaker)
     
    3640                void setMessage(const std::string& message)
    3741                { this->message_ = message; }
     42            void setPortrait(const std::string& portrait)
     43                { this->portrait_ = portrait;}
    3844        } ;       
    39 
    4045}
    4146
Note: See TracChangeset for help on using the changeset viewer.