Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11718


Ignore:
Timestamp:
Jan 7, 2018, 10:34:30 PM (6 years ago)
Author:
landauf
Message:

tabs → spaces

Location:
code/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/data/gui/layouts/Dialogue.layout

    r11451 r11718  
    33<GUILayout >
    44    <Window Type="DefaultWindow" Name="orxonox/Dialogue/Background" >
    5         <Property Name="InheritsAlpha" Value="False" />
     5        <Property Name="InheritsAlpha" Value="False" />
    66        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    77        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
  • code/trunk/data/gui/layouts/SingleplayerMenu.layout

    r10258 r11718  
    3333                <Property Name="HorzScrollbar" Value="False" />
    3434                <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.725,0},{0.9,0},{0.875,0}}" />
    35                 <Property Name="HorzFormatting" Value="WordWrapLeftAligned" />
     35                <Property Name="HorzFormatting" Value="WordWrapLeftAligned" />
    3636            </Window>
    3737        </Window>
  • code/trunk/data/gui/scripts/HighscoreMenu.lua

    r11356 r11718  
    1212
    1313function P.onLoad()
    14         P.createLevelList()   
     14    P.createLevelList()   
    1515end
    1616
    1717function P.onShow()
    18        
    19         -- reset tables
    20         P.highscoreList = {}
    21         P.tabList = {}
    22         P.linesList = {}
     18   
     19    -- reset tables
     20    P.highscoreList = {}
     21    P.tabList = {}
     22    P.linesList = {}
    2323
    24         -- fetch save scores and write it into the list
    25         for i=orxonox.Highscore:getInstance():getNumberOfHighscores()-1,0,-1 do
    26                 table.insert(P.highscoreList, orxonox.Highscore:getInstance():getHighscore(i))
    27        
    28         end
    29        
    30         -- read minigames out of the levelList
     24    -- fetch save scores and write it into the list
     25    for i=orxonox.Highscore:getInstance():getNumberOfHighscores()-1,0,-1 do
     26        table.insert(P.highscoreList, orxonox.Highscore:getInstance():getHighscore(i))
     27   
     28    end
     29   
     30    -- read minigames out of the levelList
    3131    for k,v in pairs(P.levelList) do
    3232        if(v:getName() ~= "Hover level" and v:getName() ~= "Pong") then   -- hover and pong dont contain relevant scores
     
    3838function P.onHide()
    3939
    40         -- delete old windows to reload them on show
    41         local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl")
    42         for k,v in pairs(P.tabList) do
    43                 local default = winMgr:getWindow(v)
     40    -- delete old windows to reload them on show
     41    local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl")
     42    for k,v in pairs(P.tabList) do
     43            local default = winMgr:getWindow(v)
    4444            tabControl:removeChildWindow(default)
    45                 winMgr:destroyWindow(default)
     45            winMgr:destroyWindow(default)
    4646    end
    4747end
     
    6868    table.insert(P.tabList, tabName)
    6969    -- create new tab window with desired name
    70         local default = (winMgr:createWindow("DefaultWindow", tabName))
     70    local default = (winMgr:createWindow("DefaultWindow", tabName))
    7171    default:setText(name)
    7272    default:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}")
     
    7979    local offset = 2
    8080    for k,v in pairs(P.highscoreList) do
    81         -- split the score ("Playername./.game./.score")
    82         local splitlist = P.Split(v,"./.")
    83         if(splitlist[2] == name)then 
    84                 local line = P.createPickupEntry(tabName .. k,k,tag)
    85                 table.insert(P.linesList, line)
    86                 line:setYPosition(CEGUI.UDim(0,offset))
    87                 offset = offset + line:getHeight():asAbsolute(1)+2
    88                 pane:addChildWindow(line)       
    89         end
     81        -- split the score ("Playername./.game./.score")
     82        local splitlist = P.Split(v,"./.")
     83        if(splitlist[2] == name)then 
     84            local line = P.createPickupEntry(tabName .. k,k,tag)
     85            table.insert(P.linesList, line)
     86            line:setYPosition(CEGUI.UDim(0,offset))
     87            offset = offset + line:getHeight():asAbsolute(1)+2
     88            pane:addChildWindow(line)
     89        end
    9090       
    9191    end
    9292
    93         local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl")
    94         tabControl:addChildWindow(default)
     93    local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl")
     94    tabControl:addChildWindow(default)
    9595 
    9696
     
    111111   
    112112    item:addChildWindow(player)
    113        
     113       
    114114    local score = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Score")
    115115    score:setText(splitlist[3])
  • code/trunk/data/overlays/HUDTemplates3.oxo

    r11706 r11718  
    156156    />
    157157
    158         <HUDRadar
    159      name                               = "Radar"
    160      background                         = "Orxonox/Radar3D"
    161      material2D                         = "Orxonox/Radar"
    162      material3DMiddle           = "Orxonox/Radar3D"
    163      material3DFront            = "Orxonox/Radar3DFront"
    164      material3DBack                     = "Orxonox/Radar3DBack"
    165      correctaspect                      = true
    166      size                               = "0.17, 0.17"
    167      position                           = "1.0, 1.0"
    168      pickpoint                          = "1.0, 1.0"
    169      rotation                           = 0
    170      sensitivity                        = 1.0
    171      halfDotSizeDistance        = 3000
    172      detectionLimit             = 10000.0
    173      maximumDotSize             = 0.1
    174      maximumDotSize3D           = 0.06
    175      mapAngle3D                         = 0.6435011
     158    <HUDRadar
     159     name                   = "Radar"
     160     background             = "Orxonox/Radar3D"
     161     material2D             = "Orxonox/Radar"
     162     material3DMiddle       = "Orxonox/Radar3D"
     163     material3DFront        = "Orxonox/Radar3DFront"
     164     material3DBack         = "Orxonox/Radar3DBack"
     165     correctaspect          = true
     166     size                   = "0.17, 0.17"
     167     position               = "1.0, 1.0"
     168     pickpoint              = "1.0, 1.0"
     169     rotation               = 0
     170     sensitivity            = 1.0
     171     halfDotSizeDistance    = 3000
     172     detectionLimit         = 10000.0
     173     maximumDotSize         = 0.1
     174     maximumDotSize3D       = 0.06
     175     mapAngle3D             = 0.6435011
    176176    />
    177177
  • code/trunk/data/overlays/towerdefenseHUD.oxo

    r10258 r11718  
    2424     colour    = "1.0, 1.0, 1.0, 1.0"
    2525     align     = "left"
    26                 showlives = false
    27                 showcredits = true
    28                 showwaves = false
     26     showlives = false
     27     showcredits = true
     28     showwaves = false
    2929    />
    3030   
     
    4747     colour    = "1.0, 1.0, 1.0, 1.0"
    4848     align     = "left"
    49                 showlives = true
    50                 showcredits = false
    51                 showwaves = false
     49     showlives = true
     50     showcredits = false
     51     showwaves = false
    5252    />
    5353   
     
    7070     colour    = "1.0, 1.0, 1.0, 1.0"
    7171     align     = "left"
    72         showlives = false
    73                 showcredits = false
    74                 showwaves = true
     72     showlives = false
     73     showcredits = false
     74     showwaves = true
    7575
    7676    />
  • code/trunk/src/modules/dialogue/DialogueManager.cc

    r11435 r11718  
    1515
    1616namespace orxonox {
    17         ManageScopedSingleton(DialogueManager, ScopeID::ROOT, false);
    18        
     17    ManageScopedSingleton(DialogueManager, ScopeID::ROOT, false);
     18   
     19    DialogueManager::DialogueManager(){}
    1920
    20        
    21         DialogueManager::DialogueManager(){}
    22        
     21    void DialogueManager::registerquestion(NextQuestion* nq){
     22        if(allQuestions.size()==0) {
     23            orxout(internal_info) << "At least one NextQuestion has to be set." << endl;
     24        }
     25        allQuestions.push_back(nq);
     26        orxout(internal_info) << "qsize " << allQuestions.size();
    2327
    24        
    25    
    26 
    27         void DialogueManager::registerquestion(NextQuestion* nq){
    28                 if(allQuestions.size()==0) {
    29                         orxout(internal_info) << "At least one NextQuestion has to be set." << endl;
    30                 }
    31                 allQuestions.push_back(nq);
    32                         orxout(internal_info) << "qsize " << allQuestions.size();
    33 
    34         }       
     28    }
    3529
    3630    void DialogueManager::setquestion(std::string q){
    37                 question=q;
    38                
    39         }
    40         void DialogueManager::setCurrentQuestion(NextQuestion* nq){
    41                 currentQuestion=nq;
    42                
    43         }
     31        question=q;
    4432
    45         std::string DialogueManager::getquestion(void){
    46                 return question;
    47         }
     33    }
     34    void DialogueManager::setCurrentQuestion(NextQuestion* nq){
     35        currentQuestion=nq;
    4836
    49         void DialogueManager::setanswers1(std::string a1){
    50                 this->a1=a1;
    51                                 }
     37    }
    5238
    53         void DialogueManager::setanswers2(std::string a2){
    54                 this->a2=a2;
    55                                 }
     39    std::string DialogueManager::getquestion(void){
     40        return question;
     41    }
    5642
    57        
     43    void DialogueManager::setanswers1(std::string a1){
     44        this->a1=a1;
     45    }
    5846
    59         std::string DialogueManager::getanswers1(void){
    60                 return a1;
    61         }
     47    void DialogueManager::setanswers2(std::string a2){
     48        this->a2=a2;
     49    }
    6250
    63         std::string DialogueManager::getanswers2(void){
    64                 return a2;
    65         }
    6651
    67         void DialogueManager::a1clicked(void){
    68                
    69                 currentQuestion = currentQuestion->possibleQuestions[0];
    70                 update(currentQuestion);
    7152
    72                
    73         }
    74         void DialogueManager::a2clicked(void){
    75                
    76                 currentQuestion = currentQuestion->possibleQuestions[1];
    77                 update(currentQuestion);
    78         }
     53    std::string DialogueManager::getanswers1(void){
     54        return a1;
     55    }
    7956
    80          void DialogueManager::update(NextQuestion* nq){
    81                 this->setquestion(nq->getquestion());
    82                 this->setanswers1(nq->getanswers1());
    83                 this->setanswers2(nq->getanswers2());
    84          }
     57    std::string DialogueManager::getanswers2(void){
     58        return a2;
     59    }
    8560
    86         bool DialogueManager::theEnd(){
    87         if((currentQuestion->possibleQuestions).empty()) {
    88                 return true;}
    89         else return false;
    90         }
     61    void DialogueManager::a1clicked(void){
     62
     63        currentQuestion = currentQuestion->possibleQuestions[0];
     64        update(currentQuestion);
     65
     66
     67    }
     68    void DialogueManager::a2clicked(void){
     69
     70        currentQuestion = currentQuestion->possibleQuestions[1];
     71        update(currentQuestion);
     72    }
     73
     74    void DialogueManager::update(NextQuestion* nq){
     75        this->setquestion(nq->getquestion());
     76        this->setanswers1(nq->getanswers1());
     77        this->setanswers2(nq->getanswers2());
     78    }
     79
     80    bool DialogueManager::theEnd(){
     81        if((currentQuestion->possibleQuestions).empty())
     82            return true;
     83        else
     84            return false;
     85    }
    9186
    9287}
  • code/trunk/src/modules/dialogue/DialogueManager.h

    r11699 r11718  
    2424
    2525{//tolua_export
    26         class _DialogueExport DialogueManager //tolua_export
    27         : public Singleton<DialogueManager>
    28         {//tolua_export
    29                 friend class Singleton<DialogueManager>;
    30        
    31                 public:
    32                
    33                 DialogueManager();
    34                
     26    class _DialogueExport DialogueManager //tolua_export
     27    : public Singleton<DialogueManager>
     28    {//tolua_export
     29        friend class Singleton<DialogueManager>;
    3530
    36                 static DialogueManager& getInstance() { return Singleton<DialogueManager>::getInstance(); } //tolua_export
    37                
     31        public:
    3832
    39                 void setquestion(std::string question); //tolua_export
    40                 std::string getquestion(void); //tolua_export
    41                
    42                
    43                 void setanswers1(std::string a1); //tolua_export
    44                 std::string getanswers1(void); //tolua_export
    45                
    46                 void setanswers2(std::string a2); //tolua_export
    47                 std::string getanswers2(void); //tolua_export
    48                
    49                 void setCurrentQuestion(NextQuestion* q);
     33        DialogueManager();
    5034
    51                 //Sets the current Question to the question corresponding to the first/second answer 
    52                 void a1clicked(void); //tolua_export
    53                 void a2clicked(void); //tolua_export
    54                
    55                 //Checks whether there are any more Questions to come
    56                 bool theEnd(); //tolua_export
    5735
    58                 //Sets question and a1, a2 for new currentQuestion
    59                 void update(NextQuestion* nq);
     36        static DialogueManager& getInstance() { return Singleton<DialogueManager>::getInstance(); } //tolua_export
    6037
    61                 //Is executed whenever a NextQuestion is created and pushes all NextQuestion into the allQuestion vector.
    62                 void registerquestion(NextQuestion* nq);
     38
     39        void setquestion(std::string question); //tolua_export
     40        std::string getquestion(void); //tolua_export
     41
     42
     43        void setanswers1(std::string a1); //tolua_export
     44        std::string getanswers1(void); //tolua_export
     45
     46        void setanswers2(std::string a2); //tolua_export
     47        std::string getanswers2(void); //tolua_export
     48
     49        void setCurrentQuestion(NextQuestion* q);
     50
     51        //Sets the current Question to the question corresponding to the first/second answer
     52        void a1clicked(void); //tolua_export
     53        void a2clicked(void); //tolua_export
     54
     55        //Checks whether there are any more Questions to come
     56        bool theEnd(); //tolua_export
     57
     58        //Sets question and a1, a2 for new currentQuestion
     59        void update(NextQuestion* nq);
     60
     61        //Is executed whenever a NextQuestion is created and pushes all NextQuestion into the allQuestion vector.
     62        void registerquestion(NextQuestion* nq);
    6363
    6464private:
    65         NextQuestion* currentQuestion; //The Question which is currently displayed
    66         std::vector<NextQuestion*> allQuestions;
    67         std::string a1; //answer on first button
    68         std::string a2; //answer on second button
    69         std::string question;
    70         static DialogueManager* singletonPtr_s;
     65    NextQuestion* currentQuestion; //The Question which is currently displayed
     66    std::vector<NextQuestion*> allQuestions;
     67    std::string a1; //answer on first button
     68    std::string a2; //answer on second button
     69    std::string question;
     70    static DialogueManager* singletonPtr_s;
    7171
    72         };//tolua_export
     72    };//tolua_export
    7373}//tolua_export
    7474#endif
  • code/trunk/src/modules/dialogue/NextQuestion.cc

    r11435 r11718  
    1212namespace orxonox{
    1313
    14         RegisterClass(NextQuestion);
     14    RegisterClass(NextQuestion);
    1515
    16         NextQuestion::NextQuestion(Context* context) : BaseObject(context)
     16    NextQuestion::NextQuestion(Context* context) : BaseObject(context)
    1717    {
    1818        RegisterObject(NextQuestion);
     
    2424    }
    2525
    26         void NextQuestion::setquestion(std::string question){
    27                 this->question=question;
    28         }
     26    void NextQuestion::setquestion(std::string question){
     27        this->question=question;
     28    }
    2929
    30         std::string NextQuestion::getquestion(void){
    31                 return question;
    32         }
     30    std::string NextQuestion::getquestion(void){
     31        return question;
     32    }
    3333
    34        
    35         bool NextQuestion::addposQuestion(NextQuestion* nq){
    36                
    37                 possibleQuestions.push_back(nq);
    38                 return true;
    39         }
    4034
    41         const NextQuestion* NextQuestion::getposQuestion(unsigned int i) const
     35    bool NextQuestion::addposQuestion(NextQuestion* nq){
     36
     37        possibleQuestions.push_back(nq);
     38        return true;
     39    }
     40
     41    const NextQuestion* NextQuestion::getposQuestion(unsigned int i) const
    4242    {
    4343        for (NextQuestion* effect : this->possibleQuestions)
     
    4949        return nullptr;
    5050         }
    51        
    52        
    53         void NextQuestion::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     51
     52
     53    void NextQuestion::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5454    {
    5555        SUPER(NextQuestion, XMLPort, xmlelement, mode);
     
    6161       
    6262    }
    63         bool NextQuestion::execute(bool bTriggered, BaseObject* trigger)
     63    bool NextQuestion::execute(bool bTriggered, BaseObject* trigger)
    6464    { 
    6565       
    66         DialogueManager& m = DialogueManager::getInstance();
    67                
     66        DialogueManager& m = DialogueManager::getInstance();
     67
    6868        m.setquestion(question);
    6969        m.setCurrentQuestion(this);
     
    8686
    8787
    88         void NextQuestion::setanswers1(std::string a1){
    89                 this->a1=a1;
    90                                 }
     88    void NextQuestion::setanswers1(std::string a1){
     89        this->a1=a1;
     90    }
    9191
    92         void NextQuestion::setanswers2(std::string a2){
    93                 this->a2=a2;
    94                                 }
    95 
    96        
    97 
    98         std::string NextQuestion::getanswers1(void){
    99                 return a1;
    100         }
    101 
    102         std::string NextQuestion::getanswers2(void){
    103                 return a2;
    104         }
    105 
    106        
     92    void NextQuestion::setanswers2(std::string a2){
     93        this->a2=a2;
     94    }
    10795
    10896
    10997
     98    std::string NextQuestion::getanswers1(void){
     99        return a1;
     100    }
     101
     102    std::string NextQuestion::getanswers2(void){
     103        return a2;
     104    }
    110105
    111106}
  • code/trunk/src/modules/dialogue/NextQuestion.h

    r11699 r11718  
    1313
    1414namespace orxonox{
    15         class _DialogueExport NextQuestion : public BaseObject
    16         {
    17                
    18                 //tolua_begin
    19                 public:
     15    class _DialogueExport NextQuestion : public BaseObject
     16    {
    2017
    21                 NextQuestion (Context* context); // tolua_export
    22                
     18        //tolua_begin
     19        public:
    2320
    24                 void setquestion(std::string question);
    25                 std::string getquestion(void);
    26 
    27                 void setanswers1(std::string a1);
    28                 void setanswers2(std::string a2);
    29                 std::string getanswers1(void);
    30                 std::string getanswers2(void);
    31 
    32                
    33                
    34 
    35                 //XMLEventPort for Event that first triggers the Dialogue
    36                 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
    37 
    38                 //XMLPort for setting questions and answers and the vector possibleQuestions
    39                 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    40 
    41                 bool addposQuestion(NextQuestion* nq);
    42                 const NextQuestion* getposQuestion(unsigned int index) const;
    43 
    44                 //Sets very first currentQuestion in the DialogueManager when the event is triggered
    45                 bool execute(bool bTriggered, BaseObject* trigger);
    46 
    47                 std::vector<NextQuestion*> possibleQuestions;
    48        
    49         private:
    50                 std::string a1;
    51                 std::string a2;
    52        
     21        NextQuestion (Context* context); // tolua_export
    5322
    5423
    55                 std::string question;
    56                 DialogueManager* m;
     24        void setquestion(std::string question);
     25        std::string getquestion(void);
    5726
    58         };
    59        
     27        void setanswers1(std::string a1);
     28        void setanswers2(std::string a2);
     29        std::string getanswers1(void);
     30        std::string getanswers2(void);
     31
     32
     33
     34
     35        //XMLEventPort for Event that first triggers the Dialogue
     36        virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
     37
     38        //XMLPort for setting questions and answers and the vector possibleQuestions
     39        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     40
     41        bool addposQuestion(NextQuestion* nq);
     42        const NextQuestion* getposQuestion(unsigned int index) const;
     43
     44        //Sets very first currentQuestion in the DialogueManager when the event is triggered
     45        bool execute(bool bTriggered, BaseObject* trigger);
     46
     47        std::vector<NextQuestion*> possibleQuestions;
     48
     49    private:
     50        std::string a1;
     51        std::string a2;
     52
     53
     54
     55        std::string question;
     56        DialogueManager* m;
     57
     58    };
     59
    6060}
    6161#endif
  • code/trunk/src/modules/gametypes/SpaceRaceBot.h

    r11358 r11718  
    3939    {
    4040        public:
    41                 SpaceRaceBot(Context* context);
     41            SpaceRaceBot(Context* context);
    4242            virtual ~SpaceRaceBot();
    4343   
Note: See TracChangeset for help on using the changeset viewer.