Changeset 11393
- Timestamp:
- Apr 6, 2017, 3:40:23 PM (8 years ago)
- Location:
- code/branches/Dialogue_FS17
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Dialogue_FS17/data/levels/emptyLevel.oxw
r11377 r11393 29 29 skybox = "Orxonox/Starbox" 30 30 > 31 <DialogueManager question="Wazzup"> 32 </DialogueManager> 31 <DistanceTrigger name="test" position="0,0,0" target="Pawn" distance=25 stayActive="true"/> 32 <Backlight position="0,0,0" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,0,0"/> 33 <DialogueManager question="Hello World3"> 34 <events> 35 <execute> 36 <EventListener event="test" /> 37 </execute> 38 </events> 39 </DialogueManager> 40 41 <!--<DialogueManager firstquestion="hello world"> 42 <options> 43 <NextQuestion answer="ja" question="question?"> 44 <options> 45 <NextQuestion answer="" question=""> 46 </NextQuestion> 47 </options> 48 </NextQuestion> 49 <events> 50 <execute> 51 <EventListener event="test" /> 52 </execute> 53 </events> 54 </DialogueManager> 55 --> 56 57 33 58 <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> 34 59 <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort /> -
code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc
r11390 r11393 10 10 #include <vector> 11 11 #include <string> 12 #include "core/XMLPort.h" 13 12 14 13 15 namespace orxonox { 14 ManageScopedSingleton(DialogueManager, ScopeID::ROOT, false);15 Register ClassNoArgs(DialogueManager);16 //ManageScopedSingleton(DialogueManager, ScopeID::ROOT, false); 17 RegisterAbstractClass(DialogueManager).inheritsFrom<Configurable>(); 16 18 17 DialogueManager::DialogueManager(){ 19 20 21 DialogueManager* DialogueManager::singletonPtr_s =nullptr; 22 23 DialogueManager::DialogueManager(Context* context): BaseObject(context){ 18 24 RegisterObject(DialogueManager); 19 25 this->setConfigValues(); 26 20 27 21 28 } 22 29 30 23 31 /** 24 32 * @brief set the config values in the orxonox.ini file 25 33 */ 26 void DialogueManager::setConfigValues() 27 { 28 //SetConfigValue(question,std::string).description("Question"); 29 30 } 34 31 35 32 36 void DialogueManager::setquestion(std::string question){ … … 43 47 XMLPortParam(DialogueManager, "question", setquestion, getquestion, xmlelement, mode); 44 48 } 49 50 bool DialogueManager::execute(bool bTriggered, BaseObject* trigger) 51 { 52 if(!bTriggered) return false; 53 54 orxout() << "bTriggered is " << bTriggered; 55 //orxout() << " 1 " << mystring << endl; 56 return false; 57 } 58 59 void DialogueManager::XMLEventPort(Element& xmlelement, XMLPort::Mode mode) 60 { 61 SUPER(DialogueManager, XMLEventPort, xmlelement, mode); 62 63 XMLPortEventSink(DialogueManager, BaseObject, "execute", execute, xmlelement, mode); 64 } 65 45 66 /*std::string DialogueManager::setnpc(std::string npc){ 46 67 return npc; -
code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h
r11390 r11393 13 13 #include "core/config/Configurable.h" 14 14 #include "core/XMLPort.h" 15 #include "core/EventIncludes.h" 15 16 16 17 //tolua_begin … … 18 19 //tolua_end 19 20 {//toluaexport 20 class _OrxonoxExport DialogueManager : public Singleton<DialogueManager>, public Configurable21 class _OrxonoxExport DialogueManager : public Singleton<DialogueManager>, public BaseObject 21 22 { 22 23 friend class Singleton<DialogueManager>; … … 24 25 public: 25 26 26 DialogueManager(); // tolua_export 27 DialogueManager(Context* context); // tolua_export 28 29 27 30 static DialogueManager& getInstance() { return Singleton<DialogueManager>::getInstance(); } 28 void setConfigValues();31 29 32 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 30 33 31 void setquestion(std::string question); 32 std::string getquestion(void); 34 void setquestion(std::string question); 35 std::string getquestion(void); 36 37 38 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 39 bool execute(bool bTriggered, BaseObject* trigger); 40 41 33 42 34 43 /*std::string setnpc(std::string npc);
Note: See TracChangeset
for help on using the changeset viewer.