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:
17 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/designtools/ScreenshotManager.cc

    r7163 r7284  
    99#include <OgreRoot.h>
    1010
     11#include "util/ScopedSingletonManager.h"
    1112#include "core/GraphicsManager.h"
    1213#include "core/PathConfig.h"
    13 #include "core/ScopedSingletonManager.h"
    14 #include "core/ConsoleCommand.h"
     14#include "core/command/ConsoleCommand.h"
    1515
    1616#include "CameraManager.h"
     
    2020{
    2121    ManageScopedSingleton(ScreenshotManager, ScopeID::Graphics, false);
    22     SetConsoleCommandAlias(ScreenshotManager, makeScreenshot_s, "printScreenHD", true);
     22    SetConsoleCommand("printScreenHD", &ScreenshotManager::makeScreenshot_s);
    2323
    2424    ScreenshotManager::ScreenshotManager()
  • code/trunk/src/modules/designtools/SkyboxGenerator.cc

    r7163 r7284  
    3434#include <OgreCamera.h>
    3535
    36 #include "core/ConsoleCommand.h"
     36#include "util/ScopedSingletonManager.h"
    3737#include "core/CoreIncludes.h"
    3838#include "core/ConfigValueIncludes.h"
    39 #include "core/ScopedSingletonManager.h"
     39#include "core/GraphicsManager.h"
     40#include "core/command/ConsoleCommand.h"
     41#include "core/command/CommandExecutor.h"
    4042#include "controllers/HumanController.h"
    4143#include "worldentities/CameraPosition.h"
    4244#include "worldentities/ControllableEntity.h"
    43 #include "core/GraphicsManager.h"
    44 #include "core/CommandExecutor.h"
    4545#include "graphics/Camera.h"
    4646
     
    5050{
    5151
    52     SetConsoleCommand(SkyboxGenerator, createSkybox, true);
     52    SetConsoleCommand("SkyboxGenerator", "createSkybox", &SkyboxGenerator::createSkybox).addShortcut();
    5353
    5454    ManageScopedSingleton(SkyboxGenerator, ScopeID::Graphics, false);
     
    7979            if(!this->captionsRemoved_)
    8080            {
    81                 CommandExecutor::execute("setGametypeStatus false");
     81                CommandExecutor::execute("GametypeStatus displayCaption false");
    8282                this->captionsRemoved_ = true;
    8383                return;
     
    145145                takeScreenshot_ = false;
    146146                CommandExecutor::execute("pause");
    147                 CommandExecutor::execute("setGametypeStatus true");
     147                CommandExecutor::execute("GametypeStatus displayCaption true");
    148148                this->captionsRemoved_ = false;
    149149            }
  • code/trunk/src/modules/notifications/NotificationManager.cc

    r7163 r7284  
    3636#include <set>
    3737
     38#include "util/ScopedSingletonManager.h"
    3839#include "core/CoreIncludes.h"
    39 #include "core/ScopedSingletonManager.h"
    4040#include "Notification.h"
    4141#include "interfaces/NotificationListener.h"
  • code/trunk/src/modules/objects/triggers/Trigger.cc

    r6417 r7284  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/ConsoleCommand.h"
    3332#include "core/GameMode.h"
    3433#include "core/XMLPort.h"
     34#include "core/command/ConsoleCommand.h"
    3535#include "Scene.h"
    3636
     
    3838{
    3939
    40   SetConsoleCommand(Trigger, debugFlares, false).defaultValues(false);
     40  SetConsoleCommand("Trigger", "debugFlares", &Trigger::debugFlares).defaultValues(false);
    4141
    4242  CreateFactory(Trigger);
  • 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    };
  • code/trunk/src/modules/pickup/PickupManager.cc

    r7209 r7284  
    3434#include "PickupManager.h"
    3535
     36#include "util/Convert.h"
     37#include "util/ScopedSingletonManager.h"
    3638#include "core/CoreIncludes.h"
    3739#include "core/LuaState.h"
    3840#include "core/GUIManager.h"
    39 #include "core/ScopedSingletonManager.h"
    4041#include "core/Identifier.h"
    41 #include "util/Convert.h"
    4242#include "interfaces/PickupCarrier.h"
    4343#include "infos/PlayerInfo.h"
  • code/trunk/src/modules/pong/Pong.cc

    r6417 r7284  
    3131#include "core/CoreIncludes.h"
    3232#include "core/EventIncludes.h"
    33 #include "core/Executor.h"
     33#include "core/command/Executor.h"
    3434#include "PongCenterpoint.h"
    3535#include "PongBall.h"
  • code/trunk/src/modules/questsystem/QuestManager.cc

    r7163 r7284  
    3737
    3838#include "util/Exception.h"
     39#include "util/ScopedSingletonManager.h"
    3940#include "core/CoreIncludes.h"
    4041#include "core/GUIManager.h"
    41 #include "core/ConsoleCommand.h"
    4242#include "core/LuaState.h"
    43 #include "core/ScopedSingletonManager.h"
     43#include "core/command/ConsoleCommand.h"
    4444#include "infos/PlayerInfo.h"
    4545#include "overlays/GUIOverlay.h"
  • code/trunk/src/modules/questsystem/QuestsystemPrecompiledHeaders.h

    r5929 r7284  
    6565///////////////////////////////////////////
    6666
    67 #include "core/Executor.h"     // 15
     67#include "core/command/Executor.h"     // 15
    6868//#include "core/XMLPort.h"    // 14
    6969
  • code/trunk/src/modules/weapons/MuzzleFlash.cc

    r5929 r7284  
    3131
    3232#include "core/CoreIncludes.h"
    33 #include "core/Executor.h"
     33#include "core/command/Executor.h"
    3434
    3535namespace orxonox
  • code/trunk/src/modules/weapons/projectiles/Projectile.cc

    r6540 r7284  
    3131#include "core/CoreIncludes.h"
    3232#include "core/ConfigValueIncludes.h"
    33 #include "core/Executor.h"
    3433#include "core/GameMode.h"
     34#include "core/command/Executor.h"
    3535#include "objects/collisionshapes/SphereCollisionShape.h"
    3636#include "worldentities/pawns/Pawn.h"
  • code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc

    r6732 r7284  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/Executor.h"
    3332#include "core/XMLPort.h"
     33#include "core/command/Executor.h"
    3434#include "graphics/Model.h"
    3535
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.cc

    r6732 r7284  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/Executor.h"
    3332#include "core/XMLPort.h"
     33#include "core/command/Executor.h"
    3434#include "graphics/Model.h"
    3535
Note: See TracChangeset for help on using the changeset viewer.