Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.cc @ 11317

Last change on this file since 11317 was 11317, checked in by dmoritz, 7 years ago

Picture added

File size: 1.2 KB
RevLine 
[11247]1
2
[11317]3
[11247]4#include "Dialogue.h"
5#include "core/CoreIncludes.h"
6#include "core/EventIncludes.h"
7#include "core/XMLPort.h"
8
[11317]9#include "overlays/hud/HUDDialogue.h"
10
11#include "NotificationDispatcher.h"
12
[11247]13namespace orxonox{
14       
15        RegisterClass(Dialogue);
16
[11261]17        Dialogue::Dialogue(Context* context):NotificationDispatcher(context){
[11247]18                RegisterObject(Dialogue);
19
[11261]20                this->setSender("dialogue");
21
22        this->setSyncMode(ObjectDirection::None);
[11247]23        }
24
25        Dialogue::~Dialogue()
26    {
27
28    }
29    void Dialogue::XMLPort(Element& xmlelement, XMLPort::Mode mode)
30    {
31        SUPER(Dialogue, XMLPort, xmlelement, mode);
32
[11270]33        XMLPortParam(Dialogue, "speaker", setSpeaker, getSpeaker, xmlelement, mode);
[11247]34        XMLPortParam(Dialogue, "message", setMessage, getMessage, xmlelement, mode);
[11317]35        XMLPortParam(Dialogue, "portrait", setPortrait, getPortrait, xmlelement, mode);
[11261]36       
[11247]37    }
[11317]38     void Dialogue::update()
39   {   
40       for(HUDDialogue* huddialogue : ObjectList<HUDDialogue>())
41                       huddialogue->updateTarget(portrait_);
42    }
43   
[11270]44    const std::string& Dialogue::createNotificationMessage(void)
45                {       
[11317]46                        dialogue_ = speaker_ + ": " + message_;
47                    this->update();
[11270]48                        return this->dialogue_ ;
49                }
[11247]50}
Note: See TracBrowser for help on using the repository browser.