Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7760


Ignore:
Timestamp:
Dec 15, 2010, 10:59:10 AM (14 years ago)
Author:
dafrick
Message:

Making the GUI scheme configurable through a config value.

Location:
code/branches/presentation
Files:
3 edited
2 moved

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/data/gui/schemes/OrxonoxHUDWidgets.scheme

    r7759 r7760  
    11<?xml version="1.0" ?>
    2 <GUIScheme Name="OrxonoxLookHUDWidgets">
     2<GUIScheme Name="OrxonoxHUDWidgets">
    33    <WindowAlias Alias="HUDWidgets/StaticImage"              Target="OrxonoxLook/StaticImage" />
    44    <WindowAlias Alias="HUDWidgets/StaticText"               Target="OrxonoxLook/StaticText" />
  • code/branches/presentation/data/gui/schemes/OrxonoxMenuWidgets.scheme

    r7759 r7760  
    11<?xml version="1.0" ?>
    2 <GUIScheme Name="OrxonoxLookMenuWidgets">
     2<GUIScheme Name="OrxonoxMenuWidgets">
    33    <WindowAlias Alias="MenuWidgets/StaticImage"              Target="OrxonoxLook/StaticImage" />
    44    <WindowAlias Alias="MenuWidgets/StaticText"               Target="OrxonoxLook/StaticText" />
  • code/branches/presentation/data/gui/scripts/InitialiseGUI.lua

    r7734 r7760  
    55winMgr    = CEGUI.WindowManager:getSingleton()
    66
     7local scheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_")
    78-- Load all required skins
    8 schemeMgr:loadScheme("TaharezGreenLook.scheme")
    9 --schemeMgr:loadScheme("OrxonoxLook.scheme")
     9--schemeMgr:loadScheme("TaharezGreenLook.scheme")
     10schemeMgr:loadScheme(scheme .. "Look.scheme")
    1011--schemeMgr:loadScheme("TaharezLook.scheme")
    1112--schemeMgr:loadScheme("WindowsLook.scheme")
     
    1617-- By loading a different file (if there is) you can change the skin
    1718-- of the menus or the HUD independently
    18 schemeMgr:loadScheme("TaharezGreenMenuWidgets.scheme")
    19 menuImageSet = "TaharezGreenLook"
    20 schemeMgr:loadScheme("TaharezGreenHUDWidgets.scheme")
    21 hudImageSet = "TaharezGreenLook"
    22 --schemeMgr:loadScheme("OrxonoxLookMenuWidgets.scheme")
    23 --menuImageSet = "OrxonoxLook"
    24 --schemeMgr:loadScheme("OrxonoxLookHUDWidgets.scheme")
    25 --hudImageSet = "OrxonoxLook"
     19--schemeMgr:loadScheme("TaharezGreenMenuWidgets.scheme")
     20--menuImageSet = "TaharezGreenLook"
     21--schemeMgr:loadScheme("TaharezGreenHUDWidgets.scheme")
     22--hudImageSet = "TaharezGreenLook"
     23schemeMgr:loadScheme(scheme .. "MenuWidgets.scheme")
     24menuImageSet = scheme .. "Look"
     25schemeMgr:loadScheme(scheme .. "HUDWidgets.scheme")
     26hudImageSet = scheme .. "Look"
    2627
    2728-- Just a remaining test hack
  • code/branches/presentation/src/libraries/core/GUIManager.cc

    r7709 r7760  
    5959#include "util/Exception.h"
    6060#include "util/OrxAssert.h"
     61#include "ConfigValueIncludes.h"
    6162#include "Core.h"
     63#include "CoreIncludes.h"
    6264#include "GraphicsManager.h"
    6365#include "LuaState.h"
     
    100102
    101103    GUIManager* GUIManager::singletonPtr_s = 0;
     104    /*static*/ const std::string GUIManager::defaultScheme_ = "TaharezGreen";
    102105
    103106    SetConsoleCommand("showGUI", &GUIManager::showGUI).defaultValue(1, false).defaultValue(2, false);
     
    118121        , camera_(NULL)
    119122    {
     123        RegisterRootObject(GUIManager);
     124        this->setConfigValues();
     125
    120126        using namespace CEGUI;
    121127
     
    175181    GUIManager::~GUIManager()
    176182    {
     183    }
     184
     185    void GUIManager::setConfigValues(void)
     186    {
     187        SetConfigValue(guiScheme_, GUIManager::defaultScheme_) .description("Changes the current GUI scheme.") .callback(this, &GUIManager::changedGUIScheme);
     188    }
     189
     190    void GUIManager::changedGUIScheme(void)
     191    {
     192       
    177193    }
    178194
  • code/branches/presentation/src/libraries/core/GUIManager.h

    r7648 r7760  
    4949#include "util/Singleton.h"
    5050#include "input/InputHandler.h"
     51#include "OrxonoxClass.h"
    5152
    5253// Tolua includes (have to be relative to the current directory)
     
    7071    */
    7172    class _CoreExport GUIManager // tolua_export
    72         : public Singleton<GUIManager>, public InputHandler
     73        : public Singleton<GUIManager>, public InputHandler, public OrxonoxClass
    7374    { // tolua_export
    7475        friend class Singleton<GUIManager>;
     
    7677        GUIManager(const std::pair<int, int>& mousePosition);
    7778        ~GUIManager();
     79
     80        void setConfigValues(void);
     81        void changedGUIScheme(void);
    7882
    7983        void preUpdate(const Clock& time);
     
    143147        static GUIManager*                   singletonPtr_s;    //!< Singleton reference to GUIManager
    144148
     149        // The used CEGUI scheme.
     150        static const std::string defaultScheme_;
     151        std::string guiScheme_;
     152
    145153    }; // tolua_export
    146154} // tolua_export
Note: See TracChangeset for help on using the changeset viewer.