Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 21, 2016, 4:05:15 PM (8 years ago)
Author:
binderm
Message:

Campaignmenu improved, it's now possible to only show single levels and not all together.

Location:
code/branches/bindermFS16/src/orxonox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/bindermFS16/src/orxonox/CMakeLists.txt

    r11162 r11173  
    5858  TOLUA_FILES
    5959    chat/ChatInputHandler.h
     60    overlays/CampaignMenu.h
    6061    LevelInfo.h
    6162    LevelManager.h
  • code/branches/bindermFS16/src/orxonox/LevelManager.cc

    r11071 r11173  
    4949namespace orxonox
    5050{
     51
     52    LevelStatus::LevelStatus()
     53    {
     54        this->won = true;
     55    }
     56
     57    LevelStatus::~LevelStatus()
     58    {}
     59
     60    bool LevelManager::missionactivate(int index)
     61    {
     62        //check for index level activate...
     63        return index-5;
     64    }
     65
     66    void LevelManager::setLevelStatus(int completedLevel)
     67    {
     68//        allLevelStatus_[completedLevel]=new LevelStatus;
     69    }
     70
     71
    5172    SetCommandLineArgument(level, "").shortcut("l").information("Default level file (overrides LevelManager::defaultLevelName_ configValue)");
    5273
     
    6384        RegisterObject(LevelManager);
    6485        this->setConfigValues();
     86
     87
    6588
    6689        // check override
     
    7396        this->nextIndex_ = 0;
    7497        this->nextLevel_ = this->availableLevels_.begin();
    75     }
     98
     99        allLevelStatus_.reserve(1);
     100    }
     101
    76102
    77103    LevelManager::~LevelManager()
     
    103129        ModifyConfigValue(lastFinishedCampaignMission_, set, lastFinishedCampaignMission);
    104130    }
     131
     132
    105133
    106134    /**
  • code/branches/bindermFS16/src/orxonox/LevelManager.h

    r11071 r11173  
    4848#include "core/config/Configurable.h"
    4949
     50
     51namespace orxonox
     52{
     53
     54    class LevelStatus
     55    {
     56    public:
     57        LevelStatus();
     58        virtual ~LevelStatus();
     59       
     60
     61    private:
     62        bool won;
     63        std::vector<int> nextLevels;
     64
     65    };
     66}
     67
    5068// tolua_begin
    5169namespace orxonox
     
    6381        Damian 'Mozork' Frick
    6482
    65     @ingroup Orxonox
     83
     84    @ingroup Orxonox1
    6685    */
     86
     87
     88
     89
    6790    class _OrxonoxExport LevelManager
    6891    // tolua_end
     
    7497            virtual ~LevelManager();
    7598
     99            void setLevelStatus(int integer);
     100
     101
    76102            void setConfigValues(); //!< Set the config values for this object.
    77103
    78104            void requestActivity(Level* level); //!< Request activity for the input Level.
    79105            void releaseActivity(Level* level); //!< Release activity for the input Level.
     106
    80107            Level* getActiveLevel(); //!< Get the currently active Level.
    81108
    82109            // tolua_begin
     110            bool missionactivate(int index);
    83111            void setDefaultLevel(const std::string& levelName); //!< Set the default Level.
    84112            /**
     
    97125            inline unsigned int getNumberOfCampaignMissions()
    98126                { return this->campaignMissions_.size(); }
     127
    99128            inline const std::string& getCampaignMission(unsigned int index)
    100129                { return this->campaignMissions_[index]; }
     130
    101131
    102132            /**
     
    129159            std::string lastFinishedCampaignMission_;
    130160            std::vector<std::string> campaignMissions_;
     161            std::vector<LevelStatus> allLevelStatus_;
     162
     163
    131164
    132165            static LevelManager* singletonPtr_s;
  • code/branches/bindermFS16/src/orxonox/gametypes/Mission.cc

    r11071 r11173  
    9292
    9393            LevelManager::getInstance().setLastFinishedCampaignMission(this->getFilename());
     94            //LevelManager::getInstance().setLevelStatus(7);
    9495        }
    9596        else if (!this->gtinfo_->hasEnded())
  • code/branches/bindermFS16/src/orxonox/overlays/CampaignMenu.cc

    r11162 r11173  
    3333#include "core/GameMode.h"
    3434
     35
    3536namespace orxonox
    3637{
     38
     39   
    3740    RegisterClass(CampaignMenu);
    3841
     
    5255    }
    5356
    54     //loads the campaign menu
    55     void CampaignMenu::loadNewMenu()
     57
     58    //loads the new campaign menu
     59    void CampaignMenu::loadnewmenu()
    5660    {
    5761       
  • code/branches/bindermFS16/src/orxonox/overlays/CampaignMenu.h

    r11162 r11173  
    3232#include <string>
    3333#include "core/BaseObject.h"
     34#include "util/Singleton.h"
    3435
    35 
    36 namespace orxonox // tolua_export
    37 { // tolua_export
    38 
    39         class _OrxonoxExport CampaignMenu // tolua_export
    40          : public BaseObject
    41     { // tolua_export
     36//tolua_begin
     37namespace orxonox
     38{
     39//tolua_end
     40class _OrxonoxExport CampaignMenu : public BaseObject //tolua_export
     41    { //tolua_export
    4242    public:
    4343        CampaignMenu(Context* context);
    4444        ~CampaignMenu();
    45         static void test(); // tolua_export
    46         void loadNewMenu();
    47     };// tolua_export
    48 } // tolua_export
     45        static void test(); //tolua_export
     46        void loadnewmenu();
     47    }; //tolua_export
     48
     49
     50
     51} //tolua_export
    4952
    5053#endif /* _CampaignMenu_H__ */
Note: See TracChangeset for help on using the changeset viewer.