Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 31, 2010, 3:37:40 AM (14 years ago)
Author:
landauf
Message:

merged consolecommands3 branch back to trunk.

note: the console command interface has changed completely, but the documentation is not yet up to date. just copy an existing command and change it to your needs, it's pretty self-explanatory. also the include files related to console commands are now located in core/command/. in the game it should work exactly like before, except for some changes in the auto-completion.

Location:
code/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/overlays/OverlaysPrecompiledHeaders.h

    r5781 r7284  
    5858///////////////////////////////////////////
    5959
    60 #include "core/Executor.h"     // 13
     60#include "core/command/Executor.h"     // 13
    6161//#include "network/synchronisable/Synchronisable.h" // 13
    6262//#include "core/XMLPort.h"    // 9
  • code/trunk/src/modules/overlays/hud/ChatOverlay.cc

    r6417 r7284  
    3636#include "core/CoreIncludes.h"
    3737#include "core/ConfigValueIncludes.h"
    38 #include "core/Executor.h"
     38#include "core/command/Executor.h"
    3939
    4040#include "tools/Timer.h"
     
    9191        Timer* timer = new Timer();
    9292        this->timers_.insert(timer); // store the timer in a set to destroy it in the destructor
    93         Executor* executor = createExecutor(createFunctor(&ChatOverlay::dropMessage, this));
     93        const ExecutorPtr& executor = createExecutor(createFunctor(&ChatOverlay::dropMessage, this));
    9494        executor->setDefaultValues(timer);
    9595        timer->setTimer(this->displayTime_, false, executor, true);
  • code/trunk/src/modules/overlays/hud/GametypeStatus.cc

    r7163 r7284  
    3030
    3131#include "util/Convert.h"
    32 #include "core/ConsoleCommand.h"
    3332#include "core/CoreIncludes.h"
     33#include "core/command/ConsoleCommand.h"
    3434#include "infos/GametypeInfo.h"
    3535#include "infos/PlayerInfo.h"
     
    4141    CreateFactory(GametypeStatus);
    4242
    43     /*static*/ bool GametypeStatus::noCaption_s = false;
    44     SetConsoleCommand(GametypeStatus, setGametypeStatus, true);
     43    static const std::string __CC_GametypeStatus_name = "GametypeStatus";
     44    static const std::string __CC_displayCaption_name = "displayCaption";
     45
     46    SetConsoleCommand(__CC_GametypeStatus_name, __CC_displayCaption_name, &GametypeStatus::setDisplayCaption);
    4547
    4648    GametypeStatus::GametypeStatus(BaseObject* creator) : OverlayText(creator)
     
    4951
    5052        this->owner_ = 0;
     53        this->bNoCaption_ = false;
     54
     55        ModifyConsoleCommand(__CC_GametypeStatus_name, __CC_displayCaption_name).setObject(this);
    5156    }
    5257
    5358    GametypeStatus::~GametypeStatus()
    5459    {
     60        ModifyConsoleCommand(__CC_GametypeStatus_name, __CC_displayCaption_name).setObject(0);
    5561    }
    5662
     
    6470            ControllableEntity* ce = this->owner_->getControllableEntity();
    6571
    66             if(GametypeStatus::noCaption_s) // No captions are displayed.
     72            if (this->bNoCaption_) // No captions are displayed.
    6773            {
    6874                this->setCaption("");
     
    105111        If true captions are displayed, if false, not.
    106112    */
    107     /*static*/ void GametypeStatus::setGametypeStatus(bool bValue)
     113    void GametypeStatus::setDisplayCaption(bool bValue)
    108114    {
    109         GametypeStatus::noCaption_s = !bValue;
     115        this->bNoCaption_ = !bValue;
    110116    }
    111117
  • code/trunk/src/modules/overlays/hud/GametypeStatus.h

    r7163 r7284  
    4646            virtual void changedOwner();
    4747
    48             static void setGametypeStatus(bool bValue); //!< Toggles whether the gametype status is displayed.
     48            void setDisplayCaption(bool bValue); //!< Toggles whether the gametype status is displayed.
    4949
    5050        private:
    5151            PlayerInfo* owner_;
    52             static bool noCaption_s;
     52            bool bNoCaption_;
    5353
    5454    };
Note: See TracChangeset for help on using the changeset viewer.