Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 7, 2011, 9:57:13 AM (14 years ago)
Author:
dafrick
Message:

Developer's mode. Is a ConfigValue, by default on except in release mode. If on it should help the developer, if off, it should obscure things we don't want the user to have to deal with.
So far it ticks the showAll button in the Singleplayer and Host menu, if on. It also sets the start countdown to 0 if on.
If you have some more ideas on how to make life easier for both developers and users, feel free to implement it yourself ot mention it to me.

Location:
code/branches/usability
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability/data/gui/scripts/HostMenu.lua

    r7928 r8040  
    2828
    2929function P.onShow()
     30    if P.showAll ~= orxonox.GUIManager:inDevMode() then
     31        local window = winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox")
     32        local button = tolua.cast(window,"CEGUI::Checkbox")
     33        P.showAll = not P.showAll
     34        button:setSelected(P.showAll)
     35        P.createLevelList()
     36    end
     37end
     38
     39function P.onShow()
     40    if P.showAll ~= orxonox.GUIManager:inDevMode() then
     41        local window = winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox")
     42        local button = tolua.cast(window,"CEGUI::Checkbox")
     43        P.showAll = not P.showAll
     44        button:setSelected(P.showAll)
     45    end
     46
    3047    if P.multiplayerMode == "startServer" then
    3148        local window = winMgr:getWindow("orxonox/HostMenuHostButton")
  • code/branches/usability/data/gui/scripts/MiscConfigMenu.lua

    r7928 r8040  
    3535    table.insert(P.commandList, "HumanPlayer nick_")
    3636    table.insert(P.commandList, "ChatOverlay displayTime_")
     37    table.insert(P.commandList, "Core bDevMode_")
    3738
    3839    P.nameList = {}
     
    5455    table.insert(P.nameList, "Playername")
    5556    table.insert(P.nameList, "Chat: display time")
     57    table.insert(P.nameList, "Developer's Mode")
    5658
    5759    P.linesList = {}
  • code/branches/usability/data/gui/scripts/SingleplayerMenu.lua

    r7928 r8040  
    2525end
    2626
     27function P.onShow()
     28    if P.showAll ~= orxonox.GUIManager:inDevMode() then
     29        local window = winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox")
     30        local button = tolua.cast(window,"CEGUI::Checkbox")
     31        P.showAll = not P.showAll
     32        button:setSelected(P.showAll)
     33        P.createLevelList()
     34    end
     35end
     36
    2737function P.createLevelList()
    2838    P.levelList = {}
     
    4454        index = index + 1
    4555    end
    46     --TODO: Reintroduce sorting, if needed. At the moment it's sorted by filename.
    47     --table.sort(levelList)
    4856    for k,v in pairs(P.levelList) do
    4957        local item = CEGUI.createListboxTextItem(v:getName())
  • code/branches/usability/src/libraries/core/Core.cc

    r7872 r8040  
    208208#ifdef ORXONOX_RELEASE
    209209        const unsigned int defaultLevelLogFile = 3;
     210        SetConfigValue(bDevMode_, false)
     211            .description("Developer mode. If not set, hides some things from the user to not confuse him.");
    210212#else
    211213        const unsigned int defaultLevelLogFile = 4;
     214        SetConfigValue(bDevMode_, true)
     215            .description("Developer mode. If not set, hides some things from the user to not confuse him.");
    212216#endif
    213217        SetConfigValueExternal(softDebugLevelLogFile_, "OutputHandler", "softDebugLevelLogFile", defaultLevelLogFile)
  • code/branches/usability/src/libraries/core/Core.h

    r7870 r8040  
    9191                { return this->ogreConfigTimestamp_; }
    9292
     93            inline bool inDevMode(void) const
     94                { return this->bDevMode_; }
     95
    9396        private:
    9497            Core(const Core&); //!< Don't use (undefined symbol)
     
    130133            long long                     lastLevelTimestamp_;         ///< Timestamp when the last level was started
    131134            long long                     ogreConfigTimestamp_;        ///< Timestamp wehen the ogre config level was modified
     135            bool                          bDevMode_;                   //!< Developers bit. If set to false, some options are not available as to not confuse the normal user.
    132136
    133137            static Core*                  singletonPtr_s;
  • code/branches/usability/src/libraries/core/GUIManager.h

    r8035 r8040  
    4949#include "util/Singleton.h"
    5050#include "input/InputHandler.h"
     51#include "Core.h"
    5152#include "OrxonoxClass.h"
    5253#include "WindowEventListener.h"
     
    9697        static void navigateGUI(const std::string& mode);
    9798        void guisActiveChanged(bool active); // tolua_export
     99
     100        /**
     101        @brief Helper method to get the developer's mode without having to export Core.h.
     102        @see Core::inDevMode
     103        */
     104        static bool inDevMode(void) { return Core::getInstance().inDevMode(); } // tolua_export
    98105
    99106        //! Creates a new InputState to be used with a GUI Sheet
  • code/branches/usability/src/orxonox/gametypes/Gametype.cc

    r7801 r8040  
    3030
    3131#include "util/Math.h"
     32#include "core/Core.h"
    3233#include "core/CoreIncludes.h"
    3334#include "core/ConfigValueIncludes.h"
     
    386387                    if (allplayersready && hashumanplayers)
    387388                    {
    388                         this->gtinfo_->startCountdown_ = this->initialStartCountdown_;
     389                        // If in developer's mode, there is no start countdown.
     390                        if(Core::getInstance().inDevMode())
     391                            this->gtinfo_->startCountdown_ = 0;
     392                        else
     393                            this->gtinfo_->startCountdown_ = this->initialStartCountdown_;
    389394                        this->gtinfo_->bStartCountdownRunning_ = true;
    390395                    }
Note: See TracChangeset for help on using the changeset viewer.