Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10255


Ignore:
Timestamp:
Feb 4, 2015, 10:21:28 PM (9 years ago)
Author:
landauf
Message:

merged storymodeHS14

Location:
code/branches/presentationHS14merge
Files:
7 edited
3 copied

Legend:

Unmodified
Added
Removed
  • code/branches/presentationHS14merge

  • code/branches/presentationHS14merge/cmake/LibraryConfig.cmake

    r9765 r10255  
    161161SET(Boost_ADDITIONAL_VERSIONS 1.40 1.40.0 1.41 1.41.0 1.42 1.42.0 1.43 1.43.0
    162162                              1.44 1.44.0 1.45 1.45.0 1.46 1.46.0 1.46.1 1.49.0
    163                               1.53.0)
     163                              1.53.0)
    164164IF(NOT TARDIS)
    165165  FIND_PACKAGE(Boost 1.40 REQUIRED thread filesystem system date_time)
  • code/branches/presentationHS14merge/data/gui/layouts/SingleplayerMenu.layout

    r9782 r10255  
    5555            <Event Name="Clicked" Function="SingleplayerMenu.SingleplayerBackButton_clicked"/>
    5656        </Window>
     57        <Window Type="MenuWidgets/Button" Name="orxonox/CampaignButton" >
     58            <Property Name="Text" Value="Campaign" />
     59            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     60            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.8,0},{0.6,0},{0.85,0}}" />
     61            <Event Name="Clicked" Function="SingleplayerMenu.CampaignButton_clicked"/>
     62        </Window>
    5763    </Window>
    5864</GUILayout>
  • code/branches/presentationHS14merge/data/gui/scripts/SingleplayerMenu.lua

    r9348 r10255  
    22
    33local P = createMenuSheet("SingleplayerMenu")
    4 P.loadAlong = {"ShipSelectionMenu"}
     4P.loadAlong = {"ShipSelectionMenu","CampaignMenu"}
    55P.levelList = {}
    66P.activeTabIndexes = {}
     
    2323    P.SingleplayerSelectionChanged()
    2424
    25     --buttons are arranged in a 1x3 matrix
     25    --buttons are arranged in a 2x3 matrix
    2626    P:setButton(1, 1, {
    2727            ["button"] = winMgr:getWindow("orxonox/SingleplayerStartButton"),
     
    3737            ["button"] = winMgr:getWindow("orxonox/SingleplayerBackButton"),
    3838            ["callback"]  = P.SingleplayerBackButton_clicked
     39    })
     40
     41    P:setButton(2, 2,{
     42            ["button"] = winMgr:getWindow("orxonox/CampaignButton"),
     43            ["callback"] = P.CampaignButton_clicked
    3944    })
    4045end
     
    166171end
    167172
     173function P.CampaignButton_clicked(e)
     174    showMenuSheet("CampaignMenu", true)
     175end
     176
    168177return P
  • code/branches/presentationHS14merge/src/orxonox/LevelManager.cc

    r9667 r10255  
    8989        SetConfigValue(defaultLevelName_, "missionOne.oxw")
    9090            .description("Sets the pre selection of the level in the main menu.");
     91        SetConfigValue(lastFinishedCampaignMission_,  "")
     92            .description("The last finished mission of a campaign");
     93        SetConfigValue(campaignMissions_,  std::vector<std::string>())
     94            .description("The list of missions in the campaign");
     95    }
     96
     97    /**
     98     * @brief Stores the argument in the corresponding config value.
     99     */
     100    void LevelManager::setLastFinishedCampaignMission(const std::string& lastFinishedCampaignMission)
     101    {
     102        ModifyConfigValue(lastFinishedCampaignMission_, set, lastFinishedCampaignMission);
    91103    }
    92104
  • code/branches/presentationHS14merge/src/orxonox/LevelManager.h

    r9667 r10255  
    9191            LevelInfoItem* getAvailableLevelListItem(unsigned int index); //!< Get the LevelInfoItem at the given index in the list of available Levels.
    9292
     93            void setLastFinishedCampaignMission(const std::string& lastFinishedCampaignMission);
     94            inline const std::string& getLastFinishedCampaignMission() const
     95                { return this->lastFinishedCampaignMission_; }
     96
     97            inline unsigned int getNumberOfCampaignMissions()
     98                { return this->campaignMissions_.size(); }
     99            inline const std::string& getCampaignMission(unsigned int index)
     100                { return this->campaignMissions_[index]; }
     101
    93102            /**
    94103            @brief Get the instance of the LevelManager.
     
    116125            // config values
    117126            std::string defaultLevelName_;
     127            std::string lastFinishedCampaignMission_;
     128            std::vector<std::string> campaignMissions_;
    118129
    119130            static LevelManager* singletonPtr_s;
  • code/branches/presentationHS14merge/src/orxonox/gametypes/Mission.cc

    r9986 r10255  
    2828
    2929#include "Mission.h"
     30
    3031#include "items/Engine.h"
    3132#include "controllers/ArtificialController.h"
     
    3637#include "network/Host.h"
    3738#include "worldentities/pawns/Pawn.h"
    38 
     39#include "LevelManager.h"
    3940
    4041namespace orxonox
     
    7071    void Mission::pawnKilled(Pawn* victim, Pawn* killer)
    7172    {
    72         if (victim && victim->getPlayer() && victim->getPlayer()->isHumanPlayer() )
     73        if (victim && victim->getPlayer() && victim->getPlayer()->isHumanPlayer())
    7374        {
    7475            this->lives_--;
     
    8788    {
    8889        if (this->missionAccomplished_ && !this->gtinfo_->hasEnded())
     90        {
    8991            this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
     92
     93            LevelManager::getInstance().setLastFinishedCampaignMission(this->getFilename());
     94        }
    9095        else if (!this->gtinfo_->hasEnded())
    9196            this->gtinfo_->sendAnnounceMessage("Mission failed!");
     97
    9298        Gametype::end();
    9399    }
    94100
    95101    void Mission::setTeams()
    96     {//Set pawn-colours
     102    { //Set pawn-colours
    97103        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
    98104        {
    99105            Pawn* pawn = static_cast<Pawn*>(*it);
    100             if(!pawn) continue;
    101                 this->setDefaultObjectColour(pawn);
     106            if (!pawn)
     107                continue;
     108            this->setDefaultObjectColour(pawn);
    102109        }
    103110    }
     
    105112    {
    106113        for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it)
    107         {//TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions!
     114        { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions!
    108115            it->setMissionAccomplished(accomplished);
    109116            it->end();
    110117        }
    111118    }
    112    
     119
    113120    void Mission::setLivesWrapper(unsigned int amount)
    114121    {
    115122        for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it)
    116         {//TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would affect ALL missions!
     123        { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would affect ALL missions!
    117124            it->setLives(amount);
    118125        }
    119126    }
    120 
    121 
    122127}
Note: See TracChangeset for help on using the changeset viewer.