Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6858


Ignore:
Timestamp:
May 6, 2010, 1:11:43 PM (14 years ago)
Author:
dafrick
Message:

Made noCaption feature needed for skybox much nice. :D

Location:
code/branches/skybox2/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/skybox2/src/libraries/core/Core.cc

    r6772 r6858  
    7878
    7979    SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file");
    80     SetCommandLineSwitch(noGametypeCaptions).information("Use this if you don't want to use Gametype captions.");
    8180
    8281#ifdef ORXONOX_PLATFORM_WINDOWS
     
    150149        this->setConfigValues();
    151150
    152         // no captions in gametype.
    153         if(CommandLineParser::getValue("noGametypeCaptions").getBool())
    154         {
    155             ModifyConfigValue(bGametypeCaptions_, tset, false);
    156         }
    157 
    158151        // create persistent io console
    159152        this->ioConsole_.reset(new IOConsole());
     
    201194            .description("If true, all random actions are different each time you start the game")
    202195            .callback(this, &Core::initRandomNumberGenerator);
    203         SetConfigValue(bGametypeCaptions_, true)
    204             .description("Set to false if you don't want to use Gametype captions.");
    205196    }
    206197
  • code/branches/skybox2/src/libraries/core/Core.h

    r6772 r6858  
    6767            void setConfigValues();
    6868
    69             inline bool hasGametypeCaptions(void)
    70                 { return this->bGametypeCaptions_; }
    71 
    7269            //! Returns the configured language.
    7370            const std::string& getLanguage()
     
    111108            std::string                   language_;                   //!< The language
    112109            bool                          bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called
    113             bool                          bGametypeCaptions_;
    114110
    115111            static Core*                  singletonPtr_s;
  • code/branches/skybox2/src/modules/designtools/SkyboxGenerator.cc

    r6806 r6858  
    6060        this->setConfigValues();
    6161        takeScreenshot_ = false;
     62        this->captionsRemoved_ = false;
    6263    }
    6364
     
    7677        if( takeScreenshot_ == true )
    7778        {
     79            if(!this->captionsRemoved_)
     80            {
     81                CommandExecutor::execute("setGametypeStatus false");
     82                this->captionsRemoved_ = true;
     83                return;
     84            }
     85           
    7886            ControllableEntity* ce = HumanController::getLocalControllerSingleton()->getControllableEntity();
    7987            Camera* camera = ce->getCamera();
     
    8189       
    8290            Ogre::RenderWindow* w = GraphicsManager::getInstance().getRenderWindow();
     91
    8392
    8493            switch (iterateOverDirections_)
     
    131140                camera->getOgreCamera()->setAspectRatio(aspectRatio_);
    132141                camera->getOgreCamera()->setFOVy(fovy_);
     142                iterateOverDirections_++;
     143            case 8 :
    133144                iterateOverDirections_ =0;
    134145                takeScreenshot_ = false;
    135146                CommandExecutor::execute("pause");
     147                CommandExecutor::execute("setGametypeStatus true");
     148                this->captionsRemoved_ = false;
    136149            }
     150
    137151        }
    138152    }
  • code/branches/skybox2/src/modules/designtools/SkyboxGenerator.h

    r6804 r6858  
    5454            float aspectRatio_;
    5555            Ogre::Radian fovy_;
     56            bool captionsRemoved_;
    5657    };
    5758}
  • code/branches/skybox2/src/modules/overlays/hud/GametypeStatus.cc

    r6772 r6858  
    3030
    3131#include "util/Convert.h"
    32 #include "core/Core.h"
     32#include "core/ConsoleCommand.h"
    3333#include "core/CoreIncludes.h"
    3434#include "infos/GametypeInfo.h"
     
    3939namespace orxonox
    4040{
    41     CreateFactory(GametypeStatus);
     41    CreateFactory(GametypeStatus); 
     42
     43    /*static*/ bool GametypeStatus::noCaption_s = false;
     44    SetConsoleCommand(GametypeStatus, setGametypeStatus, true);
    4245
    4346    GametypeStatus::GametypeStatus(BaseObject* creator) : OverlayText(creator)
     
    6164            ControllableEntity* ce = this->owner_->getControllableEntity();
    6265
    63             if(!Core::getInstance().hasGametypeCaptions()) // No captions are displayed.
     66            if(GametypeStatus::noCaption_s) // No captions are displayed.
     67            {
     68                this->setCaption("");
    6469                return;
     70            }
    6571
    6672            if (!gtinfo->hasStarted() && !gtinfo->isStartCountdownRunning())
     
    9298        this->owner_ = orxonox_cast<PlayerInfo*>(this->getOwner());
    9399    }
     100
     101    /**
     102    @brief
     103        Sets whether the gametype status is displayed.
     104    @param bValue
     105        If true captions are displayed, if false, not.
     106    */
     107    /*static*/ void GametypeStatus::setGametypeStatus(bool bValue)
     108    {
     109        GametypeStatus::noCaption_s = !bValue;
     110    }
     111   
    94112}
  • code/branches/skybox2/src/modules/overlays/hud/GametypeStatus.h

    r5781 r6858  
    4646            virtual void changedOwner();
    4747
     48            static void setGametypeStatus(bool bValue); //!< Toggles whether the gametype status is displayed.
     49
    4850        private:
    4951            PlayerInfo* owner_;
     52            static bool noCaption_s;
     53           
    5054    };
    5155}
Note: See TracChangeset for help on using the changeset viewer.