Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11317 for code/branches


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

Picture added

Location:
code/branches/Dialog_HS16
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Dialog_HS16/data/levels/missionOne.oxw

    r11292 r11317  
    3535    displayTime=3.9
    3636    position="0.2, 0, 0.1, 0"
    37     fontSize="23"
     37    fontSize="19"
    3838    fontColor="0.3, 1, 0.2, 0.8"
    3939    alignment="HorzCentred"
     
    371371
    372372    <DistanceTrigger name="spawndelaytrigger0" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=2/>
    373     <Dialogue speaker="ABC: " message=" Press (F3) to see your mission briefing.">
     373    <Dialogue speaker="Speaker" message=" Press (F3) to see your mission briefing." portrait="Orxonox/DialogueHUD_Person">
    374374        <events>
    375375            <trigger>
     
    410410
    411411    <DistanceTrigger name="flying1" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=6/>
    412     <SimpleNotification message="Let's fly to the blinking light.">
     412    <Dialogue speaker="Speaker" message="Let's fly to the blinking light." portrait="Orxonox/DialogueHUD_Person">
    413413        <events>
    414414            <trigger>
     
    416416            </trigger>
    417417        </events>
    418     </SimpleNotification>
     418    </Dialogue>
    419419
    420420    <DistanceTrigger name="flying2" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=10/>
    421     <SimpleNotification message="Use (W) to accelerate and the mouse to steer.">
     421    <Dialogue speaker="Speaker" message="Use (W) to accelerate and the mouse to steer." portrait="Orxonox/DialogueHUD_Person">
    422422        <events>
    423423            <trigger>
     
    425425            </trigger>
    426426        </events>
    427     </SimpleNotification>
     427    </Dialogue>
    428428
    429429<!-- QUEST-Trigger && Message Trigger: navigationend is activated after flying4 was triggered -->
     
    433433
    434434
    435     <Dialogue message="Three arrows just appeared.">
     435    <Dialogue speaker="Speaker2" message="Three arrows just appeared." portrait="Orxonox/DialogueHUD_Person2">
    436436        <events>
    437437            <trigger>
     
    442442
    443443    <DistanceTrigger name="flying5" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=5/>
    444     <SimpleNotification message="Follow those arrows.">
     444    <Dialogue speaker="Speaker2" message="Follow those arrows." portrait="Orxonox/DialogueHUD_Person2">
    445445        <events>
    446446            <trigger>
     
    448448            </trigger>
    449449        </events>
    450     </SimpleNotification>
     450    </Dialogue>
    451451
    452452<!-------------------------------------- PART ONE : Destroy boxes --------------------------------------->
     
    486486
    487487<!-- @Text: How to shoot-->
    488     <SimpleNotification message="Destroy the four boxes." broadcast="true">
     488    <Dialogue speaker="Speaker" message="Destroy the four boxes." portrait="Orxonox/DialogueHUD_Person" broadcast="true">
    489489        <events>
    490490            <trigger>
     
    492492            </trigger>
    493493        </events>
    494     </SimpleNotification>
    495 
    496     <SimpleNotification message=" 1. Aim the a red cycle." broadcast="true">
     494    </Dialogue>
     495
     496    <SimpleNotification message=" 1. Aim at the red cycle." broadcast="true">
    497497        <events>
    498498            <trigger>
  • code/branches/Dialog_HS16/data/overlays/HUDTemplates3.oxo

    r11292 r11317  
    188188     name     = "Dialogue"
    189189     position = "0.5, 0.85"
    190      font     = "VeraMono"
     190     pickpoint = "0.5, 0.5"
     191     font     = "VeraMono"
     192     size = "0.2, 0.2"
    191193     textsize = 0.1
    192194     colour   = "1.0, 1.0, 0.0, 0.8"
  • code/branches/Dialog_HS16/src/modules/notifications/CMakeLists.txt

    r8706 r11317  
    1717    NotificationsPrecompiledHeaders.h
    1818  LINK_LIBRARIES
     19    overlays
    1920    orxonox
    2021  SOURCE_FILES ${NOTIFICATIONS_SRC_FILES}
  • 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
  • code/branches/Dialog_HS16/src/modules/overlays/hud/HUDDialogue.cc

    r11292 r11317  
    1 
    2 
    3 
    41
    52
     
    1310#include <OgreTextAreaOverlayElement.h>
    1411#include <OgrePanelOverlayElement.h>
     12#include "core/CoreIncludes.h"
    1513
    1614namespace orxonox
     
    2321    {
    2422        RegisterObject(HUDDialogue);
    25 
    26         overlayElementIcon_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "Dialogue" + getUniqueNumberString()));
     23        }     
     24    void HUDDialogue::updateTarget(std::string portrait)
     25    {
     26        overlayElementIcon_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "Dialogue" + getUniqueNumberString()));
    2727        overlayElementIcon_->setPosition(0.0f,0.0f);
    2828        overlayElementIcon_->setDimensions(1.0f,1.0f);
    29         this->background_->addChild(overlayElementIcon_);
     29        this->background_->addChild(overlayElementIcon_);     
    3030
    31         overlayElementIcon_->setMaterialName("Orxonox/DialogueHUD_Person");
    32 
    33            }     
    34 
    35         void HUDDialogue::tick(float dt)
     31        overlayElementIcon_->setMaterialName(portrait);
     32        this->setVisible(true);
     33        portraitTimer.setTimer(2.9f,false,createExecutor(createFunctor(&HUDDialogue::invisible, this)));
     34    }
     35    void HUDDialogue::invisible()
    3636    {
    37         SUPER(HUDDialogue, tick, dt);
    38 
    39 
     37        this->setVisible(false);
     38        Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->overlayElementIcon_);
    4039    }
    41 
    4240         HUDDialogue::~HUDDialogue()
    4341         {
     
    4543
    4644         }
    47 
    48          void HUDDialogue::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    49          {
    50                 SUPER(HUDDialogue, XMLPort, xmlelement, mode);
    51          }
    52 
    5345}
  • code/branches/Dialog_HS16/src/modules/overlays/hud/HUDDialogue.h

    r11292 r11317  
    1 
    2 
    3 
    41
    52
     
    1310
    1411#include "util/OgreForwardRefs.h"
    15 #include "tools/interfaces/Tickable.h"
    1612#include "overlays/OrxonoxOverlay.h"
     13#include "tools/Timer.h"
    1714
    1815namespace orxonox
    1916{
    20         class _OverlaysExport HUDDialogue : public OrxonoxOverlay, public Tickable
     17        class _OverlaysExport HUDDialogue : public OrxonoxOverlay
    2118    {
    2219        public:
     
    2421            virtual ~HUDDialogue();
    2522
    26             virtual void tick(float dt) override;
     23            virtual void updateTarget(std::string portrait);
    2724
    28             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    29 
    30 
     25            virtual void invisible();
    3126
    3227      private:
    3328                        Ogre::PanelOverlayElement* overlayElementIcon_;
     29
     30                        Timer portraitTimer;
    3431    };
    3532}
    36 
    3733#endif
Note: See TracChangeset for help on using the changeset viewer.