Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11401


Ignore:
Timestamp:
Apr 13, 2017, 3:47:48 PM (7 years ago)
Author:
rrogge
Message:

zeigt PickupInventory an

Location:
code/branches/Dialogue_FS17
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Dialogue_FS17/data/levels/events.oxw

    r11394 r11401  
    5858
    5959<DistanceTrigger name="test" position="0,0,0" target="Pawn" distance=25 stayActive="true"/>
    60     <Backlight position="0,0,0" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,0,0"/>
    61     <DialogueManager question="Hello World3">
     60    <Backlight position="0,0,0" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,0,1"/>
     61    <NextQuestion question="Hello World3">
    6262      <events>
    6363        <execute>
     
    6565        </execute>
    6666      </events>
    67     </DialogueManager>
     67    </NextQuestion>
    6868
    6969    <!-- red -->
  • code/branches/Dialogue_FS17/data/overlays/HUDTemplates3.oxo

    r11354 r11401  
    214214    />
    215215
    216   </OverlayGroup>
    217 </Template>
     216    <GUIOverlay
     217      name = "Dialogue"
     218      guiname = "Dialogue"
     219      visible = "false"
     220    />
     221
     222  </OverlayGroup>
     223</Template>
  • code/branches/Dialogue_FS17/src/modules/dialogue/CMakeLists.txt

    r11382 r11401  
    11SET_SOURCE_FILES(DIALOGUE_SRC_FILES
    22  DialogueManager.cc
     3  NextQuestion.cc
    34 
    45)
  • code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc

    r11394 r11401  
    4141                return question;
    4242        }
    43         void DialogueManager::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     43        /*void DialogueManager::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    4444    {
    4545        SUPER(DialogueManager, XMLPort, xmlelement, mode);
    4646
    4747        XMLPortParam(DialogueManager, "question", setquestion, getquestion, xmlelement, mode);
    48     }
     48    }*/
    4949
    50         bool DialogueManager::execute(bool bTriggered, BaseObject* trigger)
    51     { 
    52         //if(!bTriggered) return false;
    53 
    54 
    55 
    56         orxout() << "bTriggered is " << bTriggered;
    57         //orxout() << " 1 " << mystring << endl;
    58         return false;
    59     }
    60 
    61     void DialogueManager::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
    62     {
    63         SUPER(DialogueManager, XMLEventPort, xmlelement, mode);
    64 
    65         XMLPortEventSink(DialogueManager, BaseObject, "execute", execute, xmlelement, mode);
    66     }
     50       
    6751
    6852        /*std::string DialogueManager::setnpc(std::string npc){
  • code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h

    r11393 r11401  
    66#include "network/Host.h"
    77#include "network/NetworkFunctionIncludes.h"
    8 #include "DialoguePrereqs.h"
    98#include "util/Singleton.h"
    109#include <string>
     
    2423                //tolua_begin
    2524                public:
     25               
    2626
    2727                DialogueManager(Context* context); // tolua_export
     
    3030                static DialogueManager& getInstance() { return Singleton<DialogueManager>::getInstance(); }
    3131               
    32                 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    33 
    3432                void setquestion(std::string question);
    3533                std::string getquestion(void);
     34               
    3635
    37 
    38                 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
    39                 bool execute(bool bTriggered, BaseObject* trigger);
    40 
     36               
    4137       
    4238
  • code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc

    r11393 r11401  
    11#include <vector>
    22#include <string>
     3#include "core/CoreIncludes.h"
     4#include "core/GUIManager.h"
     5
    36
    47#include "NextQuestion.h"
     
    912        RegisterClass(NextQuestion);
    1013
    11         vector<NextQuestion> nextquestion;
     14        NextQuestion::NextQuestion(Context* context) : BaseObject(context)
     15    {
     16        RegisterObject(NextQuestion);
     17        orxout() << "Klasse aufgerufen" << endl;
    1218
    13         void NextQuestion::setanswers(std::string option1, std::string option2, std::string option3){
     19    }
     20
     21        void NextQuestion::setquestion(std::string question){
     22                question=question;
     23        }
     24
     25        std::string NextQuestion::getquestion(void){
     26                return question;
     27        }
     28
     29       
     30        //
     31
     32       
     33        //XML and Event shit
     34        void NextQuestion::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     35    {
     36        SUPER(NextQuestion, XMLPort, xmlelement, mode);
     37
     38        XMLPortParam(NextQuestion, "question", setquestion, getquestion, xmlelement, mode);
     39    }
     40        bool NextQuestion::execute(bool bTriggered, BaseObject* trigger)
     41    { 
     42        //if(!bTriggered) return false;
     43       
     44       
     45
     46
     47        orxout() << "bTriggered is " << bTriggered << endl;
     48
     49        for (DialogueManager* hud : ObjectList<DialogueManager>())
     50            m = hud;
     51        m->setquestion(question);
     52        //orxout() << " 1 " << mystring << endl;
     53        return false;
     54    }
     55
     56    void NextQuestion::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
     57    {
     58        SUPER(NextQuestion, XMLEventPort, xmlelement, mode);
     59
     60        XMLPortEventSink(NextQuestion, BaseObject, "execute", execute, xmlelement, mode);
     61    }
     62        /*void NextQuestion::setanswers(std::string option1, std::string option2, std::string option3){
    1463                options.at(0)=option1;
    1564                options.at(1)=option2;
     
    2372        int NextQuestion::getnumOptions(){
    2473                return options.size();
    25         }
     74        }*/
    2675
    2776}
  • code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.h

    r11393 r11401  
    11#include <vector>
    22#include <string>
     3#include "core/class/Identifier.h"
     4#include "OrxonoxPrereqs.h"
     5#include "core/XMLPort.h"
     6#include "core/EventIncludes.h"
     7#include "DialogueManager.h"
    38
    4 #include "core/XMLPort.h"
     9
    510
    611namespace orxonox{
    7         void setanswers(std::string option1, std::string option2, std::string option3);
    8         std::vector <std::string> getanswers(void);
     12        class _OrxonoxExport NextQuestion : public BaseObject
     13        {
     14               
     15                //tolua_begin
     16                public:
    917
    10         int getnumOptions();
    11         std::vector<std::string> options;
     18                NextQuestion (Context* context); // tolua_export
     19               
     20
     21                void setquestion(std::string question);
     22                std::string getquestion(void);
     23
     24
     25               
     26 
     27               
     28                virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     29
     30                /*void setanswers(std::string option1, std::string option2, std::string option3);
     31                std::vector <std::string> getanswers(void);
     32
     33                int getnumOptions();
     34                std::vector<std::string> options;*/
     35
     36                //Event
     37                virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
     38                bool execute(bool bTriggered, BaseObject* trigger);
     39
     40               
     41        private:
     42                std::string question;
     43                DialogueManager* m;
     44
     45        };
     46       
    1247}
Note: See TracChangeset for help on using the changeset viewer.