Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 11, 2017, 3:04:50 PM (8 years ago)
Author:
rrogge
Message:

Singletonkram figured out

Location:
code/branches/Dialogue_FS17
Files:
4 edited

Legend:

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

    r11413 r11415  
    9797    local detailsButton = winMgr:createWindow("MenuWidgets/Button", "/DetailsButton")
    9898    local a1 = orxonox.DialogueManager:getInstance():getanswers1()
    99     detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+2*P.buttonWidth),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
    100     detailsButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     99    detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.25, 0)))
     100    detailsButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, 575), CEGUI.UDim(0, P.textHeight)))
    101101    detailsButton:setText(a1)
    102102    orxonox.GUIManager:subscribeEventHelper(detailsButton, "Clicked", P.name ..".a1Button_clicked")
    103     root:addChildWindow(detailsButton)
     103    P.wrapper:addChildWindow(detailsButton)
    104104
    105105    local a2Button = winMgr:createWindow("MenuWidgets/Button", "/a2Button")
    106106    local a2 = orxonox.DialogueManager:getInstance():getanswers2()
    107     a2Button:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+40+2*P.buttonWidth),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
    108     a2Button:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     107    a2Button:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.4, 0)))
     108    a2Button:setSize(CEGUI.UVector2(CEGUI.UDim(0, 575), CEGUI.UDim(0, P.textHeight)))
    109109    a2Button:setText(a2)
    110110    orxonox.GUIManager:subscribeEventHelper(a2Button, "Clicked", P.name ..".a2Button_clicked")
    111     root:addChildWindow(a2Button)
     111    P.wrapper:addChildWindow(a2Button)
    112112
    113113
     
    139139
    140140function P.a2Button_clicked(e)
    141     orxonox.DialogueManager:getInstance():a2clicked()
     141    orxonox.CommandExecutor:execute("OrxonoxOverlay toggleVisibility Dialogue")
    142142end
    143143
  • code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc

    r11413 r11415  
    66#include "network/Host.h"
    77#include "network/NetworkFunctionIncludes.h"
    8 #include "DialogueManager.h"
    98#include "DialoguePrereqs.h"
    109#include <vector>
    1110#include <string>
    1211#include "core/XMLPort.h"
     12#include "NextQuestion.h"
    1313
    1414
    1515namespace orxonox {
    16         //ManageScopedSingleton(DialogueManager, ScopeID::ROOT, false);
    17         RegisterAbstractClass(DialogueManager).inheritsFrom<BaseObject>();
     16        ManageScopedSingleton(DialogueManager, ScopeID::ROOT, false);
     17       
    1818
     19        //DialogueManager* DialogueManager::singletonPtr_s =nullptr;
    1920
    20 
    21         DialogueManager* DialogueManager::singletonPtr_s =nullptr;
    22 
    23         DialogueManager::DialogueManager(Context* context): BaseObject(context){
     21        DialogueManager::DialogueManager(){
    2422                orxout() << "Dialog Konstruktor" << endl;
    25                 RegisterObject(DialogueManager);
     23                //RegisterObject(DialogueManager);
    2624               
    2725               
     
    6664        bool DialogueManager::a1clicked(void){
    6765                orxout() << "a1 clicked" << endl;
     66
    6867                return true;
    6968        }
  • code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h

    r11413 r11415  
    1616
    1717
     18
     19
    1820namespace orxonox //tolua_export
    1921
    2022{//tolua_export
    2123        class _OrxonoxExport DialogueManager //tolua_export
    22         : public Singleton<DialogueManager>, public BaseObject
     24        : public Singleton<DialogueManager>
    2325        {//tolua_export
    2426                friend class Singleton<DialogueManager>;
     
    2729               
    2830
    29                 DialogueManager(Context* context);
     31                DialogueManager();
    3032               
    3133
     
    5658*/
    5759private:
     60        //NextQuestion currentQuestion;
    5861        std::string a1;
    5962        std::string a2;
  • code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc

    r11413 r11415  
    1717        RegisterObject(NextQuestion);
    1818        orxout() << "Klasse aufgerufen" << endl;
    19          DialogueManager* d = new DialogueManager(context);
     19       
    2020       
    2121    }
     
    109109        }
    110110
    111         NextQuestion NextQuestion::compare(){
     111
     112        /*NextQuestion NextQuestion::compare(){
    112113                DialogueManager& m = DialogueManager::getInstance();
    113114                if(m.a1clicked()){
     
    118119                        return *possibleQuestions[1];
    119120                }
    120         }
     121        }*/
    121122
    122123
Note: See TracChangeset for help on using the changeset viewer.