From 3e5137810b4a6c125d18489322d1aa0a52c3b3ad Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 12 Jul 2012 21:39:51 +0200 Subject: [PATCH] CHANGED: #1474 CInterfaceManager is no longer a subclass of CInterfaceParser, instead CInterfaceParser is a component of CInterfaceManager. --- code/nel/include/nel/gui/interface_parser.h | 11 +++- code/nel/src/gui/interface_parser.cpp | 13 ++++ 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 | 24 +++---- .../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 | 54 ++++++++-------- .../src/interface_v3/interface_manager.h | 5 +- .../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 +- 41 files changed, 215 insertions(+), 192 deletions(-) diff --git a/code/nel/include/nel/gui/interface_parser.h b/code/nel/include/nel/gui/interface_parser.h index d98c2fd20..92e73775f 100644 --- a/code/nel/include/nel/gui/interface_parser.h +++ b/code/nel/include/nel/gui/interface_parser.h @@ -87,6 +87,12 @@ namespace NLGUI uint parsingStage; }; + class ISetupOptionCallbackClass + { + public: + virtual void setupOptions() = 0; + }; + CInterfaceParser(); virtual ~CInterfaceParser(); @@ -136,7 +142,7 @@ namespace NLGUI bool solveDefine(const std::string &propVal, std::string &newPropVal, std::string &defError); // Called after template & options parsing - virtual void setupOptions() { } + void setupOptions(); /** * Initializer @@ -305,6 +311,7 @@ namespace NLGUI bool cacheUIParsing; bool luaInitialized; + ISetupOptionCallbackClass *setupCallback; public: void initLUA(); @@ -316,6 +323,8 @@ namespace NLGUI /// Reload all LUA scripts inserted through void reloadAllLuaFileScripts(); + + void setSetupOptionsCallback( ISetupOptionCallbackClass *cb ){ setupCallback = cb; } }; } diff --git a/code/nel/src/gui/interface_parser.cpp b/code/nel/src/gui/interface_parser.cpp index 0cb5d2d47..035987832 100644 --- a/code/nel/src/gui/interface_parser.cpp +++ b/code/nel/src/gui/interface_parser.cpp @@ -200,11 +200,18 @@ namespace NLGUI { luaInitialized = false; cacheUIParsing = false; + setupCallback = NULL; } CInterfaceParser::~CInterfaceParser() { + _ParentPositionsMap.clear(); + _ParentSizesMap.clear(); + _ParentSizesMaxMap.clear(); + _LuaClassAssociation.clear(); + _Templates.clear(); removeAllModules(); + setupCallback = NULL; } /** Convert a string into a memstream */ @@ -1806,6 +1813,12 @@ namespace NLGUI return true; } + void CInterfaceParser::setupOptions() + { + if( setupCallback != NULL ) + setupCallback->setupOptions(); + } + // ---------------------------------------------------------------------------- bool CInterfaceParser::initCoordsAndLuaScript() { diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index 993fb0936..d0ad1eb54 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->reloadAllLuaFileScripts(); + pIM->getParser()->reloadAllLuaFileScripts(); return true; } else diff --git a/code/ryzom/client/src/connection.cpp b/code/ryzom/client/src/connection.cpp index 551488822..45edf93d5 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->getDefine("screen_connecting"), nScreenConnecting); - fromString(pIM->getDefine("screen_intro"), nScreenIntro); - fromString(pIM->getDefine("screen_crashing"), nScreenServerCrashed); + fromString(pIM->getParser()->getDefine("screen_connecting"), nScreenConnecting); + fromString(pIM->getParser()->getDefine("screen_intro"), nScreenIntro); + fromString(pIM->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->reloadAllLuaFileScripts(); + pIM->getParser()->reloadAllLuaFileScripts(); } #endif @@ -2136,7 +2136,7 @@ public: if (i>0) params.push_back(pair("posref", "BL TL")); - CInterfaceGroup *pNewLine =pIM->createGroupInstance("t_mainland", GROUP_LIST_MAINLAND, params); + CInterfaceGroup *pNewLine =pIM->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->createGroupInstance(templateName, GROUP_LIST_KEYSET, params); + return pIM->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->createGroupInstance("label_toggle_button", shardList->getId(), params); + CInterfaceGroup *toggleGr =pIM->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 0704ada7c..c212684ef 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->getDefine("ui_set_active")); - CCDBNodeLeaf *pNLread = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getDefine("set_nb")); + CCDBNodeLeaf *pNLwrite = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getParser()->getDefine("ui_set_active")); + CCDBNodeLeaf *pNLread = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getParser()->getDefine("set_nb")); sint32 nNbSheath = (sint32)pNLread->getValue64(); if (nNbSheath == 0) return; - pNLread = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getDefine("set_active")); + pNLread = NLGUI::CDBManager::getInstance()->getDbProp(pIM->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->getDefine("set_base") + ":" + NLMISC::toString(nSheathToTest) + ":" + pIM->getDefine("set_r") + ":SHEET"; + sPath = pIM->getParser()->getDefine("set_base") + ":" + NLMISC::toString(nSheathToTest) + ":" + pIM->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->getCtrlSheetSelection(); + const CCtrlSheetSelection &css = im->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->getDefine("target_uid") ); + CCDBNodeLeaf *pDbTargetUid = NLGUI::CDBManager::getInstance()->getDbProp( pIM->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->getDefine("target_player_level") ); + CCDBNodeLeaf *pDbPlayerLevel = NLGUI::CDBManager::getInstance()->getDbProp( pIM->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->getDefine("region_force_"+toString(nForceRegion)).c_str()); + CRGBA col = CInterfaceElement::convertColor(pIM->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->getDefine("force_level_"+toString(nLevelForce)); + string sTexture = pIM->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->getDefine("mode_min_info"), nModeMinInf); - fromString(pIM->getDefine("mode_max_info"), nModeMaxInf); - fromString(pIM->getDefine("mode_min_lab"), nModeMinLab); - fromString(pIM->getDefine("mode_max_lab"), nModeMaxLab); - fromString(pIM->getDefine("mode_min_keys"), nModeMinKey); - fromString(pIM->getDefine("mode_max_keys"), 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); sint32 nMode = 0; if ((nNewMode >= nModeMinInf) && (nNewMode <= nModeMaxInf)) @@ -2275,14 +2275,14 @@ class CAHUpdateCurrentMode : public IActionHandler sint32 tmpMode; // Is NewMode entry active ? - fromString(pIM->getDefine("mode_magic"), tmpMode); + fromString(pIM->getParser()->getDefine("mode_magic"), tmpMode); if (nNewMode == tmpMode) if ((nIntFlags & (1<getDefine("mode_combat"), tmpMode); + fromString(pIM->getParser()->getDefine("mode_combat"), tmpMode); if (nNewMode == tmpMode) if ((nIntFlags & (1<getDefine("mode_faber_create"), tmpMode); + fromString(pIM->getParser()->getDefine("mode_faber_create"), tmpMode); if (nNewMode == tmpMode) if ((nIntFlags & (1<getDefine("mode_faber_repair"), tmpMode); + fromString(pIM->getParser()->getDefine("mode_faber_repair"), tmpMode); if (nNewMode == tmpMode) if ((nIntFlags & (1<getDefine("mode_faber_refine"), tmpMode); + fromString(pIM->getParser()->getDefine("mode_faber_refine"), tmpMode); if (nNewMode == tmpMode) if ((nIntFlags & (1<getDefine("mode_commerce"), tmpMode); + fromString(pIM->getParser()->getDefine("mode_commerce"), tmpMode); if (nNewMode == tmpMode) if ((nIntFlags & (1<getDefine("mode_macros"), tmpMode); + fromString(pIM->getParser()->getDefine("mode_macros"), tmpMode); if (nNewMode == tmpMode) bFound = true; // Not in DB !!! } if (!bFound) { - fromString(pIM->getDefine("mode_special_labo"), tmpMode); + fromString(pIM->getParser()->getDefine("mode_special_labo"), tmpMode); if (nNewMode == tmpMode) if ((nIntFlags & (1<getDefine("ipj_nb_mission"), nNbMission); - fromString(pIM->getDefine("ipj_nb_group_mission"), nNbGroupMission); + fromString(pIM->getParser()->getDefine("ipj_nb_mission"), nNbMission); + fromString(pIM->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->getDefine("ipj_nb_mission"), nNbMission); - fromString(pIM->getDefine("ipj_nb_group_mission"), nNbGroupMission); + fromString(pIM->getParser()->getDefine("ipj_nb_mission"), nNbMission); + fromString(pIM->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->getDefine("ipj_nb_mission"), nNbMission); - fromString(pIM->getDefine("ipj_nb_group_mission"), nNbGroupMission); + fromString(pIM->getParser()->getDefine("ipj_nb_mission"), nNbMission); + fromString(pIM->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 e3c2a3421..7c31fba72 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->getDefine("MAX_HELP_WINDOW"), maxHelpWindow); + fromString(pIM->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->getDefine("player_protect_absorbfactor"), false); + CCDBNodeLeaf *nodeFactor= NLGUI::CDBManager::getInstance()->getDbProp(pIM->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->getDefine( RM_FABER_TYPE::toIconDefineString(faberType) )); + viewBmp->setTexture(pIM->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 fc7b6d6d9..085b599dd 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->getDefine("edit_custom_edit_short")) ); - CGroupEditBox* editBoxShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_box_short")) ); - CInterfaceGroup* editLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_large")) ); - CGroupEditBox* editBoxLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_box_large")) ); - CViewText* display = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_display")) ); + 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")) ); 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->getDefine("edit_custom_edit_short")) ); - CGroupEditBox* editBoxShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_box_short")) ); - CInterfaceGroup* editLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_large")) ); - CGroupEditBox* editBoxLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_box_large")) ); - CViewText* display = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_display")) ); - CInterfaceGroup* editButtons = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_buttons")) ); - CCtrlBaseButton* closeButton = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_close_button")) ); - CViewBitmap* background = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_background")) ); + 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")) ); 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->getDefine("edit_custom_edit_short")) ); - CGroupEditBox* editBoxShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_box_short")) ); - CInterfaceGroup* editLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_large")) ); - CGroupEditBox* editBoxLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_box_large")) ); - CViewText* display = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_display")) ); - CInterfaceGroup* editButtons = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_buttons")) ); - CCtrlBaseButton* closeButton = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_close_button")) ); - CViewBitmap* background = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_background")) ); + 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")) ); 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->getDefine("edit_custom_edit_short")) ); - CGroupEditBox* editBoxShort = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_box_short")) ); - CInterfaceGroup* editLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_large")) ); - CGroupEditBox* editBoxLarge = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_box_large")) ); - CViewText* display = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_display")) ); - CInterfaceGroup* editButtons = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_edit_buttons")) ); - CCtrlBaseButton* closeButton = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_close_button")) ); - CViewBitmap* background = dynamic_cast( CWidgetManager::getInstance()->getElementFromId(pIM->getDefine("edit_custom_background")) ); + 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")) ); 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->getDefine("ui_set_active") )->getValue32(); + uint8 activeSheath = (uint8)NLGUI::CDBManager::getInstance()->getDbProp( pIM->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->getDefine("ui_set_active") )->setValue32(activeSheath); + NLGUI::CDBManager::getInstance()->getDbProp( pIM->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 e07f12e74..216af8a81 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->addLink(il, id); + im->getParser()->addLink(il, id); il->update(); } }; @@ -453,7 +453,7 @@ class CActionHandlerRemoveLink : public IActionHandler return; } CInterfaceManager *im = CInterfaceManager::getInstance(); - im->removeLink(id); + im->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->createGroupInstance("menu_color_widget", "", params, 3); + return im->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 837ba4d3f..c0491b2b3 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->getDefine("ui_set_active")); - CCDBNodeLeaf *pNLCurSetRead = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getDefine("set_active")); - CCDBNodeLeaf *pNLNbSet = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getDefine("set_nb")); + 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")); 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->getDefine("ui_set_active")); - CCDBNodeLeaf *pNLCurSetRead = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getDefine("set_active")); - CCDBNodeLeaf *pNLNbSet = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getDefine("set_nb")); + 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")); 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->getDefine("ui_set_active")); - CCDBNodeLeaf *pNLNbSet = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getDefine("set_nb")); + CCDBNodeLeaf *pNLCurSetWrite = NLGUI::CDBManager::getInstance()->getDbProp(pIM->getParser()->getDefine("ui_set_active")); + CCDBNodeLeaf *pNLNbSet = NLGUI::CDBManager::getInstance()->getDbProp(pIM->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 cfd442deb..324c6f9d6 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->getDefine( RM_FABER_TYPE::toIconDefineString(mpBuild.FaberTypeRequired) )); + viewBmp->setTexture(pIM->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 c21d3cc13..5843d2f70 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->getDefine("money_proposal")); + CCDBNodeLeaf *moneyProposal = NLGUI::CDBManager::getInstance()->getDbProp(pIM->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 ac5cc69a8..e30fc3cfb 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->getDefine("bot_chat_filter_max_price"), value); + fromString(pIM->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->getDefine("bot_chat_filter_max_quality"), value); + fromString(pIM->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->getDefine(toString("faction_icon_%s", factionName.c_str())); + string factionIcon= pIM->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->getDefine(itemTypeDef); + return pIM->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 3b212af7e..371e2f059 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()->createGroupInstance(params[0], "", uiTemplateParams, 4); + return CInterfaceManager::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 0ed59a659..33422421d 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->createGroupInstance(chatTemplate, "ui:interface", params); + CInterfaceGroup *chatGroup = im->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->getDefine("chat_group_tab_color_newmsg").c_str()); + CRGBA newMsgColor= CRGBA::stringToRGBA(pIM->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->createGroupInstance(templateName, "ui:interface", properties); + CInterfaceGroup *pIG = pIM->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 3f1e81378..de2c5db38 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()->getCtrlSheetSelection(); + const CCtrlSheetSelection &css = CInterfaceManager::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->getCtrlSheetSelection(); + const CCtrlSheetSelection &css = pIM->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->getCtrlSheetSelection(); + const CCtrlSheetSelection &css = im->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->getDefine(defineName); + std::string colVal= pIM->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 4c3c0ae9d..944dc06a9 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->getDefine("phrase_build_root_info_maxw"), rootTextMaxw); + fromString(pIM->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->getDefine("phrase_max_restrict_combat"), numWeaponSkill); - string strWeaponSkill= pIM->getDefine("phrase_def_skill_restrict_combat"); + fromString(pIM->getParser()->getDefine("phrase_max_restrict_combat"), numWeaponSkill); + string strWeaponSkill= pIM->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 868118721..b229a9f98 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->createGroupInstance(LSP_SECTION_TEMPLATE, getId(), tempVec); + CInterfaceGroup *pIG = pIM->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 47b5e1aaa..e885f3b41 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->createGroupInstance(LSP_SECTION_TEMPLATE, _List->getId(), tempVec); + CInterfaceGroup *pIG = pIM->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 54b910564..3b9eafeab 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->createGroupInstance ("in_scene_flying_text", + CInterfaceGroup *groupInfo = pIM->getParser()->createGroupInstance ("in_scene_flying_text", "ui:interface", templateParams); // if ok if(groupInfo) @@ -92,7 +92,7 @@ void CFlyingTextManager::initInGame() } // misc - fromString(pIM->getDefine("in_scene_flying_char_offsetx"), _CharacterWindowOffsetX); + fromString(pIM->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 9d2413f20..4c5712ea4 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,10 @@ void contextHelp (const std::string &name) { string defineTarget = name+"_"+toString(index)+"_target"; string defineUrl = name+"_"+toString(index)+"_url"; - if (pIM->isDefineExist(defineTarget) && pIM->isDefineExist(defineUrl)) + if (pIM->getParser()->isDefineExist(defineTarget) && pIM->getParser()->isDefineExist(defineUrl)) { - string target = pIM->getDefine(defineTarget); - string url = pIM->getDefine(defineUrl); + string target = pIM->getParser()->getDefine(defineTarget); + string url = pIM->getParser()->getDefine(defineUrl); CInterfaceElement *elementTarget = CWidgetManager::getInstance()->getElementFromId(target); if (elementTarget && elementTarget->getActive()) @@ -176,12 +176,12 @@ void CGroupInSceneBubbleManager::alignMessagePopup (vector &rList, bool sint32 offsetY; if (bCenter) { - fromString(pIM->getDefine("popup_pos_y_center"), offsetY); + fromString(pIM->getParser()->getDefine("popup_pos_y_center"), offsetY); offsetY = pRoot->getHReal() - offsetY; offsetY -= rList[i].Group->getH(); } else - fromString(pIM->getDefine("popup_pos_y"), offsetY); + fromString(pIM->getParser()->getDefine("popup_pos_y"), offsetY); rList[i].Group->setY(offsetY); rList[i].Group->invalidateCoords(); @@ -228,7 +228,7 @@ void CGroupInSceneBubbleManager::init () std::vector > templateParams; templateParams.push_back (std::pair("id", id)); - CInterfaceGroup *group = pIM->createGroupInstance ("3dbulle_L", + CInterfaceGroup *group = pIM->getParser()->createGroupInstance ("3dbulle_L", "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { @@ -508,7 +508,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->createGroupInstance ("skill_popup", + CInterfaceGroup *group = pIM->getParser()->createGroupInstance ("skill_popup", "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { @@ -574,7 +574,7 @@ void CGroupInSceneBubbleManager::addMessagePopup (const ucstring &message, CRGBA std::vector > templateParams; templateParams.push_back (std::pair("id", id)); - CInterfaceGroup *group = pIM->createGroupInstance ("message_popup", + CInterfaceGroup *group = pIM->getParser()->createGroupInstance ("message_popup", "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { @@ -623,7 +623,7 @@ void CGroupInSceneBubbleManager::addMessagePopupCenter (const ucstring &message, std::vector > templateParams; templateParams.push_back (std::pair("id", id)); - CInterfaceGroup *group = pIM->createGroupInstance ("message_popup_center", + CInterfaceGroup *group = pIM->getParser()->createGroupInstance ("message_popup_center", "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { @@ -695,7 +695,7 @@ CGroupInSceneBubbleManager::CPopupContext *CGroupInSceneBubbleManager::buildCont std::vector > templateParams; templateParams.push_back (std::pair("id", id)); - CInterfaceGroup *group = pIM->createGroupInstance (templateName+v+h, + CInterfaceGroup *group = pIM->getParser()->createGroupInstance (templateName+v+h, "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { @@ -896,7 +896,7 @@ void CGroupInSceneBubbleManager::dynChatOpen (uint32 nBotUID, uint32 nBotName, c std::vector > templateParams; templateParams.push_back (std::pair("id", id)); - CInterfaceGroup *group = pIM->createGroupInstance ("dyn_3dbulle_L", "ui:interface", templateParams); + CInterfaceGroup *group = pIM->getParser()->createGroupInstance ("dyn_3dbulle_L", "ui:interface", templateParams); if (group == NULL) { nlwarning("cannot create dyn_3dbulle_L"); @@ -1009,7 +1009,7 @@ void CGroupInSceneBubbleManager::webIgChatOpen (uint32 nBotUID, string text, con std::vector > templateParams; templateParams.push_back (std::pair("id", id)); - CInterfaceGroup *group = pIM->createGroupInstance ("webig_3dbulle_L", "ui:interface", templateParams); + CInterfaceGroup *group = pIM->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 d8c5bd4a8..db31f0484 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->getDefine("in_scene_user_info_bar_h"), barHeight); - fromString(pIM->getDefine("in_scene_user_info_bar_space"), barSpace); - fromString(pIM->getDefine("in_scene_user_info_text_h"), textH); - fromString(pIM->getDefine("in_scene_user_bar_length"), CGroupInSceneUserInfo::_BatLength); + 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); // 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()->createGroupInstance ( templateName, + groupInfo = CInterfaceManager::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 ea6b4e6a6..4d452c379 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->getDefine("quick_help_buttons"); + string buttonId = pIM->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 ea7d88a75..af39f00d5 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->createGroupInstance(_TemplateSkill, getId() + ":" + WIN_TREE_LIST, tempVec); + CInterfaceGroup *pIG = pIM->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 6b627330d..907a7c12f 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->createGroupInstance (TEMPLATE_GUILD_MEMBER, LIST_GUILD_MEMBERS, vParams); + pLine = pIM->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 6272f39b2..74a2eb6b0 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->isDefineExist(defVerId)) + if(pIM->getParser()->isDefineExist(defVerId)) { uint32 dbVer; - fromString(pIM->getDefine(defVerId), dbVer); + fromString(pIM->getParser()->getDefine(defVerId), dbVer); // if the version in the file is older than the version this db want, abort read if(uiDbSaveVersiongetDefine( RM_FABER_TYPE::toIconDefineString(RM_FABER_TYPE::TRMFType(args[0].getInteger())) )); + result.setString(pIM->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 64c2b5648..a668c17b0 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->getDefine("bag_nb"); + std::string nbBagPath = im->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->getDefine("bag"); + std::string bagsPath = im->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->getDefine(armourInfos[k].DefineName); + std::string dbPath = im->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->getCtrlSheetSelection(); + CCtrlSheetSelection &css = im->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->getCtrlSheetSelection(); + CCtrlSheetSelection &css = im->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 125becd73..055441bd1 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -436,18 +436,20 @@ namespace // ------------------------------------------------------------------------------------------------ CInterfaceManager::CInterfaceManager( NL3D::UDriver *driver, NL3D::UTextContext *textcontext ) { - addModule( "scene3d", new CIF3DSceneParser() ); - addModule( "ddx", new CIFDDXParser() ); - addModule( "action_category", new CActionCategoryParser() ); - addModule( "command", new CCommandParser() ); - addModule( "key", new CKeyParser() ); - addModule( "macro", new CMacroParser() ); + parser = new CInterfaceParser(); + parser->setSetupOptionsCallback( this ); + parser->addModule( "scene3d", new CIF3DSceneParser() ); + parser->addModule( "ddx", new CIFDDXParser() ); + parser->addModule( "action_category", new CActionCategoryParser() ); + 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() ); - setCacheUIParsing( ClientCfg.CacheUIParsing ); + parser->setCacheUIParsing( ClientCfg.CacheUIParsing ); - CWidgetManager::parser = this; + CWidgetManager::parser = parser; this->driver = driver; this->textcontext = textcontext; CViewRenderer::setDriver( driver ); @@ -535,13 +537,6 @@ CInterfaceManager::~CInterfaceManager() CViewTextFormated::setFormatter( NULL ); reset(); // to flush IDStringWaiters - _ParentPositionsMap.clear(); - _ParentSizesMap.clear(); - _ParentSizesMaxMap.clear(); - _LuaClassAssociation.clear(); - _Templates.clear(); - _Instance = NULL; - // release the local string mapper delete _UIStringMapper; _UIStringMapper = NULL; @@ -554,6 +549,9 @@ CInterfaceManager::~CInterfaceManager() delete interfaceLinkUpdater; interfaceLinkUpdater = NULL; */ + _Instance = NULL; + delete parser; + parser = NULL; } // ------------------------------------------------------------------------------------------------ @@ -622,12 +620,12 @@ void CInterfaceManager::destroy () void CInterfaceManager::initLUA() { - if( isLuaInitialized() ) + if( parser->isLuaInitialized() ) return; - CInterfaceParser::initLUA(); + parser->initLUA(); - if( !isLuaInitialized() ) + if( !parser->isLuaInitialized() ) return; CLuaIHMRyzom::RegisterRyzomFunctions( *( CLuaManager::getInstance().getLuaState() ) ); @@ -689,7 +687,7 @@ void CInterfaceManager::uninitLogin() CWidgetManager::getInstance()->activateMasterGroup ("ui:login", false); - removeAll(); + parser->removeAll(); reset(); CWidgetManager::getInstance()->setPointer( NULL ); @@ -704,7 +702,7 @@ void CInterfaceManager::uninitLogin() } // Close LUA Scripting - uninitLUA(); + parser->uninitLUA(); } // ------------------------------------------------------------------------------------------------ @@ -810,7 +808,7 @@ void CInterfaceManager::uninitOutGame() CWidgetManager::getInstance()->activateMasterGroup ("ui:outgame", false); //nlinfo ("%d seconds for activateMasterGroup", (uint32)(ryzomGetLocalTime ()-initStart)/1000); initStart = ryzomGetLocalTime (); - removeAll(); + parser->removeAll(); //nlinfo ("%d seconds for removeAll", (uint32)(ryzomGetLocalTime ()-initStart)/1000); initStart = ryzomGetLocalTime (); reset(); @@ -834,7 +832,7 @@ void CInterfaceManager::uninitOutGame() } // Close LUA Scripting - uninitLUA(); + parser->uninitLUA(); //NLMEMORY::CheckHeap (true); } @@ -1087,7 +1085,7 @@ void CInterfaceManager::configureQuitDialogBox() eltQuit = quitDlg->getElement(quitDialogStr+":ryzom"); eltQuitNow = quitDlg->getElement(quitDialogStr+":ryzom_now"); sint buttonDeltaY; - fromString(getDefine("quit_button_delta_y"), buttonDeltaY); + fromString( parser->getDefine("quit_button_delta_y"), buttonDeltaY); extern R2::TUserRole UserRoleInSession; bool sessionOwner = (R2::getEditor().getMode() != R2::CEditor::NotInitialized && R2::getEditor().getDMC().getEditionModule().isSessionOwner()); @@ -1344,7 +1342,7 @@ void CInterfaceManager::uninitInGame1 () // Remove all interface objects (containers, groups, variables, defines, ...) CWidgetManager::getInstance()->activateMasterGroup ("ui:interface", false); - removeAll(); + parser->removeAll(); reset(); CInterfaceLink::removeAllLinks(); @@ -1387,7 +1385,7 @@ void CInterfaceManager::uninitInGame1 () CGuildManager::release(); // Close LUA Scripting - uninitLUA(); + parser->uninitLUA(); setInGame( false ); _NeutralColor = NULL; @@ -1582,7 +1580,7 @@ bool CInterfaceManager::parseInterface (const std::vector &xmlFileN _DB_UI_DUMMY_PREREQUISIT_VALID->setValueBool(true); _DB_UI_DUMMY_FACTION_TYPE->setValue64(0); - return CInterfaceParser::parseInterface (xmlFileNames, reload, isFilename); + return parser->parseInterface (xmlFileNames, reload, isFilename); } // ------------------------------------------------------------------------------------------------ @@ -1902,7 +1900,7 @@ bool CInterfaceManager::saveConfig (const string &filename) // write UI_DB_SAVE_VERSION uint32 uiDbSaveVersion; - fromString(getDefine("UI_DB_SAVE_VERSION"), uiDbSaveVersion); + fromString( parser->getDefine("UI_DB_SAVE_VERSION"), uiDbSaveVersion); f.serial(uiDbSaveVersion); // write database @@ -2222,7 +2220,7 @@ bool CInterfaceManager::getCurrentValidMessageBoxOnOk(string &ahOnOk, const std: { // Ok, get the current procedure OnOk action string dummyParams; - if(getProcedureAction("proc_valid_message_box_ok", 1, ahOnOk, dummyParams)) + if( parser->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 bdd74a68f..a5b764755 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.h +++ b/code/ryzom/client/src/interface_v3/interface_manager.h @@ -82,7 +82,7 @@ namespace NLGUI * \author Nevrax France * \date 2002 */ -class CInterfaceManager : public NLGUI::CInterfaceParser, public NLGUI::IInputEventListener +class CInterfaceManager : public NLGUI::CInterfaceParser::ISetupOptionCallbackClass, public NLGUI::IInputEventListener { public: @@ -658,7 +658,10 @@ private: NL3D::UDriver *driver; NL3D::UTextContext *textcontext; 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 0a8bb6413..1e2e1d465 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->solveDefine(propVal, newPropVal, defError)) + if(!pIM->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->createGroupInstance(ls.toString(1), ls.toString(2), templateParams); + CInterfaceGroup *result = im->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->createGroupInstance(ls.toString(1), "ui:interface:"+string(ls.toString(2)), templateParams); + CInterfaceGroup *result = im->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->createUIElement(ls.toString(1), ls.toString(2), templateParams); + CInterfaceElement *result = im->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->isDefineExist(def)) + if(ClientCfg.DisplayLuaDebugInfo && !pIM->getParser()->isDefineExist(def)) debugInfo(toString("getDefine(): '%s' not found", def.c_str())); - return pIM->getDefine(def); + return pIM->getParser()->getDefine(def); } // *************************************************************************** @@ -2703,7 +2703,7 @@ sint32 CLuaIHMRyzom::getTargetLevel() if ( target->isPlayer() ) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - CCDBNodeLeaf *pDbPlayerLevel = NLGUI::CDBManager::getInstance()->getDbProp( pIM->getDefine("target_player_level") ); + CCDBNodeLeaf *pDbPlayerLevel = NLGUI::CDBManager::getInstance()->getDbProp( pIM->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->getDefine("target_player_level") ); + CCDBNodeLeaf *pDbPlayerLevel = NLGUI::CDBManager::getInstance()->getDbProp( pIM->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->getDefine("target_player_level") ); + CCDBNodeLeaf *pDbPlayerLevel = NLGUI::CDBManager::getInstance()->getDbProp( pIM->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 a03ac010b..d6dd1bf0f 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->createGroupInstance (TEMPLATE_KEYS_GROUP, pParent->getId(), vParams); + pKeysLine = pIM->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->createGroupInstance(TEMPLATE_EDITCMD, "ui:interface", vArgs)); + Win = dynamic_cast(pIM->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 ab7c67073..1e3bc92de 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->createGroupInstance(TEMPLATE_NEWMACRO_COMMAND, pParent->getId(), vParams); + CInterfaceGroup *pNewCmd = pIM->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->createGroupInstance(TEMPLATE_MACRO_ELT, pParent->getId(), vParams); + CInterfaceGroup *pNewMacro = pIM->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 1af0044b5..97569c4f1 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->getDefine("item_price_1"); - string ms = im->getDefine("item_price_2"); - string bs = im->getDefine("item_price_3"); - string vbs = im->getDefine("item_price_4"); + 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"); 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 1efed593b..568589ab7 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->getDefine("chat_group_tab_color_normal").c_str()); + CRGBA stdColor= CRGBA::stringToRGBA(pIM->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->createGroupInstance("menu_checkbox", "", params, sizeof(params) / sizeof(params[0])); + CInterfaceGroup *ig = im->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 9bf60df92..19c277502 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->createGroupInstance(desc.BaseContainerTemplateName, baseId, baseContainerParams); + CInterfaceGroup *mainIg = im->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->createGroupInstance(templateName, "ui:interface", properties, false); + CInterfaceGroup *group = im->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 341883c64..2f02740fe 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->createGroupInstance("t_cat", GROUP_LIST_CAT, params); + CInterfaceGroup *pNewLine = pIM->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->createGroupInstance("t_shard", GROUP_LIST_SHARD, params); + CInterfaceGroup *pNewLine =pIM->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 bb8cc7387..406278da2 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->getDefine("money_1"); - string ms = im->getDefine("money_2"); - string bs = im->getDefine("money_3"); - string vbs = im->getDefine("money_4"); + 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"); 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 344340820..d543d2ffc 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->getDefine("server_message_box_content_view_text"))); + CViewText *vt= dynamic_cast(CWidgetManager::getInstance()->getElementFromId(pIM->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 9eb8c0431..48009d2a5 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->createGroupInstance (iconTemplateName , "ui:interface", NULL, 0); + CInterfaceGroup *group = pIM->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 c22ee1ada..248175aa4 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().getDefine("r2ed_max_num_plot_item_sheets"), ret); + fromString(getUI().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 e096beeb7..c94e9b95a 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->removeAllTemplates(); + pIM->getParser()->removeAllTemplates(); CWidgetManager::getInstance()->setCaptureKeyboard(NULL); CWidgetManager::getInstance()->setCapturePointerLeft(NULL); CWidgetManager::getInstance()->setCapturePointerRight(NULL);