From 59ccf977ee2006e01c4372f6e6a58fef78fadfdd Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Fri, 13 Jul 2012 05:37:09 +0200 Subject: [PATCH] CHANGED: #1471 CInterfaceParser is now a component of CWidgetManager, and is instantiated by an abstract factory method. (IParser::createParser()) --- code/nel/include/nel/gui/interface_parser.h | 5 +- code/nel/include/nel/gui/parser.h | 72 +++++++++++++++++++ code/nel/include/nel/gui/widget_manager.h | 24 ++----- code/nel/src/gui/group_html.cpp | 14 ++-- code/nel/src/gui/group_menu.cpp | 8 +-- code/nel/src/gui/group_table.cpp | 2 +- code/nel/src/gui/interface_element.cpp | 4 +- code/nel/src/gui/interface_group.cpp | 4 +- code/nel/src/gui/parser.cpp | 39 ++++++++++ code/nel/src/gui/view_pointer.cpp | 4 +- code/nel/src/gui/widget_manager.cpp | 4 +- code/ryzom/client/src/commands.cpp | 2 +- code/ryzom/client/src/connection.cpp | 14 ++-- .../src/interface_v3/action_handler_game.cpp | 58 +++++++-------- .../src/interface_v3/action_handler_help.cpp | 6 +- .../src/interface_v3/action_handler_item.cpp | 62 ++++++++-------- .../src/interface_v3/action_handler_misc.cpp | 6 +- .../src/interface_v3/action_handler_ui.cpp | 16 ++--- .../src/interface_v3/action_phrase_faber.cpp | 2 +- .../bot_chat_page_player_gift.cpp | 2 +- .../src/interface_v3/bot_chat_page_trade.cpp | 8 +-- .../src/interface_v3/chat_text_manager.cpp | 2 +- .../client/src/interface_v3/chat_window.cpp | 6 +- .../client/src/interface_v3/dbctrl_sheet.cpp | 8 +-- .../src/interface_v3/dbgroup_build_phrase.cpp | 6 +- .../dbgroup_list_sheet_icon_phrase.cpp | 2 +- .../dbgroup_list_sheet_text_phrase.cpp | 2 +- .../src/interface_v3/flying_text_manager.cpp | 4 +- .../interface_v3/group_in_scene_bubble.cpp | 25 +++---- .../interface_v3/group_in_scene_user_info.cpp | 10 +-- .../src/interface_v3/group_quick_help.cpp | 2 +- .../client/src/interface_v3/group_skills.cpp | 2 +- .../client/src/interface_v3/guild_manager.cpp | 2 +- .../src/interface_v3/interface_config.cpp | 4 +- .../interface_expr_user_fct_game.cpp | 2 +- .../interface_expr_user_fct_items.cpp | 10 +-- .../src/interface_v3/interface_manager.cpp | 27 ++++--- .../src/interface_v3/interface_manager.h | 4 -- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 18 ++--- .../client/src/interface_v3/macrocmd_key.cpp | 4 +- .../src/interface_v3/macrocmd_manager.cpp | 4 +- .../client/src/interface_v3/obs_huge_list.cpp | 8 +-- .../src/interface_v3/people_interraction.cpp | 4 +- .../client/src/interface_v3/people_list.cpp | 4 +- code/ryzom/client/src/login.cpp | 4 +- code/ryzom/client/src/misc.cpp | 8 +-- code/ryzom/client/src/net_manager.cpp | 2 +- code/ryzom/client/src/r2/displayer_visual.cpp | 2 +- code/ryzom/client/src/r2/editor.cpp | 2 +- code/ryzom/client/src/release.cpp | 2 +- 50 files changed, 317 insertions(+), 219 deletions(-) create mode 100644 code/nel/include/nel/gui/parser.h create mode 100644 code/nel/src/gui/parser.cpp diff --git a/code/nel/include/nel/gui/interface_parser.h b/code/nel/include/nel/gui/interface_parser.h index 92e73775f..032884437 100644 --- a/code/nel/include/nel/gui/interface_parser.h +++ b/code/nel/include/nel/gui/interface_parser.h @@ -48,7 +48,6 @@ namespace NLGUI * \date 2002 */ - // this is the base class for CInterfaceManager class CInterfaceParser : public IParser { @@ -168,8 +167,8 @@ namespace NLGUI /// \name Parameter variable // @{ const std::string& getDefine(const std::string &id) const; - bool isDefineExist(const std::string &id) const; - void setDefine(const std::string &id, const std::string &value); + bool isDefineExist(const std::string &id) const; + void setDefine(const std::string &id, const std::string &value); // @} /// \name Dynamic links mgt diff --git a/code/nel/include/nel/gui/parser.h b/code/nel/include/nel/gui/parser.h new file mode 100644 index 000000000..5adfd0691 --- /dev/null +++ b/code/nel/include/nel/gui/parser.h @@ -0,0 +1,72 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef PARSER_H +#define PARSER_H + +#include +#include +#include "nel/misc/types_nl.h" + +namespace NLGUI +{ + class CInterfaceElement; + class CInterfaceGroup; + class CInterfaceAnim; + class CProcedure; + class CCtrlSheetSelection; + class CInterfaceLink; + + class IParser + { + public: + IParser(); + virtual ~IParser(); + + static IParser* createParser(); + + virtual void addParentPositionAssociation( CInterfaceElement *element, const std::string &parentID ) = 0; + virtual void addParentSizeAssociation( CInterfaceElement *element, const std::string &parentID ) = 0; + virtual void addParentSizeMaxAssociation( CInterfaceElement *element, const std::string &parentID ) = 0; + virtual void addLuaClassAssociation( CInterfaceGroup *group, const std::string &luaScript ) = 0; + virtual CInterfaceGroup* createGroupInstance( const std::string &templateName, const std::string &parentID, const std::pair< std::string, std::string > *templateParams, uint numParams, bool updateLinks = true ) = 0; + virtual CInterfaceGroup* createGroupInstance( const std::string &templateName, const std::string &parentID, std::vector< std::pair< std::string, std::string > > &templateParams, bool updateLinks = true ) = 0; + virtual bool parseGroupChildren( xmlNodePtr cur, CInterfaceGroup * parentGroup, bool reload ) = 0; + virtual uint getProcedureNumActions( const std::string &procName ) const = 0; + virtual bool getProcedureAction( const std::string &procName, uint actionIndex, std::string &ah, std::string ¶ms ) const = 0; + virtual const std::string& getDefine(const std::string &id) const = 0; + virtual CInterfaceAnim* getAnim( const std::string &name ) const = 0; + virtual CProcedure* getProc( const std::string &name ) = 0; + virtual bool parseInterface( const std::vector< std::string > &xmlFileNames, bool reload, bool isFilename = true, bool checkInData = false ) = 0; + virtual void initLUA() = 0; + virtual void uninitLUA() = 0; + virtual bool isLuaInitialized() const = 0; + virtual bool loadLUA( const std::string &luaFile, std::string &error ) = 0; + virtual void reloadAllLuaFileScripts() = 0; + virtual void removeAllTemplates() = 0; + virtual bool solveDefine( const std::string &propVal, std::string &newPropVal, std::string &defError ) = 0; + virtual CInterfaceElement* createUIElement( const std::string &templateName, const std::string &parentID, const std::pair< std::string,std::string> *templateParams, uint numParams, bool updateLinks ) = 0; + virtual CInterfaceElement* createUIElement( const std::string &templateName, const std::string &parentID, std::vector< std::pair< std::string, std::string > > &templateParams, bool updateLinks = true ) = 0; + virtual bool isDefineExist( const std::string &id ) const = 0; + virtual CCtrlSheetSelection &getCtrlSheetSelection() = 0; + virtual bool addLink( CInterfaceLink *link, const std::string &id ) = 0; + virtual bool removeLink( const std::string &id ) = 0; + }; +} + +#endif + diff --git a/code/nel/include/nel/gui/widget_manager.h b/code/nel/include/nel/gui/widget_manager.h index e716816b5..8410bcc4a 100644 --- a/code/nel/include/nel/gui/widget_manager.h +++ b/code/nel/include/nel/gui/widget_manager.h @@ -28,6 +28,7 @@ #include "nel/gui/interface_options.h" #include "nel/gui/event_descriptor.h" #include "nel/3d/u_camera.h" +#include "nel/gui/parser.h" namespace NLMISC { @@ -46,23 +47,6 @@ namespace NLGUI class CInterfaceAnim; class CProcedure; - class IParser - { - public: - virtual void addParentPositionAssociation( CInterfaceElement *element, const std::string &parentID ) = 0; - virtual void addParentSizeAssociation( CInterfaceElement *element, const std::string &parentID ) = 0; - virtual void addParentSizeMaxAssociation( CInterfaceElement *element, const std::string &parentID ) = 0; - virtual void addLuaClassAssociation( CInterfaceGroup *group, const std::string &luaScript ) = 0; - virtual CInterfaceGroup* createGroupInstance( const std::string &templateName, const std::string &parentID, const std::pair< std::string, std::string > *templateParams, uint numParams, bool updateLinks = true ) = 0; - virtual CInterfaceGroup* createGroupInstance( const std::string &templateName, const std::string &parentID, std::vector< std::pair< std::string, std::string > > &templateParams, bool updateLinks = true ) = 0; - virtual bool parseGroupChildren( xmlNodePtr cur, CInterfaceGroup * parentGroup, bool reload ) = 0; - virtual uint getProcedureNumActions( const std::string &procName ) const = 0; - virtual bool getProcedureAction( const std::string &procName, uint actionIndex, std::string &ah, std::string ¶ms ) const = 0; - virtual const std::string& getDefine(const std::string &id) const = 0; - virtual CInterfaceAnim* getAnim( const std::string &name ) const = 0; - virtual CProcedure* getProc( const std::string &name ) = 0; - }; - /// Manages the GUI widgets class CWidgetManager{ @@ -483,13 +467,15 @@ namespace NLGUI void setProcedureAction( const std::string &procName, uint actionIndex, const std::string &ah, const std::string ¶ms ); const CEventDescriptorKey& getLastKeyEvent() const{ return lastKeyEvent; } - - static IParser *parser; + IParser* getParser() const{ return parser; } + private: CWidgetManager(); ~CWidgetManager(); + IParser *parser; + static CWidgetManager *instance; std::vector< SMasterGroup > _MasterGroups; std::vector< SModalWndInfo > _ModalStack; diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 3e6d82ed9..2f0ad8f68 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -950,7 +950,7 @@ namespace NLGUI else parentId = _Paragraph->getId(); - CInterfaceGroup *inst = CWidgetManager::parser->createGroupInstance(templateName, parentId+":"+id, tmplParams); + CInterfaceGroup *inst = CWidgetManager::getInstance()->getParser()->createGroupInstance(templateName, parentId+":"+id, tmplParams); if (inst) { inst->setId(parentId+":"+id); @@ -1258,7 +1258,7 @@ namespace NLGUI tmplParams.push_back(TTmplParam("active", "true")); if (!minWidth.empty()) tmplParams.push_back(TTmplParam("wmin", minWidth)); - CInterfaceGroup *buttonGroup = CWidgetManager::parser->createGroupInstance(buttonTemplate, _Paragraph->getId(), tmplParams); + CInterfaceGroup *buttonGroup = CWidgetManager::getInstance()->getParser()->createGroupInstance(buttonTemplate, _Paragraph->getId(), tmplParams); if (buttonGroup) { @@ -2422,7 +2422,7 @@ namespace NLGUI tmplParams.push_back(TTmplParam("onclick", "browse")); tmplParams.push_back(TTmplParam("onclick_param", param)); tmplParams.push_back(TTmplParam("active", "true")); - CInterfaceGroup *buttonGroup = CWidgetManager::parser->createGroupInstance(buttonTemplate, _Paragraph->getId(), tmplParams); + CInterfaceGroup *buttonGroup = CWidgetManager::getInstance()->getParser()->createGroupInstance(buttonTemplate, _Paragraph->getId(), tmplParams); if (buttonGroup) { @@ -2614,7 +2614,7 @@ namespace NLGUI templateParams.push_back (std::pair ("want_return", multiLine?"true":"false")); templateParams.push_back (std::pair ("enter_recover_focus", "false")); templateParams.push_back (std::pair ("max_num_chars", "1024")); - CInterfaceGroup *textArea = CWidgetManager::parser->createGroupInstance (templateName.c_str(), + CInterfaceGroup *textArea = CWidgetManager::getInstance()->getParser()->createGroupInstance (templateName.c_str(), getParagraph()->getId(), templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); // Group created ? @@ -2652,7 +2652,7 @@ namespace NLGUI // Not added ? std::vector > templateParams; templateParams.push_back (std::pair ("id", name)); - CInterfaceGroup *group = CWidgetManager::parser->createGroupInstance (templateName.c_str(), + CInterfaceGroup *group = CWidgetManager::getInstance()->getParser()->createGroupInstance (templateName.c_str(), getParagraph()->getId(), templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); // Group created ? @@ -3510,11 +3510,11 @@ namespace NLGUI { const std::string &procName= params; // look into this proc - uint numActions= CWidgetManager::parser->getProcedureNumActions(procName); + uint numActions= CWidgetManager::getInstance()->getParser()->getProcedureNumActions(procName); for(uint i=0;igetProcedureAction(procName, i, procAh, procParams)) + if( CWidgetManager::getInstance()->getParser()->getProcedureAction(procName, i, procAh, procParams)) { // recurs proc if needed! if (actionLaunchUrlRecurs(procAh, procParams, url)) diff --git a/code/nel/src/gui/group_menu.cpp b/code/nel/src/gui/group_menu.cpp index 6fbd586fd..603356055 100644 --- a/code/nel/src/gui/group_menu.cpp +++ b/code/nel/src/gui/group_menu.cpp @@ -344,7 +344,7 @@ namespace NLGUI } string completeId = _Parent->getId() + ":" + _Lines[_Lines.size()-1].Id; - CInterfaceGroup *pUGLeft = CWidgetManager::parser->createGroupInstance((const char*)usergroup, completeId, vparams); + CInterfaceGroup *pUGLeft = CWidgetManager::getInstance()->getParser()->createGroupInstance((const char*)usergroup, completeId, vparams); if (pUGLeft) setUserGroupLeft((uint)_Lines.size()-1, pUGLeft, true); } @@ -359,7 +359,7 @@ namespace NLGUI } string completeId = _Parent->getId() + ":" + _Lines[_Lines.size()-1].Id; - CInterfaceGroup *pUG = CWidgetManager::parser->createGroupInstance((const char*)usergroup, completeId, vparams); + CInterfaceGroup *pUG = CWidgetManager::getInstance()->getParser()->createGroupInstance((const char*)usergroup, completeId, vparams); if (pUG) setUserGroupRight((uint)_Lines.size()-1, pUG, true); } @@ -1139,13 +1139,13 @@ namespace NLGUI } // create the real separator. It may be larger than the group list, this is why we create a separate group - CInterfaceGroup *separator = CWidgetManager::parser->createGroupInstance("menu_separator", "", NULL, 0); + CInterfaceGroup *separator = CWidgetManager::getInstance()->getParser()->createGroupInstance("menu_separator", "", NULL, 0); if (!separator) return; separator->setId(ID_MENU_SEPARATOR); addGroup(separator); separator->setParent(this); // create place holder group - CInterfaceGroup *ph = CWidgetManager::parser->createGroupInstance("menu_separator_empty", "", NULL, 0); + CInterfaceGroup *ph = CWidgetManager::getInstance()->getParser()->createGroupInstance("menu_separator_empty", "", NULL, 0); if (!ph) { delGroup(separator); diff --git a/code/nel/src/gui/group_table.cpp b/code/nel/src/gui/group_table.cpp index 4baa32ab1..3257e3160 100644 --- a/code/nel/src/gui/group_table.cpp +++ b/code/nel/src/gui/group_table.cpp @@ -87,7 +87,7 @@ namespace NLGUI Group->setId(parentGroup->getId() + Group->getId()); setEnclosedGroupDefaultParams(); // parse the children - bool ok = CWidgetManager::parser->parseGroupChildren(cur, Group, false); + bool ok = CWidgetManager::getInstance()->getParser()->parseGroupChildren(cur, Group, false); if (!ok) return false; // align ptr = (char*) xmlGetProp( cur, (xmlChar*)"align" ); diff --git a/code/nel/src/gui/interface_element.cpp b/code/nel/src/gui/interface_element.cpp index beb150f99..0149b739b 100644 --- a/code/nel/src/gui/interface_element.cpp +++ b/code/nel/src/gui/interface_element.cpp @@ -156,7 +156,7 @@ namespace NLGUI idparent = parentGroup->getId() +":"; else idparent = "ui:"; - CWidgetManager::parser->addParentPositionAssociation(this, idparent + string((const char*)ptr)); + CWidgetManager::getInstance()->getParser()->addParentPositionAssociation(this, idparent + string((const char*)ptr)); } } @@ -177,7 +177,7 @@ namespace NLGUI if (parentGroup) idparent = parentGroup->getId(); } - CWidgetManager::parser->addParentSizeAssociation( this, idparent ); + CWidgetManager::getInstance()->getParser()->addParentSizeAssociation( this, idparent ); } ptr = (char*) xmlGetProp (cur, (xmlChar*)"sizeref"); diff --git a/code/nel/src/gui/interface_group.cpp b/code/nel/src/gui/interface_group.cpp index ac8842b81..72d1de1d7 100644 --- a/code/nel/src/gui/interface_group.cpp +++ b/code/nel/src/gui/interface_group.cpp @@ -324,7 +324,7 @@ namespace NLGUI if (parentGroup) idparent = parentGroup->getId(); } - CWidgetManager::parser->addParentSizeMaxAssociation (this, idparent); + CWidgetManager::getInstance()->getParser()->addParentSizeMaxAssociation (this, idparent); } // left & right clicks @@ -348,7 +348,7 @@ namespace NLGUI // LuaClass script ptr = xmlGetProp (cur, (xmlChar*)"lua_class"); if( ptr ) - CWidgetManager::parser->addLuaClassAssociation( this, (const char*)ptr ); + CWidgetManager::getInstance()->getParser()->addLuaClassAssociation( this, (const char*)ptr ); return true; } diff --git a/code/nel/src/gui/parser.cpp b/code/nel/src/gui/parser.cpp new file mode 100644 index 000000000..7874e43a5 --- /dev/null +++ b/code/nel/src/gui/parser.cpp @@ -0,0 +1,39 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#include "nel/misc/rgba.h" +#include +#include "nel/gui/interface_group.h" +#include "nel/gui/interface_parser.h" + +namespace NLGUI +{ + IParser::IParser() + { + } + + + IParser::~IParser() + { + } + + + IParser* IParser::createParser() + { + return new CInterfaceParser(); + } +} \ No newline at end of file diff --git a/code/nel/src/gui/view_pointer.cpp b/code/nel/src/gui/view_pointer.cpp index ce0e3ad7b..9f12926a4 100644 --- a/code/nel/src/gui/view_pointer.cpp +++ b/code/nel/src/gui/view_pointer.cpp @@ -161,13 +161,13 @@ namespace NLGUI std::vector > templateParams; templateParams.push_back (std::pair("id", "string_cursor")); - _StringCursor = CWidgetManager::parser->createGroupInstance("string_cursor", "", templateParams); + _StringCursor = CWidgetManager::getInstance()->getParser()->createGroupInstance("string_cursor", "", templateParams); if (_StringCursor) _StringCursor->setParentPos(CWidgetManager::getInstance()->getElementFromId("ui:interface")); templateParams.clear(); templateParams.push_back (std::pair("id", "string_cursor_hardware")); - _StringCursorHardware = CWidgetManager::parser->createGroupInstance("string_cursor_hardware", "", templateParams); + _StringCursorHardware = CWidgetManager::getInstance()->getParser()->createGroupInstance("string_cursor_hardware", "", templateParams); if (_StringCursorHardware) _StringCursorHardware->setParentPos(CWidgetManager::getInstance()->getElementFromId("ui:interface")); } diff --git a/code/nel/src/gui/widget_manager.cpp b/code/nel/src/gui/widget_manager.cpp index fc399f208..0c91d98f3 100644 --- a/code/nel/src/gui/widget_manager.cpp +++ b/code/nel/src/gui/widget_manager.cpp @@ -54,8 +54,6 @@ namespace NLGUI { CWidgetManager* CWidgetManager::instance = NULL; std::string CWidgetManager::_CtrlLaunchingModalId= "ctrl_launch_modal"; - IParser* CWidgetManager::parser = NULL; - // ---------------------------------------------------------------------------- // SMasterGroup // ---------------------------------------------------------------------------- @@ -3094,6 +3092,8 @@ namespace NLGUI CWidgetManager::CWidgetManager() { + parser = IParser::createParser(); + _Pointer = NULL; curContextHelp = NULL; _ContextHelpActive = true; diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index d0ad1eb54..bf2de0603 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -5079,7 +5079,7 @@ NLMISC_COMMAND(luaReload, "reload all .lua script files", "") CInterfaceManager *pIM= CInterfaceManager::getInstance(); if(ClientCfg.AllowDebugLua) { - pIM->getParser()->reloadAllLuaFileScripts(); + CWidgetManager::getInstance()->getParser()->reloadAllLuaFileScripts(); return true; } else diff --git a/code/ryzom/client/src/connection.cpp b/code/ryzom/client/src/connection.cpp index 45edf93d5..2c701fdc7 100644 --- a/code/ryzom/client/src/connection.cpp +++ b/code/ryzom/client/src/connection.cpp @@ -967,9 +967,9 @@ TInterfaceState globalMenu() CInterfaceManager *pIM = CInterfaceManager::getInstance(); sint32 nScreenConnecting, nScreenIntro, nScreenServerCrashed; - fromString(pIM->getParser()->getDefine("screen_connecting"), nScreenConnecting); - fromString(pIM->getParser()->getDefine("screen_intro"), nScreenIntro); - fromString(pIM->getParser()->getDefine("screen_crashing"), nScreenServerCrashed); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("screen_connecting"), nScreenConnecting); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("screen_intro"), nScreenIntro); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("screen_crashing"), nScreenServerCrashed); // SKIP INTRO : Write to the database if we have to skip the intro and write we want to skip further intro to client cfg if (ClientCfg.SkipIntro) @@ -1004,7 +1004,7 @@ TInterfaceState globalMenu() Actions.enable(true); EditActions.enable(true); LuaBGDSuccessFlag = true; - pIM->getParser()->reloadAllLuaFileScripts(); + CWidgetManager::getInstance()->getParser()->reloadAllLuaFileScripts(); } #endif @@ -2136,7 +2136,7 @@ public: if (i>0) params.push_back(pair("posref", "BL TL")); - CInterfaceGroup *pNewLine =pIM->getParser()->createGroupInstance("t_mainland", GROUP_LIST_MAINLAND, params); + CInterfaceGroup *pNewLine = CWidgetManager::getInstance()->getParser()->createGroupInstance("t_mainland", GROUP_LIST_MAINLAND, params); if (pNewLine != NULL) { CViewBase *pVBon = pNewLine->getView("online"); @@ -2261,7 +2261,7 @@ public: } First = false; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - return pIM->getParser()->createGroupInstance(templateName, GROUP_LIST_KEYSET, params); + return CWidgetManager::getInstance()->getParser()->createGroupInstance(templateName, GROUP_LIST_KEYSET, params); } void addGroupInList(CInterfaceGroup *pNewLine) @@ -2722,7 +2722,7 @@ class CAHScenarioControl : public IActionHandler params.push_back(pair("id", toString(Mainlands[i].Id))); params.push_back(pair("w", "1024")); params.push_back(pair("tooltip", "uiRingFilterShard")); - CInterfaceGroup *toggleGr =pIM->getParser()->createGroupInstance("label_toggle_button", shardList->getId(), params); + CInterfaceGroup *toggleGr = CWidgetManager::getInstance()->getParser()->createGroupInstance("label_toggle_button", shardList->getId(), params); shardList->addChild(toggleGr); // set unicode name CViewText *shardName = dynamic_cast(toggleGr->getView("button_text")); diff --git a/code/ryzom/client/src/interface_v3/action_handler_game.cpp b/code/ryzom/client/src/interface_v3/action_handler_game.cpp index c212684ef..66fc005cb 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -743,11 +743,11 @@ static void chooseSheath (ITEMFAMILY::EItemFamily eIF, string sAllSkills) { // Choose right sheath CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CCDBNodeLeaf *pNLwrite = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getParser()->getDefine("ui_set_active")); - CCDBNodeLeaf *pNLread = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getParser()->getDefine("set_nb")); + CCDBNodeLeaf *pNLwrite = NLGUI::CDBManager::getInstance()->getDbProp(CWidgetManager::getInstance()->getParser()->getDefine("ui_set_active")); + CCDBNodeLeaf *pNLread = NLGUI::CDBManager::getInstance()->getDbProp(CWidgetManager::getInstance()->getParser()->getDefine("set_nb")); sint32 nNbSheath = (sint32)pNLread->getValue64(); if (nNbSheath == 0) return; - pNLread = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getParser()->getDefine("set_active")); + pNLread = NLGUI::CDBManager::getInstance()->getDbProp(CWidgetManager::getInstance()->getParser()->getDefine("set_active")); sint32 nActiveSheath = (sint32)pNLread->getValue64(); bool bFound = false; for (sint32 i = 0; i < ((nNbSheath/2)+1); ++i) @@ -763,7 +763,7 @@ static void chooseSheath (ITEMFAMILY::EItemFamily eIF, string sAllSkills) while (nSheathToTest >= (INVENTORIES::sheath+nNbSheath)) nSheathToTest -= nNbSheath; string sPath; - sPath = pIM->getParser()->getDefine("set_base") + ":" + NLMISC::toString(nSheathToTest) + ":" + pIM->getParser()->getDefine("set_r") + ":SHEET"; + sPath = CWidgetManager::getInstance()->getParser()->getDefine("set_base") + ":" + NLMISC::toString(nSheathToTest) + ":" + CWidgetManager::getInstance()->getParser()->getDefine("set_r") + ":SHEET"; pNLread = NLGUI::CDBManager::getInstance()->getDbProp(sPath); sint32 sheetid = (sint32)pNLread->getValue64(); CItemSheet *pIS = dynamic_cast(SheetMngr.get(CSheetId(sheetid))); @@ -1305,7 +1305,7 @@ class CSelectItemSheet : public IActionHandler if (!ctrlSheet) return; sint selectionGroup = ctrlSheet->getSelectionGroup(); CInterfaceManager *im = CInterfaceManager::getInstance(); - const CCtrlSheetSelection &css = im->getParser()->getCtrlSheetSelection(); + const CCtrlSheetSelection &css = CWidgetManager::getInstance()->getParser()->getCtrlSheetSelection(); const CSheetSelectionGroup *csg = css.getGroup(selectionGroup); if (csg && csg->isActive()) { @@ -2103,7 +2103,7 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler if ( pE->isPlayer() ) { // Player => deduce RegionForce & ForceLevel from the database - CCDBNodeLeaf *pDbTargetUid = NLGUI::CDBManager::getInstance()->getDbProp( pIM->getParser()->getDefine("target_uid") ); + CCDBNodeLeaf *pDbTargetUid = NLGUI::CDBManager::getInstance()->getDbProp( CWidgetManager::getInstance()->getParser()->getDefine("target_uid") ); if ( ! pDbTargetUid ) return; // Hide the target level if the USER is not in PVP FACTION @@ -2121,7 +2121,7 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler return; } - CCDBNodeLeaf *pDbPlayerLevel = NLGUI::CDBManager::getInstance()->getDbProp( pIM->getParser()->getDefine("target_player_level") ); + CCDBNodeLeaf *pDbPlayerLevel = NLGUI::CDBManager::getInstance()->getDbProp( CWidgetManager::getInstance()->getParser()->getDefine("target_player_level") ); if ( ! pDbPlayerLevel ) return; sint nLevel = pDbPlayerLevel->getValue32(); @@ -2158,13 +2158,13 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler // Set color if (nForceRegion > 6) nForceRegion = 6; if (nForceRegion < 1) nForceRegion = 1; - CRGBA col = CInterfaceElement::convertColor(pIM->getParser()->getDefine("region_force_"+toString(nForceRegion)).c_str()); + CRGBA col = CInterfaceElement::convertColor(CWidgetManager::getInstance()->getParser()->getDefine("region_force_"+toString(nForceRegion)).c_str()); pVBR->setColor(col); // Set texture if (nLevelForce > 8) nLevelForce = 8; if (nLevelForce < 1) nLevelForce = 1; - string sTexture = pIM->getParser()->getDefine("force_level_"+toString(nLevelForce)); + string sTexture = CWidgetManager::getInstance()->getParser()->getDefine("force_level_"+toString(nLevelForce)); pVBL->setTexture(sTexture); // Set tooltip @@ -2227,12 +2227,12 @@ class CAHUpdateCurrentMode : public IActionHandler sint32 nNewMode = (sint32)eVal.getInteger(); sint32 nModeMinInf, nModeMaxInf, nModeMinLab, nModeMaxLab, nModeMinKey, nModeMaxKey; - fromString(pIM->getParser()->getDefine("mode_min_info"), nModeMinInf); - fromString(pIM->getParser()->getDefine("mode_max_info"), nModeMaxInf); - fromString(pIM->getParser()->getDefine("mode_min_lab"), nModeMinLab); - fromString(pIM->getParser()->getDefine("mode_max_lab"), nModeMaxLab); - fromString(pIM->getParser()->getDefine("mode_min_keys"), nModeMinKey); - fromString(pIM->getParser()->getDefine("mode_max_keys"), nModeMaxKey); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_min_info"), nModeMinInf); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_max_info"), nModeMaxInf); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_min_lab"), nModeMinLab); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_max_lab"), nModeMaxLab); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_min_keys"), nModeMinKey); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_max_keys"), nModeMaxKey); sint32 nMode = 0; if ((nNewMode >= nModeMinInf) && (nNewMode <= nModeMaxInf)) @@ -2275,14 +2275,14 @@ class CAHUpdateCurrentMode : public IActionHandler sint32 tmpMode; // Is NewMode entry active ? - fromString(pIM->getParser()->getDefine("mode_magic"), tmpMode); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_magic"), tmpMode); if (nNewMode == tmpMode) if ((nIntFlags & (1<getParser()->getDefine("mode_combat"), tmpMode); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_combat"), tmpMode); if (nNewMode == tmpMode) if ((nIntFlags & (1<getParser()->getDefine("mode_faber_create"), tmpMode); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_faber_create"), tmpMode); if (nNewMode == tmpMode) if ((nIntFlags & (1<getParser()->getDefine("mode_faber_repair"), tmpMode); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_faber_repair"), tmpMode); if (nNewMode == tmpMode) if ((nIntFlags & (1<getParser()->getDefine("mode_faber_refine"), tmpMode); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_faber_refine"), tmpMode); if (nNewMode == tmpMode) if ((nIntFlags & (1<getParser()->getDefine("mode_commerce"), tmpMode); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_commerce"), tmpMode); if (nNewMode == tmpMode) if ((nIntFlags & (1<getParser()->getDefine("mode_macros"), tmpMode); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_macros"), tmpMode); if (nNewMode == tmpMode) bFound = true; // Not in DB !!! } if (!bFound) { - fromString(pIM->getParser()->getDefine("mode_special_labo"), tmpMode); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_special_labo"), tmpMode); if (nNewMode == tmpMode) if ((nIntFlags & (1<getParser()->getDefine("ipj_nb_mission"), nNbMission); - fromString(pIM->getParser()->getDefine("ipj_nb_group_mission"), nNbGroupMission); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("ipj_nb_mission"), nNbMission); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("ipj_nb_group_mission"), nNbGroupMission); if (nSelected < 0) return 0; @@ -3815,8 +3815,8 @@ void runMissionProc(sint32 nSelected) CInterfaceManager *pIM = CInterfaceManager::getInstance(); sint32 nNbMission, nNbGroupMission; - fromString(pIM->getParser()->getDefine("ipj_nb_mission"), nNbMission); - fromString(pIM->getParser()->getDefine("ipj_nb_group_mission"), nNbGroupMission); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("ipj_nb_mission"), nNbMission); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("ipj_nb_group_mission"), nNbGroupMission); if (nSelected < 0) return; @@ -3845,8 +3845,8 @@ public: sint32 nSelected = NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:MISSION_SELECTED")->getValue32(); sint32 nNbMission, nNbGroupMission; - fromString(pIM->getParser()->getDefine("ipj_nb_mission"), nNbMission); - fromString(pIM->getParser()->getDefine("ipj_nb_group_mission"), nNbGroupMission); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("ipj_nb_mission"), nNbMission); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("ipj_nb_group_mission"), nNbGroupMission); // If no mission selected or title selected becomes invalid -> search a new title to select if ((nSelected == -1) || (getMissionTitle(nSelected) == 0)) diff --git a/code/ryzom/client/src/interface_v3/action_handler_help.cpp b/code/ryzom/client/src/interface_v3/action_handler_help.cpp index 7c31fba72..7a6b23d45 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_help.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_help.cpp @@ -160,7 +160,7 @@ void CInterfaceHelp::initWindows() CInterfaceManager *pIM= CInterfaceManager::getInstance(); sint maxHelpWindow; - fromString(pIM->getParser()->getDefine("MAX_HELP_WINDOW"), maxHelpWindow); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("MAX_HELP_WINDOW"), maxHelpWindow); // Allow Max 256. More may be a script error... clamp(maxHelpWindow, 0, 256); @@ -1437,7 +1437,7 @@ void getMagicProtection(CDBCtrlSheet *item, ucstring &itemText) { // Mul item quality by a constant uint maxAbsorb= item->getQuality(); - CCDBNodeLeaf *nodeFactor= NLGUI::CDBManager::getInstance()->getDbProp(pIM->getParser()->getDefine("player_protect_absorbfactor"), false); + CCDBNodeLeaf *nodeFactor= NLGUI::CDBManager::getInstance()->getDbProp(CWidgetManager::getInstance()->getParser()->getDefine("player_protect_absorbfactor"), false); if(nodeFactor) maxAbsorb= maxAbsorb*nodeFactor->getValue32()/100; @@ -3783,7 +3783,7 @@ static void onMpChangeItemPart(CInterfaceGroup *wnd, uint32 itemSheetId, const s if(viewBmp) { // texture name in config.xml - viewBmp->setTexture(pIM->getParser()->getDefine( RM_FABER_TYPE::toIconDefineString(faberType) )); + viewBmp->setTexture(CWidgetManager::getInstance()->getParser()->getDefine( RM_FABER_TYPE::toIconDefineString(faberType) )); } diff --git a/code/ryzom/client/src/interface_v3/action_handler_item.cpp b/code/ryzom/client/src/interface_v3/action_handler_item.cpp index 085b599dd..9d7ec7d2f 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_item.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_item.cpp @@ -109,11 +109,11 @@ void CInterfaceItemEdition::CItemEditionWindow::infoReceived() // get the dialog stack CInterfaceGroup* group = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(WindowName) ); - CInterfaceGroup* editShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_short")) ); - CGroupEditBox* editBoxShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_box_short")) ); - CInterfaceGroup* editLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_large")) ); - CGroupEditBox* editBoxLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_box_large")) ); - CViewText* display = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_display")) ); + CInterfaceGroup* editShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_short")) ); + CGroupEditBox* editBoxShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_box_short")) ); + CInterfaceGroup* editLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_large")) ); + CGroupEditBox* editBoxLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_box_large")) ); + CViewText* display = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_display")) ); if (group && editShort && editBoxShort && editLarge && editBoxLarge && display) { CClientItemInfo const& itemInfo = getInventory().getItemInfo( ItemSlotId ); @@ -199,14 +199,14 @@ void CInterfaceItemEdition::CItemEditionWindow::begin() // get the dialog stack CGroupContainer* group = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(WindowName) ); - CInterfaceGroup* editShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_short")) ); - CGroupEditBox* editBoxShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_box_short")) ); - CInterfaceGroup* editLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_large")) ); - CGroupEditBox* editBoxLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_box_large")) ); - CViewText* display = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_display")) ); - CInterfaceGroup* editButtons = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_buttons")) ); - CCtrlBaseButton* closeButton = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_close_button")) ); - CViewBitmap* background = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_background")) ); + CInterfaceGroup* editShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_short")) ); + CGroupEditBox* editBoxShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_box_short")) ); + CInterfaceGroup* editLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_large")) ); + CGroupEditBox* editBoxLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_box_large")) ); + CViewText* display = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_display")) ); + CInterfaceGroup* editButtons = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_buttons")) ); + CCtrlBaseButton* closeButton = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_close_button")) ); + CViewBitmap* background = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_background")) ); if (group && editShort && editBoxShort && editLarge && editBoxLarge && display && editButtons && closeButton && background) { @@ -336,14 +336,14 @@ void CInterfaceItemEdition::CItemEditionWindow::end() // get the dialog stack CInterfaceGroup* group = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(windowName) ); - CInterfaceGroup* editShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_short")) ); - CGroupEditBox* editBoxShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_box_short")) ); - CInterfaceGroup* editLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_large")) ); - CGroupEditBox* editBoxLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_box_large")) ); - CViewText* display = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_display")) ); - CInterfaceGroup* editButtons = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_buttons")) ); - CCtrlBaseButton* closeButton = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_close_button")) ); - CViewBitmap* background = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_background")) ); + CInterfaceGroup* editShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_short")) ); + CGroupEditBox* editBoxShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_box_short")) ); + CInterfaceGroup* editLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_large")) ); + CGroupEditBox* editBoxLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_box_large")) ); + CViewText* display = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_display")) ); + CInterfaceGroup* editButtons = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_buttons")) ); + CCtrlBaseButton* closeButton = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_close_button")) ); + CViewBitmap* background = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_background")) ); if (group && editShort && editBoxShort && editLarge && editBoxLarge && display && editButtons && closeButton && background) { // disable the window @@ -375,14 +375,14 @@ void CInterfaceItemEdition::CItemEditionWindow::validate() // get the dialog stack CInterfaceGroup* group = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(windowName) ); - CInterfaceGroup* editShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_short")) ); - CGroupEditBox* editBoxShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_box_short")) ); - CInterfaceGroup* editLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_large")) ); - CGroupEditBox* editBoxLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_box_large")) ); - CViewText* display = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_display")) ); - CInterfaceGroup* editButtons = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_buttons")) ); - CCtrlBaseButton* closeButton = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_close_button")) ); - CViewBitmap* background = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_background")) ); + CInterfaceGroup* editShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_short")) ); + CGroupEditBox* editBoxShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_box_short")) ); + CInterfaceGroup* editLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_large")) ); + CGroupEditBox* editBoxLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_box_large")) ); + CViewText* display = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_display")) ); + CInterfaceGroup* editButtons = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_buttons")) ); + CCtrlBaseButton* closeButton = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_close_button")) ); + CViewBitmap* background = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_background")) ); if (group && editShort && editBoxShort && editLarge && editBoxLarge && display && editButtons && closeButton && background) { bool textValid = editShort->getActive(); @@ -1317,7 +1317,7 @@ class CHandlerActiveSheath : public IActionHandler CInterfaceManager *pIM = CInterfaceManager::getInstance(); // Get the user interface value. - uint8 activeSheath = (uint8)NLGUI::CDBManager::getInstance()->getDbProp( pIM->getParser()->getDefine("ui_set_active") )->getValue32(); + uint8 activeSheath = (uint8)NLGUI::CDBManager::getInstance()->getDbProp( CWidgetManager::getInstance()->getParser()->getDefine("ui_set_active") )->getValue32(); // Write to the Local Database. NLGUI::CDBManager::getInstance()->getDbProp( "LOCAL:INVENTORY:ACTIVE_SHEATH" )->setValue32(activeSheath); @@ -1358,7 +1358,7 @@ class CHandlerReceiveActiveSheath : public IActionHandler uint8 activeSheath = (uint8)NLGUI::CDBManager::getInstance()->getDbProp( "LOCAL:INVENTORY:ACTIVE_SHEATH" )->getValue32(); // Write to the Local Database. - NLGUI::CDBManager::getInstance()->getDbProp( pIM->getParser()->getDefine("ui_set_active") )->setValue32(activeSheath); + NLGUI::CDBManager::getInstance()->getDbProp( CWidgetManager::getInstance()->getParser()->getDefine("ui_set_active") )->setValue32(activeSheath); } }; REGISTER_ACTION_HANDLER( CHandlerReceiveActiveSheath, "receive_active_sheath" ); diff --git a/code/ryzom/client/src/interface_v3/action_handler_misc.cpp b/code/ryzom/client/src/interface_v3/action_handler_misc.cpp index 216af8a81..36adbd68b 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_misc.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_misc.cpp @@ -434,7 +434,7 @@ class CActionHandlerAddLink : public IActionHandler CInterfaceLink *il = new CInterfaceLink; il->init(targetsVect, expr, ah, ahparam, ahcond, parentGroup); CInterfaceManager *im = CInterfaceManager::getInstance(); - im->getParser()->addLink(il, id); + CWidgetManager::getInstance()->getParser()->addLink(il, id); il->update(); } }; @@ -453,7 +453,7 @@ class CActionHandlerRemoveLink : public IActionHandler return; } CInterfaceManager *im = CInterfaceManager::getInstance(); - im->getParser()->removeLink(id); + CWidgetManager::getInstance()->getParser()->removeLink(id); } }; REGISTER_ACTION_HANDLER (CActionHandlerRemoveLink, "remove_link"); @@ -489,7 +489,7 @@ CInterfaceGroup *createMenuColorWidget(const string &colDbEntry, make_pair(string("tooltip"), toolTipTextID), make_pair(string("ccd_title"), ccdTitle), }; - return im->getParser()->createGroupInstance("menu_color_widget", "", params, 3); + return CWidgetManager::getInstance()->getParser()->createGroupInstance("menu_color_widget", "", params, 3); } // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/action_handler_ui.cpp b/code/ryzom/client/src/interface_v3/action_handler_ui.cpp index c0491b2b3..5b70faaf6 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_ui.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_ui.cpp @@ -447,9 +447,9 @@ class CAHNextSheath : public IActionHandler virtual void execute (CCtrlBase *pCaller, const string &Params) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CCDBNodeLeaf *pNLCurSetWrite = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getParser()->getDefine("ui_set_active")); - CCDBNodeLeaf *pNLCurSetRead = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getParser()->getDefine("set_active")); - CCDBNodeLeaf *pNLNbSet = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getParser()->getDefine("set_nb")); + CCDBNodeLeaf *pNLCurSetWrite = NLGUI::CDBManager::getInstance()->getDbProp(CWidgetManager::getInstance()->getParser()->getDefine("ui_set_active")); + CCDBNodeLeaf *pNLCurSetRead = NLGUI::CDBManager::getInstance()->getDbProp(CWidgetManager::getInstance()->getParser()->getDefine("set_active")); + CCDBNodeLeaf *pNLNbSet = NLGUI::CDBManager::getInstance()->getDbProp(CWidgetManager::getInstance()->getParser()->getDefine("set_nb")); sint64 nVal = pNLCurSetRead->getValue64() - INVENTORIES::sheath1; sint64 nMax = pNLNbSet->getValue64(); nVal++; @@ -471,9 +471,9 @@ class CAHPreviousSheath : public IActionHandler virtual void execute (CCtrlBase *pCaller, const string &Params) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CCDBNodeLeaf *pNLCurSetWrite = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getParser()->getDefine("ui_set_active")); - CCDBNodeLeaf *pNLCurSetRead = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getParser()->getDefine("set_active")); - CCDBNodeLeaf *pNLNbSet = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getParser()->getDefine("set_nb")); + CCDBNodeLeaf *pNLCurSetWrite = NLGUI::CDBManager::getInstance()->getDbProp(CWidgetManager::getInstance()->getParser()->getDefine("ui_set_active")); + CCDBNodeLeaf *pNLCurSetRead = NLGUI::CDBManager::getInstance()->getDbProp(CWidgetManager::getInstance()->getParser()->getDefine("set_active")); + CCDBNodeLeaf *pNLNbSet = NLGUI::CDBManager::getInstance()->getDbProp(CWidgetManager::getInstance()->getParser()->getDefine("set_nb")); sint64 nVal = pNLCurSetRead->getValue64() - INVENTORIES::sheath1; sint64 nMax = pNLNbSet->getValue64(); if (nVal == 0) nVal = nMax; @@ -495,8 +495,8 @@ class CAHSetSheath : public IActionHandler virtual void execute (CCtrlBase *pCaller, const string &Params) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CCDBNodeLeaf *pNLCurSetWrite = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getParser()->getDefine("ui_set_active")); - CCDBNodeLeaf *pNLNbSet = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getParser()->getDefine("set_nb")); + CCDBNodeLeaf *pNLCurSetWrite = NLGUI::CDBManager::getInstance()->getDbProp(CWidgetManager::getInstance()->getParser()->getDefine("ui_set_active")); + CCDBNodeLeaf *pNLNbSet = NLGUI::CDBManager::getInstance()->getDbProp(CWidgetManager::getInstance()->getParser()->getDefine("set_nb")); sint64 nVal; fromString(Params, nVal); nVal -= INVENTORIES::sheath1; diff --git a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp index 324c6f9d6..3f5ab38b6 100644 --- a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp +++ b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp @@ -524,7 +524,7 @@ void CActionPhraseFaber::validateFaberPlanSelection(CSBrickSheet *itemPlanBrick if(mpBuild.RequirementType==CMPBuild::ItemPartReq) { // texture name in config.xml - viewBmp->setTexture(pIM->getParser()->getDefine( RM_FABER_TYPE::toIconDefineString(mpBuild.FaberTypeRequired) )); + viewBmp->setTexture(CWidgetManager::getInstance()->getParser()->getDefine( RM_FABER_TYPE::toIconDefineString(mpBuild.FaberTypeRequired) )); } else if(mpBuild.RequirementType==CMPBuild::SpecificItemReq) { diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_player_gift.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_player_gift.cpp index 5843d2f70..c69373c14 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_player_gift.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_player_gift.cpp @@ -41,7 +41,7 @@ void CBotChatPagePlayerGift::begin() NLGUI::CDBManager::getInstance()->getDbProp(BOT_CHAT_BASE_DB_PATH ":PLAYER_GIFT")->setValue32(0); // clear money proposal value - CCDBNodeLeaf *moneyProposal = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getParser()->getDefine("money_proposal")); + CCDBNodeLeaf *moneyProposal = NLGUI::CDBManager::getInstance()->getDbProp(CWidgetManager::getInstance()->getParser()->getDefine("money_proposal")); if (moneyProposal) moneyProposal->setValue64(0); // clear 'accept' button diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp index e30fc3cfb..9d76775c9 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_trade.cpp @@ -208,7 +208,7 @@ void CBotChatPageTrade::begin() if(dbPriceMin) dbPriceMin->setValue32(0); if(dbPriceMax) { - fromString(pIM->getParser()->getDefine("bot_chat_filter_max_price"), value); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("bot_chat_filter_max_price"), value); dbPriceMax->setValue32(value); } @@ -218,7 +218,7 @@ void CBotChatPageTrade::begin() if(dbQualityMin) dbQualityMin->setValue32(0); if(dbQualityMax) { - fromString(pIM->getParser()->getDefine("bot_chat_filter_max_quality"), value); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("bot_chat_filter_max_quality"), value); dbQualityMax->setValue32(value); } @@ -1688,7 +1688,7 @@ void CBotChatPageTrade::setupFactionPointPrice(bool /* sellMode */, uint default // setup icon according to pvp clan CInterfaceManager *pIM= CInterfaceManager::getInstance(); factionName = NLMISC::toLower(factionName); - string factionIcon= pIM->getParser()->getDefine(toString("faction_icon_%s", factionName.c_str())); + string factionIcon= CWidgetManager::getInstance()->getParser()->getDefine(toString("faction_icon_%s", factionName.c_str())); CViewBitmap *vBmp= dynamic_cast(fpGroup->getView("unit_price:item_price:icone")); if(vBmp) vBmp->setTexture(factionIcon); vBmp= dynamic_cast(fpGroup->getView("total_price:item_price:icone")); @@ -2079,7 +2079,7 @@ std::string CBotChatPageTrade::getItemSheetNameForItemType(ITEM_TYPE::TItemType itemTypeDef+= ITEM_TYPE::toString(it); // return empty string if not found - return pIM->getParser()->getDefine(itemTypeDef); + return CWidgetManager::getInstance()->getParser()->getDefine(itemTypeDef); } diff --git a/code/ryzom/client/src/interface_v3/chat_text_manager.cpp b/code/ryzom/client/src/interface_v3/chat_text_manager.cpp index 371e2f059..8dea95db2 100644 --- a/code/ryzom/client/src/interface_v3/chat_text_manager.cpp +++ b/code/ryzom/client/src/interface_v3/chat_text_manager.cpp @@ -108,7 +108,7 @@ static CInterfaceGroup *parseCommandTag(ucstring &line) make_pair(string("ah"), params[2]), make_pair(string("ah_params"), params[3]) }; - return CInterfaceManager::getInstance()->getParser()->createGroupInstance(params[0], "", uiTemplateParams, 4); + return CWidgetManager::getInstance()->getParser()->createGroupInstance(params[0], "", uiTemplateParams, 4); } static CInterfaceGroup *buildLineWithCommand(CInterfaceGroup *commandGroup, CViewText *text) diff --git a/code/ryzom/client/src/interface_v3/chat_window.cpp b/code/ryzom/client/src/interface_v3/chat_window.cpp index 33422421d..26dcd64a7 100644 --- a/code/ryzom/client/src/interface_v3/chat_window.cpp +++ b/code/ryzom/client/src/interface_v3/chat_window.cpp @@ -119,7 +119,7 @@ bool CChatWindow::create(const CChatWindowDesc &desc, const std::string &chatId) params.insert(params.end(), desc.ChatTemplateParams.begin(), desc.ChatTemplateParams.end()); // create a chat container from the template - CInterfaceGroup *chatGroup = im->getParser()->createGroupInstance(chatTemplate, "ui:interface", params); + CInterfaceGroup *chatGroup = CWidgetManager::getInstance()->getParser()->createGroupInstance(chatTemplate, "ui:interface", params); if (chatGroup) { _Chat = dynamic_cast(chatGroup); @@ -554,7 +554,7 @@ void CChatGroupWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CC // on a new message, change the Tab color CInterfaceManager *pIM= CInterfaceManager::getInstance(); - CRGBA newMsgColor= CRGBA::stringToRGBA(pIM->getParser()->getDefine("chat_group_tab_color_newmsg").c_str()); + CRGBA newMsgColor= CRGBA::stringToRGBA(CWidgetManager::getInstance()->getParser()->getDefine("chat_group_tab_color_newmsg").c_str()); ucstring newmsg = msg; ucstring prefix; @@ -754,7 +754,7 @@ CGroupContainer *CChatGroupWindow::createFreeTeller(const ucstring &winNameIn, c std::string templateName = "contact_chat_friend"; CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CInterfaceGroup *pIG = pIM->getParser()->createGroupInstance(templateName, "ui:interface", properties); + CInterfaceGroup *pIG = CWidgetManager::getInstance()->getParser()->createGroupInstance(templateName, "ui:interface", properties); if (!pIG) return NULL; CGroupContainer *pGC = dynamic_cast(pIG); if (!pGC) diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index de2c5db38..b4d36e3b2 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -389,7 +389,7 @@ bool CCtrlSheetInfo::parseCtrlInfo(xmlNodePtr cur, CInterfaceGroup * /* parentGr prop = (char*) xmlGetProp( cur, (xmlChar*)"selection_group" ); if (prop) { - const CCtrlSheetSelection &css = CInterfaceManager::getInstance()->getParser()->getCtrlSheetSelection(); + const CCtrlSheetSelection &css = CWidgetManager::getInstance()->getParser()->getCtrlSheetSelection(); _SheetSelectionGroup = css.getGroupIndex((const char *) prop); if (_SheetSelectionGroup == -1) { @@ -2518,7 +2518,7 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti // draw selection border if this sheet is selected if (_SheetSelectionGroup != -1) // is this sheet selectable ? { // yes, check if it is selected - const CCtrlSheetSelection &css = pIM->getParser()->getCtrlSheetSelection(); + const CCtrlSheetSelection &css = CWidgetManager::getInstance()->getParser()->getCtrlSheetSelection(); const CSheetSelectionGroup *ssg = css.getGroup(_SheetSelectionGroup); if (ssg) { @@ -2985,7 +2985,7 @@ void CDBCtrlSheet::setCurrSelection(CDBCtrlSheet *selected) const std::string &CDBCtrlSheet::getSelectionGroupAsString() const { CInterfaceManager *im = CInterfaceManager::getInstance(); - const CCtrlSheetSelection &css = im->getParser()->getCtrlSheetSelection(); + const CCtrlSheetSelection &css = CWidgetManager::getInstance()->getParser()->getCtrlSheetSelection(); const CSheetSelectionGroup *csg = css.getGroup(_SheetSelectionGroup); static const string emptyStr; return csg ? csg->getName() : emptyStr; @@ -4176,7 +4176,7 @@ void CDBCtrlSheet::initArmourColors() { _ArmourColor[col] = CRGBA::White; std::string defineName= "armour_color_" + toString(col); - std::string colVal= pIM->getParser()->getDefine(defineName); + std::string colVal= CWidgetManager::getInstance()->getParser()->getDefine(defineName); if(!colVal.empty()) _ArmourColor[col] = convertColor(colVal.c_str()); } diff --git a/code/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp b/code/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp index 944dc06a9..833aadde1 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp @@ -226,7 +226,7 @@ void CDBGroupBuildPhrase::setupBuildSentence() if(_GroupValid) { sint rootTextMaxw; - fromString(pIM->getParser()->getDefine("phrase_build_root_info_maxw"), rootTextMaxw); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("phrase_build_root_info_maxw"), rootTextMaxw); _MainWords[0].InfoView->setLineMaxW(rootTextMaxw); } @@ -1194,8 +1194,8 @@ void CDBGroupBuildPhrase::updateAllDisplay(const CSPhraseCom &phrase) { // get define, and verify data uint numWeaponSkill; - fromString(pIM->getParser()->getDefine("phrase_max_restrict_combat"), numWeaponSkill); - string strWeaponSkill= pIM->getParser()->getDefine("phrase_def_skill_restrict_combat"); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("phrase_max_restrict_combat"), numWeaponSkill); + string strWeaponSkill= CWidgetManager::getInstance()->getParser()->getDefine("phrase_def_skill_restrict_combat"); vector weaponSkillList; splitString(strWeaponSkill, " ", weaponSkillList); nlassert(weaponSkillList.size()==numWeaponSkill); diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_icon_phrase.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_icon_phrase.cpp index b229a9f98..75769108c 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_icon_phrase.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_icon_phrase.cpp @@ -110,7 +110,7 @@ CInterfaceGroup *CDBGroupListSheetIconPhrase::createSectionGroup(const std::str tempVec[0].first="id"; tempVec[0].second= igName; // make parent to me - CInterfaceGroup *pIG = pIM->getParser()->createGroupInstance(LSP_SECTION_TEMPLATE, getId(), tempVec); + CInterfaceGroup *pIG = CWidgetManager::getInstance()->getParser()->createGroupInstance(LSP_SECTION_TEMPLATE, getId(), tempVec); pIG->setParent (this); addGroup (pIG); diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_phrase.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_phrase.cpp index e885f3b41..b7bb83698 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_phrase.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text_phrase.cpp @@ -142,7 +142,7 @@ CInterfaceGroup *CDBGroupListSheetTextPhrase::createSectionGroup(const std::str tempVec[0].first="id"; tempVec[0].second= igName; // make parent to the list, not me - CInterfaceGroup *pIG = pIM->getParser()->createGroupInstance(LSP_SECTION_TEMPLATE, _List->getId(), tempVec); + CInterfaceGroup *pIG = CWidgetManager::getInstance()->getParser()->createGroupInstance(LSP_SECTION_TEMPLATE, _List->getId(), tempVec); pIG->setParent (_List); _List->addGroup (pIG); diff --git a/code/ryzom/client/src/interface_v3/flying_text_manager.cpp b/code/ryzom/client/src/interface_v3/flying_text_manager.cpp index 3b9eafeab..0027a4410 100644 --- a/code/ryzom/client/src/interface_v3/flying_text_manager.cpp +++ b/code/ryzom/client/src/interface_v3/flying_text_manager.cpp @@ -64,7 +64,7 @@ void CFlyingTextManager::initInGame() string id = "in_scene_flying_text_"+toString (i); std::vector > templateParams; templateParams.push_back (std::pair("id", id)); - CInterfaceGroup *groupInfo = pIM->getParser()->createGroupInstance ("in_scene_flying_text", + CInterfaceGroup *groupInfo = CWidgetManager::getInstance()->getParser()->createGroupInstance ("in_scene_flying_text", "ui:interface", templateParams); // if ok if(groupInfo) @@ -92,7 +92,7 @@ void CFlyingTextManager::initInGame() } // misc - fromString(pIM->getParser()->getDefine("in_scene_flying_char_offsetx"), _CharacterWindowOffsetX); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("in_scene_flying_char_offsetx"), _CharacterWindowOffsetX); } // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp index 4c5712ea4..5aa83fc14 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp @@ -56,10 +56,11 @@ void contextHelp (const std::string &name) { string defineTarget = name+"_"+toString(index)+"_target"; string defineUrl = name+"_"+toString(index)+"_url"; - if (pIM->getParser()->isDefineExist(defineTarget) && pIM->getParser()->isDefineExist(defineUrl)) + if ( CWidgetManager::getInstance()->getParser()->isDefineExist(defineTarget) && + CWidgetManager::getInstance()->getParser()->isDefineExist(defineUrl)) { - string target = pIM->getParser()->getDefine(defineTarget); - string url = pIM->getParser()->getDefine(defineUrl); + string target = CWidgetManager::getInstance()->getParser()->getDefine(defineTarget); + string url = CWidgetManager::getInstance()->getParser()->getDefine(defineUrl); CInterfaceElement *elementTarget = CWidgetManager::getInstance()->getElementFromId(target); if (elementTarget && elementTarget->getActive()) @@ -176,12 +177,12 @@ void CGroupInSceneBubbleManager::alignMessagePopup (vector &rList, bool sint32 offsetY; if (bCenter) { - fromString(pIM->getParser()->getDefine("popup_pos_y_center"), offsetY); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("popup_pos_y_center"), offsetY); offsetY = pRoot->getHReal() - offsetY; offsetY -= rList[i].Group->getH(); } else - fromString(pIM->getParser()->getDefine("popup_pos_y"), offsetY); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("popup_pos_y"), offsetY); rList[i].Group->setY(offsetY); rList[i].Group->invalidateCoords(); @@ -228,7 +229,7 @@ void CGroupInSceneBubbleManager::init () std::vector > templateParams; templateParams.push_back (std::pair("id", id)); - CInterfaceGroup *group = pIM->getParser()->createGroupInstance ("3dbulle_L", + CInterfaceGroup *group = CWidgetManager::getInstance()->getParser()->createGroupInstance ("3dbulle_L", "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { @@ -508,7 +509,7 @@ void CGroupInSceneBubbleManager::addSkillPopup (uint skillId, sint delta, uint t templateParams.push_back (std::pair("skillid", toString(skillId))); templateParams.push_back (std::pair("delta", toString(delta))); - CInterfaceGroup *group = pIM->getParser()->createGroupInstance ("skill_popup", + CInterfaceGroup *group = CWidgetManager::getInstance()->getParser()->createGroupInstance ("skill_popup", "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { @@ -574,7 +575,7 @@ void CGroupInSceneBubbleManager::addMessagePopup (const ucstring &message, CRGBA std::vector > templateParams; templateParams.push_back (std::pair("id", id)); - CInterfaceGroup *group = pIM->getParser()->createGroupInstance ("message_popup", + CInterfaceGroup *group = CWidgetManager::getInstance()->getParser()->createGroupInstance ("message_popup", "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { @@ -623,7 +624,7 @@ void CGroupInSceneBubbleManager::addMessagePopupCenter (const ucstring &message, std::vector > templateParams; templateParams.push_back (std::pair("id", id)); - CInterfaceGroup *group = pIM->getParser()->createGroupInstance ("message_popup_center", + CInterfaceGroup *group = CWidgetManager::getInstance()->getParser()->createGroupInstance ("message_popup_center", "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { @@ -695,7 +696,7 @@ CGroupInSceneBubbleManager::CPopupContext *CGroupInSceneBubbleManager::buildCont std::vector > templateParams; templateParams.push_back (std::pair("id", id)); - CInterfaceGroup *group = pIM->getParser()->createGroupInstance (templateName+v+h, + CInterfaceGroup *group = CWidgetManager::getInstance()->getParser()->createGroupInstance (templateName+v+h, "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { @@ -896,7 +897,7 @@ void CGroupInSceneBubbleManager::dynChatOpen (uint32 nBotUID, uint32 nBotName, c std::vector > templateParams; templateParams.push_back (std::pair("id", id)); - CInterfaceGroup *group = pIM->getParser()->createGroupInstance ("dyn_3dbulle_L", "ui:interface", templateParams); + CInterfaceGroup *group = CWidgetManager::getInstance()->getParser()->createGroupInstance ("dyn_3dbulle_L", "ui:interface", templateParams); if (group == NULL) { nlwarning("cannot create dyn_3dbulle_L"); @@ -1009,7 +1010,7 @@ void CGroupInSceneBubbleManager::webIgChatOpen (uint32 nBotUID, string text, con std::vector > templateParams; templateParams.push_back (std::pair("id", id)); - CInterfaceGroup *group = pIM->getParser()->createGroupInstance ("webig_3dbulle_L", "ui:interface", templateParams); + CInterfaceGroup *group = CWidgetManager::getInstance()->getParser()->createGroupInstance ("webig_3dbulle_L", "ui:interface", templateParams); if (group == NULL) { nlwarning("cannot create webig_3dbulle_L"); diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp index db31f0484..5fd766fc5 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp @@ -282,10 +282,10 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity) // Some constants sint barHeight, barSpace, textH; - fromString(pIM->getParser()->getDefine("in_scene_user_info_bar_h"), barHeight); - fromString(pIM->getParser()->getDefine("in_scene_user_info_bar_space"), barSpace); - fromString(pIM->getParser()->getDefine("in_scene_user_info_text_h"), textH); - fromString(pIM->getParser()->getDefine("in_scene_user_bar_length"), CGroupInSceneUserInfo::_BatLength); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("in_scene_user_info_bar_h"), barHeight); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("in_scene_user_info_bar_space"), barSpace); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("in_scene_user_info_text_h"), textH); + fromString(CWidgetManager::getInstance()->getParser()->getDefine("in_scene_user_bar_length"), CGroupInSceneUserInfo::_BatLength); // Build the bars uint barCount = 0; @@ -1175,7 +1175,7 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::newGroupInScene(const std::string { std::vector > templateParams; templateParams.push_back (std::pair("id", id)); - groupInfo = CInterfaceManager::getInstance()->getParser()->createGroupInstance ( templateName, + groupInfo = CWidgetManager::getInstance()->getParser()->createGroupInstance ( templateName, "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); } diff --git a/code/ryzom/client/src/interface_v3/group_quick_help.cpp b/code/ryzom/client/src/interface_v3/group_quick_help.cpp index 4d452c379..f411a8c49 100644 --- a/code/ryzom/client/src/interface_v3/group_quick_help.cpp +++ b/code/ryzom/client/src/interface_v3/group_quick_help.cpp @@ -426,7 +426,7 @@ class CHandlerRunQuickHelp : public IActionHandler CInterfaceManager *pIM = CInterfaceManager::getInstance(); // Get the quick help radio buttons base id - string buttonId = pIM->getParser()->getDefine("quick_help_buttons"); + string buttonId = CWidgetManager::getInstance()->getParser()->getDefine("quick_help_buttons"); if (!buttonId.empty()) { // Get the button id diff --git a/code/ryzom/client/src/interface_v3/group_skills.cpp b/code/ryzom/client/src/interface_v3/group_skills.cpp index af39f00d5..1149e4d5f 100644 --- a/code/ryzom/client/src/interface_v3/group_skills.cpp +++ b/code/ryzom/client/src/interface_v3/group_skills.cpp @@ -373,7 +373,7 @@ void CGroupSkills::createAllTreeNodes() // create the template tempVec[0].first="id"; tempVec[0].second= pNode->Id; tempVec[1].first="skillid"; tempVec[1].second= NLMISC::toString(i); - CInterfaceGroup *pIG = pIM->getParser()->createGroupInstance(_TemplateSkill, getId() + ":" + WIN_TREE_LIST, tempVec); + CInterfaceGroup *pIG = CWidgetManager::getInstance()->getParser()->createGroupInstance(_TemplateSkill, getId() + ":" + WIN_TREE_LIST, tempVec); if (pIG == NULL) nlwarning("error"); // Set Skill Name diff --git a/code/ryzom/client/src/interface_v3/guild_manager.cpp b/code/ryzom/client/src/interface_v3/guild_manager.cpp index 907a7c12f..b4db964ae 100644 --- a/code/ryzom/client/src/interface_v3/guild_manager.cpp +++ b/code/ryzom/client/src/interface_v3/guild_manager.cpp @@ -817,7 +817,7 @@ class CAHGuildSheetOpen : public IActionHandler vector< pair > vParams; vParams.push_back(vector< pair >::value_type("id", templateId)); CInterfaceGroup *pLine = NULL; - pLine = pIM->getParser()->createGroupInstance (TEMPLATE_GUILD_MEMBER, LIST_GUILD_MEMBERS, vParams); + pLine = CWidgetManager::getInstance()->getParser()->createGroupInstance (TEMPLATE_GUILD_MEMBER, LIST_GUILD_MEMBERS, vParams); if (pLine == NULL) continue; // Set name diff --git a/code/ryzom/client/src/interface_v3/interface_config.cpp b/code/ryzom/client/src/interface_v3/interface_config.cpp index 74a2eb6b0..f43c18229 100644 --- a/code/ryzom/client/src/interface_v3/interface_config.cpp +++ b/code/ryzom/client/src/interface_v3/interface_config.cpp @@ -764,10 +764,10 @@ void CInterfaceConfig::streamToDataBase (NLMISC::IStream &f, uint32 uiDbSaveVers defVerId[i]='_'; } // check if exist - if(pIM->getParser()->isDefineExist(defVerId)) + if( CWidgetManager::getInstance()->getParser()->isDefineExist(defVerId)) { uint32 dbVer; - fromString(pIM->getParser()->getDefine(defVerId), dbVer); + fromString(CWidgetManager::getInstance()->getParser()->getDefine(defVerId), dbVer); // if the version in the file is older than the version this db want, abort read if(uiDbSaveVersiongetParser()->getDefine( RM_FABER_TYPE::toIconDefineString(RM_FABER_TYPE::TRMFType(args[0].getInteger())) )); + result.setString(CWidgetManager::getInstance()->getParser()->getDefine( RM_FABER_TYPE::toIconDefineString(RM_FABER_TYPE::TRMFType(args[0].getInteger())) )); return true; } diff --git a/code/ryzom/client/src/interface_v3/interface_expr_user_fct_items.cpp b/code/ryzom/client/src/interface_v3/interface_expr_user_fct_items.cpp index a668c17b0..794ece83f 100644 --- a/code/ryzom/client/src/interface_v3/interface_expr_user_fct_items.cpp +++ b/code/ryzom/client/src/interface_v3/interface_expr_user_fct_items.cpp @@ -541,11 +541,11 @@ static DECLARE_INTERFACE_USER_FCT(isRoomLeftFor) CInterfaceManager *im = CInterfaceManager::getInstance(); // see if there is room in the bags // get the number of bags - std::string nbBagPath = im->getParser()->getDefine("bag_nb"); + std::string nbBagPath = CWidgetManager::getInstance()->getParser()->getDefine("bag_nb"); CCDBNodeLeaf *prop = NLGUI::CDBManager::getInstance()->getDbProp(nbBagPath); if (!prop) return false; uint nbItemInBags = 8 * (uint) prop->getValue32(); // there are 8 item per bag - std::string bagsPath = im->getParser()->getDefine("bag"); + std::string bagsPath = CWidgetManager::getInstance()->getParser()->getDefine("bag"); if (bagsPath.empty()) return false; uint k = 0; for(k = 0; k < nbItemInBags; ++k) @@ -581,7 +581,7 @@ static DECLARE_INTERFACE_USER_FCT(isRoomLeftFor) for(k = 0; k < numArmorSlots; ++k) { - std::string dbPath = im->getParser()->getDefine(armourInfos[k].DefineName); + std::string dbPath = CWidgetManager::getInstance()->getParser()->getDefine(armourInfos[k].DefineName); if (dbPath.empty()) return false; CCDBNodeLeaf *armorProp = NLGUI::CDBManager::getInstance()->getDbProp(dbPath + ":SHEET"); if (!armorProp) return false; @@ -609,7 +609,7 @@ static DECLARE_INTERFACE_USER_FCT(getSelectionGroupNameFromId) if (args.size() != 1) return false; if (!args[0].toInteger()) return false; CInterfaceManager *im = CInterfaceManager::getInstance(); - CCtrlSheetSelection &css = im->getParser()->getCtrlSheetSelection(); + CCtrlSheetSelection &css = CWidgetManager::getInstance()->getParser()->getCtrlSheetSelection(); CSheetSelectionGroup *csg = css.getGroup((uint) args[0].getInteger()); if (csg) result.setString(csg->getName()); else result.setString(""); @@ -625,7 +625,7 @@ static DECLARE_INTERFACE_USER_FCT(getSelectionGroupIdFromName) if (args.size() != 1) return false; if (!args[0].toString()) return false; CInterfaceManager *im = CInterfaceManager::getInstance(); - CCtrlSheetSelection &css = im->getParser()->getCtrlSheetSelection(); + CCtrlSheetSelection &css = CWidgetManager::getInstance()->getParser()->getCtrlSheetSelection(); result.setInteger(css.getGroupIndex(args[0].getString().c_str())); return true; } diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index 88e6b3eea..f537cc383 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -445,7 +445,11 @@ CInterfaceManager* CInterfaceManager::getInstance() // ------------------------------------------------------------------------------------------------ CInterfaceManager::CInterfaceManager() { - parser = new CInterfaceParser(); + CWidgetManager::getInstance()->registerNewScreenSizeHandler( new CDesktopUpdater() ); + CWidgetManager::getInstance()->registerOnWidgetsDrawnHandler( new CDrawDraggedSheet() ); + + CInterfaceParser *parser = dynamic_cast< CInterfaceParser* >( CWidgetManager::getInstance()->getParser() ); + parser->setSetupOptionsCallback( this ); parser->addModule( "scene3d", new CIF3DSceneParser() ); parser->addModule( "ddx", new CIFDDXParser() ); @@ -453,12 +457,8 @@ CInterfaceManager::CInterfaceManager() parser->addModule( "command", new CCommandParser() ); parser->addModule( "key", new CKeyParser() ); parser->addModule( "macro", new CMacroParser() ); - CWidgetManager::getInstance()->registerNewScreenSizeHandler( new CDesktopUpdater() ); - CWidgetManager::getInstance()->registerOnWidgetsDrawnHandler( new CDrawDraggedSheet() ); - parser->setCacheUIParsing( ClientCfg.CacheUIParsing ); - CWidgetManager::parser = parser; CViewRenderer::setDriver( Driver ); CViewRenderer::setTextContext( TextContext ); CViewRenderer::hwCursorScale = ClientCfg.HardwareCursorScale; @@ -556,8 +556,6 @@ CInterfaceManager::~CInterfaceManager() interfaceLinkUpdater = NULL; */ _Instance = NULL; - delete parser; - parser = NULL; } // ------------------------------------------------------------------------------------------------ @@ -620,6 +618,7 @@ void CInterfaceManager::destroy () void CInterfaceManager::initLUA() { + CInterfaceParser *parser = dynamic_cast< CInterfaceParser* >( CWidgetManager::getInstance()->getParser() ); if( parser->isLuaInitialized() ) return; @@ -684,6 +683,7 @@ void CInterfaceManager::initLogin() // ------------------------------------------------------------------------------------------------ void CInterfaceManager::uninitLogin() { + CInterfaceParser *parser = dynamic_cast< CInterfaceParser* >( CWidgetManager::getInstance()->getParser() ); CWidgetManager::getInstance()->activateMasterGroup ("ui:login", false); @@ -806,6 +806,8 @@ void CInterfaceManager::uninitOutGame() initStart = ryzomGetLocalTime (); CWidgetManager::getInstance()->activateMasterGroup ("ui:outgame", false); + + CInterfaceParser *parser = dynamic_cast< CInterfaceParser* >( CWidgetManager::getInstance()->getParser() ); //nlinfo ("%d seconds for activateMasterGroup", (uint32)(ryzomGetLocalTime ()-initStart)/1000); initStart = ryzomGetLocalTime (); parser->removeAll(); @@ -1085,7 +1087,7 @@ void CInterfaceManager::configureQuitDialogBox() eltQuit = quitDlg->getElement(quitDialogStr+":ryzom"); eltQuitNow = quitDlg->getElement(quitDialogStr+":ryzom_now"); sint buttonDeltaY; - fromString( parser->getDefine("quit_button_delta_y"), buttonDeltaY); + fromString( CWidgetManager::getInstance()->getParser()->getDefine("quit_button_delta_y"), buttonDeltaY); extern R2::TUserRole UserRoleInSession; bool sessionOwner = (R2::getEditor().getMode() != R2::CEditor::NotInitialized && R2::getEditor().getDMC().getEditionModule().isSessionOwner()); @@ -1342,6 +1344,9 @@ void CInterfaceManager::uninitInGame1 () // Remove all interface objects (containers, groups, variables, defines, ...) CWidgetManager::getInstance()->activateMasterGroup ("ui:interface", false); + + CInterfaceParser *parser = dynamic_cast< CInterfaceParser* >( CWidgetManager::getInstance()->getParser() ); + parser->removeAll(); reset(); CInterfaceLink::removeAllLinks(); @@ -1579,7 +1584,7 @@ bool CInterfaceManager::parseInterface (const std::vector &xmlFileN _DB_UI_DUMMY_PREREQUISIT_VALID->setValueBool(true); _DB_UI_DUMMY_FACTION_TYPE->setValue64(0); - return parser->parseInterface (xmlFileNames, reload, isFilename); + return CWidgetManager::getInstance()->getParser()->parseInterface (xmlFileNames, reload, isFilename); } // ------------------------------------------------------------------------------------------------ @@ -1899,7 +1904,7 @@ bool CInterfaceManager::saveConfig (const string &filename) // write UI_DB_SAVE_VERSION uint32 uiDbSaveVersion; - fromString( parser->getDefine("UI_DB_SAVE_VERSION"), uiDbSaveVersion); + fromString( CWidgetManager::getInstance()->getParser()->getDefine("UI_DB_SAVE_VERSION"), uiDbSaveVersion); f.serial(uiDbSaveVersion); // write database @@ -2219,7 +2224,7 @@ bool CInterfaceManager::getCurrentValidMessageBoxOnOk(string &ahOnOk, const std: { // Ok, get the current procedure OnOk action string dummyParams; - if( parser->getProcedureAction("proc_valid_message_box_ok", 1, ahOnOk, dummyParams)) + if( CWidgetManager::getInstance()->getParser()->getProcedureAction("proc_valid_message_box_ok", 1, ahOnOk, dummyParams)) return true; } diff --git a/code/ryzom/client/src/interface_v3/interface_manager.h b/code/ryzom/client/src/interface_v3/interface_manager.h index 4f21e7d07..5d5d53959 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.h +++ b/code/ryzom/client/src/interface_v3/interface_manager.h @@ -643,10 +643,6 @@ private: void messageBoxInternal(const std::string &msgBoxGroup, const ucstring &text, const std::string &masterGroup, TCaseMode caseMode); CInterfaceLink::CInterfaceLinkUpdater *interfaceLinkUpdater; - NLGUI::CInterfaceParser *parser; - -public: - NLGUI::CInterfaceParser* getParser() const{ return parser; } }; #endif // NL_INTERFACE_MANAGER_H diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index 1e2e1d465..1ac50148e 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -607,7 +607,7 @@ int CLuaIHMRyzom::formatUI(CLuaState &ls) // *** format with % CInterfaceManager *pIM= CInterfaceManager::getInstance(); std::string newPropVal, defError; - if(!pIM->getParser()->solveDefine(propVal, newPropVal, defError)) + if( !CWidgetManager::getInstance()->getParser()->solveDefine(propVal, newPropVal, defError)) { throw ELuaIHMException("formatUI(): Can't find define: '%s'", defError.c_str()); } @@ -1526,7 +1526,7 @@ int CLuaIHMRyzom::createGroupInstance(CLuaState &ls) templateParams.push_back(std::pair(it.nextKey().toString(), it.nextValue().toString())); // strange compilation bug here when I use std::make_pair ... :( } CInterfaceManager *im = CInterfaceManager::getInstance(); - CInterfaceGroup *result = im->getParser()->createGroupInstance(ls.toString(1), ls.toString(2), templateParams); + CInterfaceGroup *result = CWidgetManager::getInstance()->getParser()->createGroupInstance(ls.toString(1), ls.toString(2), templateParams); if (!result) { ls.pushNil(); @@ -1565,7 +1565,7 @@ int CLuaIHMRyzom::createRootGroupInstance(CLuaState &ls) templateParams.push_back(std::pair(it.nextKey().toString(), it.nextValue().toString())); // strange compilation bug here when I use std::make_pair ... :( } CInterfaceManager *im = CInterfaceManager::getInstance(); - CInterfaceGroup *result = im->getParser()->createGroupInstance(ls.toString(1), "ui:interface:"+string(ls.toString(2)), templateParams); + CInterfaceGroup *result = CWidgetManager::getInstance()->getParser()->createGroupInstance(ls.toString(1), "ui:interface:"+string(ls.toString(2)), templateParams); if (!result) { ls.pushNil(); @@ -1612,7 +1612,7 @@ int CLuaIHMRyzom::createUIElement(CLuaState &ls) templateParams.push_back(std::pair(it.nextKey().toString(), it.nextValue().toString())); // strange compilation bug here when I use std::make_pair ... :( } CInterfaceManager *im = CInterfaceManager::getInstance(); - CInterfaceElement *result = im->getParser()->createUIElement(ls.toString(1), ls.toString(2), templateParams); + CInterfaceElement *result = CWidgetManager::getInstance()->getParser()->createUIElement(ls.toString(1), ls.toString(2), templateParams); if (!result) { ls.pushNil(); @@ -1961,9 +1961,9 @@ std::string CLuaIHMRyzom::getDefine(const std::string &def) { //H_AUTO(Lua_CLuaIHM_getDefine) CInterfaceManager *pIM= CInterfaceManager::getInstance(); - if(ClientCfg.DisplayLuaDebugInfo && !pIM->getParser()->isDefineExist(def)) + if(ClientCfg.DisplayLuaDebugInfo && !CWidgetManager::getInstance()->getParser()->isDefineExist(def)) debugInfo(toString("getDefine(): '%s' not found", def.c_str())); - return pIM->getParser()->getDefine(def); + return CWidgetManager::getInstance()->getParser()->getDefine(def); } // *************************************************************************** @@ -2703,7 +2703,7 @@ sint32 CLuaIHMRyzom::getTargetLevel() if ( target->isPlayer() ) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CCDBNodeLeaf *pDbPlayerLevel = NLGUI::CDBManager::getInstance()->getDbProp( pIM->getParser()->getDefine("target_player_level") ); + CCDBNodeLeaf *pDbPlayerLevel = NLGUI::CDBManager::getInstance()->getDbProp( CWidgetManager::getInstance()->getParser()->getDefine("target_player_level") ); return pDbPlayerLevel ? pDbPlayerLevel->getValue32() : -1; } else @@ -2768,7 +2768,7 @@ sint32 CLuaIHMRyzom::getTargetForceRegion() if ( target->isPlayer() ) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CCDBNodeLeaf *pDbPlayerLevel = NLGUI::CDBManager::getInstance()->getDbProp( pIM->getParser()->getDefine("target_player_level") ); + CCDBNodeLeaf *pDbPlayerLevel = NLGUI::CDBManager::getInstance()->getDbProp( CWidgetManager::getInstance()->getParser()->getDefine("target_player_level") ); if (!pDbPlayerLevel) return -1; sint nLevel = pDbPlayerLevel->getValue32(); if ( nLevel < 250 ) @@ -2796,7 +2796,7 @@ sint32 CLuaIHMRyzom::getTargetLevelForce() if ( target->isPlayer() ) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CCDBNodeLeaf *pDbPlayerLevel = NLGUI::CDBManager::getInstance()->getDbProp( pIM->getParser()->getDefine("target_player_level") ); + CCDBNodeLeaf *pDbPlayerLevel = NLGUI::CDBManager::getInstance()->getDbProp( CWidgetManager::getInstance()->getParser()->getDefine("target_player_level") ); if (!pDbPlayerLevel) return -1; sint nLevel = pDbPlayerLevel->getValue32(); if ( nLevel < 250 ) diff --git a/code/ryzom/client/src/interface_v3/macrocmd_key.cpp b/code/ryzom/client/src/interface_v3/macrocmd_key.cpp index d6dd1bf0f..a3c4df1cc 100644 --- a/code/ryzom/client/src/interface_v3/macrocmd_key.cpp +++ b/code/ryzom/client/src/interface_v3/macrocmd_key.cpp @@ -89,7 +89,7 @@ void addKeyLine (CGroupList *pParent, const ucstring &keyName, const ucstring &s vParams.push_back(make_pair(string("id"), templateId)); vParams.push_back(make_pair(string("lineid"), toString(lineId))); CInterfaceGroup *pKeysLine = NULL; - pKeysLine = pIM->getParser()->createGroupInstance (TEMPLATE_KEYS_GROUP, pParent->getId(), vParams); + pKeysLine = CWidgetManager::getInstance()->getParser()->createGroupInstance (TEMPLATE_KEYS_GROUP, pParent->getId(), vParams); if (pKeysLine == NULL) return; // Put name @@ -424,7 +424,7 @@ void CModalContainerEditCmd::create(const std::string &name, bool bDefKey, bool vArgs.push_back(pair("db_disp_1p",DbComboDisp1P)); vArgs.push_back(pair("db_disp_2p",DbComboDisp2P)); - Win = dynamic_cast(pIM->getParser()->createGroupInstance(TEMPLATE_EDITCMD, "ui:interface", vArgs)); + Win = dynamic_cast( CWidgetManager::getInstance()->getParser()->createGroupInstance(TEMPLATE_EDITCMD, "ui:interface", vArgs)); if (Win == NULL) { nlwarning ("cannot create %s", name.c_str()); diff --git a/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp b/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp index 1e3bc92de..5ed189c75 100644 --- a/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp +++ b/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp @@ -802,7 +802,7 @@ void addCommandLine (CGroupList *pParent, uint cmdNb, const ucstring &cmdName) vector< pair > vParams; vParams.push_back(pair("id", "c"+toString(cmdNb))); - CInterfaceGroup *pNewCmd = pIM->getParser()->createGroupInstance(TEMPLATE_NEWMACRO_COMMAND, pParent->getId(), vParams); + CInterfaceGroup *pNewCmd = CWidgetManager::getInstance()->getParser()->createGroupInstance(TEMPLATE_NEWMACRO_COMMAND, pParent->getId(), vParams); if (pNewCmd == NULL) return; CViewText *pVT = dynamic_cast(pNewCmd->getView(TEMPLATE_NEWMACRO_COMMAND_TEXT)); @@ -969,7 +969,7 @@ void addMacroLine (CGroupList *pParent, uint macNb, const CMacroCmd ¯o) vector< pair > vParams; vParams.push_back(pair("id", "m"+toString(macNb))); - CInterfaceGroup *pNewMacro = pIM->getParser()->createGroupInstance(TEMPLATE_MACRO_ELT, pParent->getId(), vParams); + CInterfaceGroup *pNewMacro = CWidgetManager::getInstance()->getParser()->createGroupInstance(TEMPLATE_MACRO_ELT, pParent->getId(), vParams); if (pNewMacro == NULL) return; CViewText *pVT = dynamic_cast(pNewMacro->getView(TEMPLATE_MACRO_ELT_TEXT)); diff --git a/code/ryzom/client/src/interface_v3/obs_huge_list.cpp b/code/ryzom/client/src/interface_v3/obs_huge_list.cpp index 97569c4f1..9854887ff 100644 --- a/code/ryzom/client/src/interface_v3/obs_huge_list.cpp +++ b/code/ryzom/client/src/interface_v3/obs_huge_list.cpp @@ -674,10 +674,10 @@ void CHugeListObs::updateUIItemPage(uint index) // If price of current selected item has changed, repercute it if (sheet == CDBCtrlSheet::getCurrSelection()) { - string ls = im->getParser()->getDefine("item_price_1"); - string ms = im->getParser()->getDefine("item_price_2"); - string bs = im->getParser()->getDefine("item_price_3"); - string vbs = im->getParser()->getDefine("item_price_4"); + string ls = CWidgetManager::getInstance()->getParser()->getDefine("item_price_1"); + string ms = CWidgetManager::getInstance()->getParser()->getDefine("item_price_2"); + string bs = CWidgetManager::getInstance()->getParser()->getDefine("item_price_3"); + string vbs = CWidgetManager::getInstance()->getParser()->getDefine("item_price_4"); setPriceInDB(currItem.Price, ls, ms, bs, vbs); } } diff --git a/code/ryzom/client/src/interface_v3/people_interraction.cpp b/code/ryzom/client/src/interface_v3/people_interraction.cpp index 568589ab7..9e0e9afca 100644 --- a/code/ryzom/client/src/interface_v3/people_interraction.cpp +++ b/code/ryzom/client/src/interface_v3/people_interraction.cpp @@ -1029,7 +1029,7 @@ class CHandlerChatGroupFilter : public IActionHandler CCtrlTabButton *pTabButton= dynamic_cast(pCaller); if(pTabButton) { - CRGBA stdColor= CRGBA::stringToRGBA(pIM->getParser()->getDefine("chat_group_tab_color_normal").c_str()); + CRGBA stdColor= CRGBA::stringToRGBA(CWidgetManager::getInstance()->getParser()->getDefine("chat_group_tab_color_normal").c_str()); pTabButton->setTextColorNormal(stdColor); } } @@ -2815,7 +2815,7 @@ static CInterfaceGroup *createMenuCheckBox(const std::string &onclickL, const st params[1].second = paramsL; CInterfaceManager *im = CInterfaceManager::getInstance(); - CInterfaceGroup *ig = im->getParser()->createGroupInstance("menu_checkbox", "", params, sizeof(params) / sizeof(params[0])); + CInterfaceGroup *ig = CWidgetManager::getInstance()->getParser()->createGroupInstance("menu_checkbox", "", params, sizeof(params) / sizeof(params[0])); if (!ig) return NULL; CCtrlBaseButton *cb = dynamic_cast(ig->getCtrl("b")); if (!cb) return NULL; diff --git a/code/ryzom/client/src/interface_v3/people_list.cpp b/code/ryzom/client/src/interface_v3/people_list.cpp index 19c277502..65e74ebe8 100644 --- a/code/ryzom/client/src/interface_v3/people_list.cpp +++ b/code/ryzom/client/src/interface_v3/people_list.cpp @@ -86,7 +86,7 @@ bool CPeopleList::create(const CPeopleListDesc &desc, const CChatWindowDesc *cha { baseId = fatherContainer->getId() + ":list"; } - CInterfaceGroup *mainIg = im->getParser()->createGroupInstance(desc.BaseContainerTemplateName, baseId, baseContainerParams); + CInterfaceGroup *mainIg = CWidgetManager::getInstance()->getParser()->createGroupInstance(desc.BaseContainerTemplateName, baseId, baseContainerParams); // must attach group to hierarchy before we can use it CGroupContainer *gc = dynamic_cast(mainIg); if (!gc) return false; @@ -361,7 +361,7 @@ sint CPeopleList::addPeople(const ucstring &name, uint teamMateIndex /*= 0*/) } CInterfaceManager *im = CInterfaceManager::getInstance(); - CInterfaceGroup *group = im->getParser()->createGroupInstance(templateName, "ui:interface", properties, false); + CInterfaceGroup *group = CWidgetManager::getInstance()->getParser()->createGroupInstance(templateName, "ui:interface", properties, false); if (!group) return -1; CGroupContainer *gc = dynamic_cast(group); if (!gc) diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index 2f02740fe..e931712f4 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -210,7 +210,7 @@ void createOptionalCatUI() if (i>0) params.push_back(pair("posref", "BL TL")); - CInterfaceGroup *pNewLine = pIM->getParser()->createGroupInstance("t_cat", GROUP_LIST_CAT, params); + CInterfaceGroup *pNewLine = CWidgetManager::getInstance()->getParser()->createGroupInstance("t_cat", GROUP_LIST_CAT, params); if (pNewLine != NULL) { CViewText *pVT = dynamic_cast(pNewLine->getView("name")); @@ -1086,7 +1086,7 @@ void initShardDisplay() if (i>0) params.push_back(pair("posref", "BL TL")); - CInterfaceGroup *pNewLine =pIM->getParser()->createGroupInstance("t_shard", GROUP_LIST_SHARD, params); + CInterfaceGroup *pNewLine = CWidgetManager::getInstance()->getParser()->createGroupInstance("t_shard", GROUP_LIST_SHARD, params); if (pNewLine != NULL) { CViewText *pVT = dynamic_cast(pNewLine->getView("name")); diff --git a/code/ryzom/client/src/misc.cpp b/code/ryzom/client/src/misc.cpp index 406278da2..365ce11d3 100644 --- a/code/ryzom/client/src/misc.cpp +++ b/code/ryzom/client/src/misc.cpp @@ -808,10 +808,10 @@ void getSeedsFromDB(CSeeds &dest) CInterfaceManager *im =CInterfaceManager::getInstance(); nlctassert(sizeof(CSeeds::TUInt) == 4); // excpect that the number of each seed type is encoded on 32 bits // if this assert at compile, change the following code - string ls = im->getParser()->getDefine("money_1"); - string ms = im->getParser()->getDefine("money_2"); - string bs = im->getParser()->getDefine("money_3"); - string vbs = im->getParser()->getDefine("money_4"); + string ls = CWidgetManager::getInstance()->getParser()->getDefine("money_1"); + string ms = CWidgetManager::getInstance()->getParser()->getDefine("money_2"); + string bs = CWidgetManager::getInstance()->getParser()->getDefine("money_3"); + string vbs = CWidgetManager::getInstance()->getParser()->getDefine("money_4"); dest = CSeeds(NLGUI::CDBManager::getInstance()->getDbProp(ls)->getValue32(), NLGUI::CDBManager::getInstance()->getDbProp(ms)->getValue32(), diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index d543d2ffc..c0f4097b1 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -3335,7 +3335,7 @@ private: pGC->setActive(true); // must set the text by hand - CViewText *vt= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("server_message_box_content_view_text"))); + CViewText *vt= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("server_message_box_content_view_text"))); if(vt) vt->setTextFormatTaged(contentStr); diff --git a/code/ryzom/client/src/r2/displayer_visual.cpp b/code/ryzom/client/src/r2/displayer_visual.cpp index 48009d2a5..12e5d1983 100644 --- a/code/ryzom/client/src/r2/displayer_visual.cpp +++ b/code/ryzom/client/src/r2/displayer_visual.cpp @@ -428,7 +428,7 @@ void CDisplayerVisual::onPostRender() CInterfaceManager *pIM = CInterfaceManager::getInstance(); const char *iconTemplateName = "r2ed_bad_pos_icon"; // if the in scene 'stop' window wasn't created, then create it now - CInterfaceGroup *group = pIM->getParser()->createGroupInstance (iconTemplateName , "ui:interface", NULL, 0); + CInterfaceGroup *group = CWidgetManager::getInstance()->getParser()->createGroupInstance (iconTemplateName , "ui:interface", NULL, 0); if (group) { _IconInScene = dynamic_cast(group); diff --git a/code/ryzom/client/src/r2/editor.cpp b/code/ryzom/client/src/r2/editor.cpp index 248175aa4..c900f006e 100644 --- a/code/ryzom/client/src/r2/editor.cpp +++ b/code/ryzom/client/src/r2/editor.cpp @@ -2733,7 +2733,7 @@ uint CEditor::getMaxNumPlotItems() { //H_AUTO(R2_CEditor_getMaxNumPlotItems) uint ret; - fromString(getUI().getParser()->getDefine("r2ed_max_num_plot_item_sheets"), ret); + fromString( CWidgetManager::getInstance()->getParser()->getDefine("r2ed_max_num_plot_item_sheets"), ret); return ret; } diff --git a/code/ryzom/client/src/release.cpp b/code/ryzom/client/src/release.cpp index c94e9b95a..1a69276af 100644 --- a/code/ryzom/client/src/release.cpp +++ b/code/ryzom/client/src/release.cpp @@ -241,7 +241,7 @@ void releaseMainLoopReselect() ActionsContext.removeAllCombos(); EditActions.releaseAllKeyNoRunning(); Actions.releaseAllKeyNoRunning(); - pIM->getParser()->removeAllTemplates(); + CWidgetManager::getInstance()->getParser()->removeAllTemplates(); CWidgetManager::getInstance()->setCaptureKeyboard(NULL); CWidgetManager::getInstance()->setCapturePointerLeft(NULL); CWidgetManager::getInstance()->setCapturePointerRight(NULL);