Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11417


Ignore:
Timestamp:
May 11, 2017, 4:15:10 PM (8 years ago)
Author:
rrogge
Message:

Funktion der Buttons noch fehlerhaft

Location:
code/branches/Dialogue_FS17
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Dialogue_FS17/data/gui/scripts/Dialogue.lua

    r11415 r11417  
    139139
    140140function P.a2Button_clicked(e)
    141     orxonox.CommandExecutor:execute("OrxonoxOverlay toggleVisibility Dialogue")
     141    orxonox.DialogueManager:getInstance():a2clicked()
    142142end
    143143
  • code/branches/Dialogue_FS17/data/levels/events.oxw

    r11413 r11417  
    5959    <DistanceTrigger name="test" position="0,0,0" target="Pawn" distance=25 stayActive="true" />
    6060    <Backlight position="0,0,0" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,0,1"/>
     61   
    6162    <NextQuestion  question="Continue?" a1="yes" a2="no" >
    62       <!-- <possibleQuestions>
     63     <possibleQuestions>
    6364        <NextQuestion  question="Are you sure?" a1="yep let me continue" a2="no actually not" />
    6465        <NextQuestion  question="Why?" a1="Got a dentist's appointment" a2="this sucks" />
    65       </possibleQuestions>     -->
     66      </possibleQuestions>   
    6667      <events>
    6768        <execute>
  • code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc

    r11415 r11417  
    66#include "network/Host.h"
    77#include "network/NetworkFunctionIncludes.h"
    8 #include "DialoguePrereqs.h"
     8#include "DialogueManager.h"
    99#include <vector>
    1010#include <string>
    1111#include "core/XMLPort.h"
    1212#include "NextQuestion.h"
     13
    1314
    1415
     
    3233     */
    3334   
     35
     36        void DialogueManager::registerquestion(NextQuestion* nq){
     37                allQuestions.push_back(nq);
     38
     39        }       
    3440
    3541    void DialogueManager::setquestion(std::string q){
     
    6470        bool DialogueManager::a1clicked(void){
    6571                orxout() << "a1 clicked" << endl;
    66 
     72                currentQuestion = currentQuestion->possibleQuestions[0];
    6773                return true;
    6874        }
  • code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h

    r11415 r11417  
     1#ifndef _DialogueManager_H__
     2#define _DialogueManager_H__
     3
    14#include "core/CoreIncludes.h"
    25#include "core/LuaState.h"
     
    912#include <string>
    1013#include <vector>
    11 #include "OrxonoxPrereqs.h"
     14//#include "OrxonoxPrereqs.h"
    1215#include "core/config/Configurable.h"
    1316#include "core/XMLPort.h"
    1417#include "core/EventIncludes.h"
    15 
     18#include "DialoguePrereqs.h"
     19#include "NextQuestion.h"
    1620
    1721
     
    3741                std::string getquestion(void); //tolua_export
    3842               
    39 
     43                void registerquestion(NextQuestion* nq);
    4044                void setanswers1(std::string a1); //tolua_export
    4145                void setanswers2(std::string a2); //tolua_export
     
    5862*/
    5963private:
    60         //NextQuestion currentQuestion;
     64        NextQuestion* currentQuestion;
     65        std::vector<NextQuestion*> allQuestions;
    6166        std::string a1;
    6267        std::string a2;
     
    6671        };//tolua_export
    6772}//tolua_export
    68 
     73#endif
  • code/branches/Dialogue_FS17/src/modules/dialogue/DialoguePrereqs.h

    r11382 r11417  
    7070
    7171    class DialogueManager;
     72    class NextQuestion;
    7273   
    7374}
  • code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc

    r11415 r11417  
    88#include "NextQuestion.h"
    99#include "core/XMLPort.h"
     10#include "DialogueManager.h"
    1011
    1112namespace orxonox{
     
    1718        RegisterObject(NextQuestion);
    1819        orxout() << "Klasse aufgerufen" << endl;
     20        DialogueManager& m = DialogueManager::getInstance();
     21        m.registerquestion(this);
    1922       
    2023       
  • code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.h

    r11413 r11417  
     1#ifndef _NextQuestion_H__
     2#define _NextQuestion_H__
     3
     4
    15//#include <vector>
    26#include <string>
     
    59#include "core/XMLPort.h"
    610#include "core/EventIncludes.h"
    7 #include "DialogueManager.h"
     11#include "DialoguePrereqs.h"
     12
    813
    914
     
    4146                bool execute(bool bTriggered, BaseObject* trigger);
    4247
    43                
     48                std::vector<NextQuestion*> possibleQuestions;
    4449        private:
    4550                std::string a1;
    4651                std::string a2;
    47                 std::vector<NextQuestion*> possibleQuestions;
     52               
    4853
    4954
     
    5459       
    5560}
     61#endif
Note: See TracChangeset for help on using the changeset viewer.