CHANGED: #1471 CInterfaceParser is now a component of CWidgetManager, and is instantiated by an abstract factory method. (IParser::createParser())

This commit is contained in:
dfighter1985 2012-07-13 05:37:09 +02:00
parent f5433fb361
commit 59ccf977ee
50 changed files with 317 additions and 219 deletions

View file

@ -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

View file

@ -0,0 +1,72 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// 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 <http://www.gnu.org/licenses/>.
#ifndef PARSER_H
#define PARSER_H
#include <string>
#include <vector>
#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 &params ) 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

View file

@ -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 &params ) 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{
@ -484,12 +468,14 @@ namespace NLGUI
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;

View file

@ -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<std::string,std::string> ("want_return", multiLine?"true":"false"));
templateParams.push_back (std::pair<std::string,std::string> ("enter_recover_focus", "false"));
templateParams.push_back (std::pair<std::string,std::string> ("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<std::pair<std::string,std::string> > templateParams;
templateParams.push_back (std::pair<std::string,std::string> ("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;i<numActions;i++)
{
string procAh, procParams;
if( CWidgetManager::parser->getProcedureAction(procName, i, procAh, procParams))
if( CWidgetManager::getInstance()->getParser()->getProcedureAction(procName, i, procAh, procParams))
{
// recurs proc if needed!
if (actionLaunchUrlRecurs(procAh, procParams, url))

View file

@ -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);

View file

@ -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" );

View file

@ -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");

View file

@ -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;
}

View file

@ -0,0 +1,39 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// 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 <http://www.gnu.org/licenses/>.
#include "nel/misc/rgba.h"
#include <map>
#include "nel/gui/interface_group.h"
#include "nel/gui/interface_parser.h"
namespace NLGUI
{
IParser::IParser()
{
}
IParser::~IParser()
{
}
IParser* IParser::createParser()
{
return new CInterfaceParser();
}
}

View file

@ -161,13 +161,13 @@ namespace NLGUI
std::vector<std::pair<std::string,std::string> > templateParams;
templateParams.push_back (std::pair<std::string,std::string>("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<std::string,std::string>("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"));
}

View file

@ -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;

View file

@ -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

View file

@ -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<string,string>("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<string,string>("id", toString(Mainlands[i].Id)));
params.push_back(pair<string,string>("w", "1024"));
params.push_back(pair<string,string>("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<CViewText *>(toggleGr->getView("button_text"));

View file

@ -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<CItemSheet *>(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<<INTERFACE_FLAGS::Magic)) != 0)
bFound = true;
if (!bFound)
{
fromString(pIM->getParser()->getDefine("mode_combat"), tmpMode);
fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_combat"), tmpMode);
if (nNewMode == tmpMode)
if ((nIntFlags & (1<<INTERFACE_FLAGS::Combat)) != 0)
bFound = true;
@ -2290,7 +2290,7 @@ class CAHUpdateCurrentMode : public IActionHandler
if (!bFound)
{
fromString(pIM->getParser()->getDefine("mode_faber_create"), tmpMode);
fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_faber_create"), tmpMode);
if (nNewMode == tmpMode)
if ((nIntFlags & (1<<INTERFACE_FLAGS::FaberCreate)) != 0)
bFound = true;
@ -2298,7 +2298,7 @@ class CAHUpdateCurrentMode : public IActionHandler
if (!bFound)
{
fromString(pIM->getParser()->getDefine("mode_faber_repair"), tmpMode);
fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_faber_repair"), tmpMode);
if (nNewMode == tmpMode)
if ((nIntFlags & (1<<INTERFACE_FLAGS::FaberRepair)) != 0)
bFound = true;
@ -2306,7 +2306,7 @@ class CAHUpdateCurrentMode : public IActionHandler
if (!bFound)
{
fromString(pIM->getParser()->getDefine("mode_faber_refine"), tmpMode);
fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_faber_refine"), tmpMode);
if (nNewMode == tmpMode)
if ((nIntFlags & (1<<INTERFACE_FLAGS::FaberRefine)) != 0)
bFound = true;
@ -2314,7 +2314,7 @@ class CAHUpdateCurrentMode : public IActionHandler
if (!bFound)
{
fromString(pIM->getParser()->getDefine("mode_commerce"), tmpMode);
fromString(CWidgetManager::getInstance()->getParser()->getDefine("mode_commerce"), tmpMode);
if (nNewMode == tmpMode)
if ((nIntFlags & (1<<INTERFACE_FLAGS::Commerce)) != 0)
bFound = true;
@ -2322,14 +2322,14 @@ class CAHUpdateCurrentMode : public IActionHandler
if (!bFound)
{
fromString(pIM->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<<INTERFACE_FLAGS::Special)) != 0)
bFound = true;
@ -3798,8 +3798,8 @@ uint32 getMissionTitle(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 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))

View file

@ -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) ));
}

View file

@ -109,11 +109,11 @@ void CInterfaceItemEdition::CItemEditionWindow::infoReceived()
// get the dialog stack
CInterfaceGroup* group = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(WindowName) );
CInterfaceGroup* editShort = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_short")) );
CGroupEditBox* editBoxShort = dynamic_cast<CGroupEditBox*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_box_short")) );
CInterfaceGroup* editLarge = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_large")) );
CGroupEditBox* editBoxLarge = dynamic_cast<CGroupEditBox*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_box_large")) );
CViewText* display = dynamic_cast<CViewText*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_display")) );
CInterfaceGroup* editShort = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_short")) );
CGroupEditBox* editBoxShort = dynamic_cast<CGroupEditBox*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_box_short")) );
CInterfaceGroup* editLarge = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_large")) );
CGroupEditBox* editBoxLarge = dynamic_cast<CGroupEditBox*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_box_large")) );
CViewText* display = dynamic_cast<CViewText*>( 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<CGroupContainer*>( CWidgetManager::getInstance()->getElementFromId(WindowName) );
CInterfaceGroup* editShort = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_short")) );
CGroupEditBox* editBoxShort = dynamic_cast<CGroupEditBox*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_box_short")) );
CInterfaceGroup* editLarge = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_large")) );
CGroupEditBox* editBoxLarge = dynamic_cast<CGroupEditBox*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_box_large")) );
CViewText* display = dynamic_cast<CViewText*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_display")) );
CInterfaceGroup* editButtons = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_buttons")) );
CCtrlBaseButton* closeButton = dynamic_cast<CCtrlBaseButton*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_close_button")) );
CViewBitmap* background = dynamic_cast<CViewBitmap*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_background")) );
CInterfaceGroup* editShort = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_short")) );
CGroupEditBox* editBoxShort = dynamic_cast<CGroupEditBox*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_box_short")) );
CInterfaceGroup* editLarge = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_large")) );
CGroupEditBox* editBoxLarge = dynamic_cast<CGroupEditBox*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_box_large")) );
CViewText* display = dynamic_cast<CViewText*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_display")) );
CInterfaceGroup* editButtons = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_buttons")) );
CCtrlBaseButton* closeButton = dynamic_cast<CCtrlBaseButton*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_close_button")) );
CViewBitmap* background = dynamic_cast<CViewBitmap*>( 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<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(windowName) );
CInterfaceGroup* editShort = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_short")) );
CGroupEditBox* editBoxShort = dynamic_cast<CGroupEditBox*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_box_short")) );
CInterfaceGroup* editLarge = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_large")) );
CGroupEditBox* editBoxLarge = dynamic_cast<CGroupEditBox*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_box_large")) );
CViewText* display = dynamic_cast<CViewText*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_display")) );
CInterfaceGroup* editButtons = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_buttons")) );
CCtrlBaseButton* closeButton = dynamic_cast<CCtrlBaseButton*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_close_button")) );
CViewBitmap* background = dynamic_cast<CViewBitmap*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_background")) );
CInterfaceGroup* editShort = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_short")) );
CGroupEditBox* editBoxShort = dynamic_cast<CGroupEditBox*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_box_short")) );
CInterfaceGroup* editLarge = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_large")) );
CGroupEditBox* editBoxLarge = dynamic_cast<CGroupEditBox*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_box_large")) );
CViewText* display = dynamic_cast<CViewText*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_display")) );
CInterfaceGroup* editButtons = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_buttons")) );
CCtrlBaseButton* closeButton = dynamic_cast<CCtrlBaseButton*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_close_button")) );
CViewBitmap* background = dynamic_cast<CViewBitmap*>( 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<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(windowName) );
CInterfaceGroup* editShort = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_short")) );
CGroupEditBox* editBoxShort = dynamic_cast<CGroupEditBox*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_box_short")) );
CInterfaceGroup* editLarge = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_large")) );
CGroupEditBox* editBoxLarge = dynamic_cast<CGroupEditBox*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_box_large")) );
CViewText* display = dynamic_cast<CViewText*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_display")) );
CInterfaceGroup* editButtons = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_edit_buttons")) );
CCtrlBaseButton* closeButton = dynamic_cast<CCtrlBaseButton*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_close_button")) );
CViewBitmap* background = dynamic_cast<CViewBitmap*>( CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("edit_custom_background")) );
CInterfaceGroup* editShort = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_short")) );
CGroupEditBox* editBoxShort = dynamic_cast<CGroupEditBox*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_box_short")) );
CInterfaceGroup* editLarge = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_large")) );
CGroupEditBox* editBoxLarge = dynamic_cast<CGroupEditBox*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_box_large")) );
CViewText* display = dynamic_cast<CViewText*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_display")) );
CInterfaceGroup* editButtons = dynamic_cast<CInterfaceGroup*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_edit_buttons")) );
CCtrlBaseButton* closeButton = dynamic_cast<CCtrlBaseButton*>( CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("edit_custom_close_button")) );
CViewBitmap* background = dynamic_cast<CViewBitmap*>( 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" );

View file

@ -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);
}
// ***************************************************************************

View file

@ -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;

View file

@ -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)
{

View file

@ -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

View file

@ -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<CViewBitmap*>(fpGroup->getView("unit_price:item_price:icone"));
if(vBmp) vBmp->setTexture(factionIcon);
vBmp= dynamic_cast<CViewBitmap*>(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);
}

View file

@ -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)

View file

@ -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<CGroupContainer *>(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<CGroupContainer *>(pIG);
if (!pGC)

View file

@ -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());
}

View file

@ -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<string> weaponSkillList;
splitString(strWeaponSkill, " ", weaponSkillList);
nlassert(weaponSkillList.size()==numWeaponSkill);

View file

@ -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);

View file

@ -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);

View file

@ -64,7 +64,7 @@ void CFlyingTextManager::initInGame()
string id = "in_scene_flying_text_"+toString (i);
std::vector<std::pair<std::string,std::string> > templateParams;
templateParams.push_back (std::pair<std::string,std::string>("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);
}
// ***************************************************************************

View file

@ -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<CPopup> &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<std::pair<std::string,std::string> > templateParams;
templateParams.push_back (std::pair<std::string,std::string>("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<std::string,std::string>("skillid", toString(skillId)));
templateParams.push_back (std::pair<std::string,std::string>("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<std::pair<std::string,std::string> > templateParams;
templateParams.push_back (std::pair<std::string,std::string>("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<std::pair<std::string,std::string> > templateParams;
templateParams.push_back (std::pair<std::string,std::string>("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<std::pair<std::string,std::string> > templateParams;
templateParams.push_back (std::pair<std::string,std::string>("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<std::pair<std::string,std::string> > templateParams;
templateParams.push_back (std::pair<std::string,std::string>("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<std::pair<std::string,std::string> > templateParams;
templateParams.push_back (std::pair<std::string,std::string>("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");

View file

@ -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<std::pair<std::string,std::string> > templateParams;
templateParams.push_back (std::pair<std::string,std::string>("id", id));
groupInfo = CInterfaceManager::getInstance()->getParser()->createGroupInstance ( templateName,
groupInfo = CWidgetManager::getInstance()->getParser()->createGroupInstance ( templateName,
"ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size());
}

View file

@ -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

View file

@ -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

View file

@ -817,7 +817,7 @@ class CAHGuildSheetOpen : public IActionHandler
vector< pair<string, string> > vParams;
vParams.push_back(vector< pair<string, string> >::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

View file

@ -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(uiDbSaveVersion<dbVer)
wantRead= false;

View file

@ -988,7 +988,7 @@ static DECLARE_INTERFACE_USER_FCT(getBotChatBuyFilterMPIcon)
}
CInterfaceManager *pIM= CInterfaceManager::getInstance();
result.setString(pIM->getParser()->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;
}

View file

@ -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;
}

View file

@ -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<std::string> &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;
}

View file

@ -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

View file

@ -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<std::string, std::string>(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<std::string, std::string>(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<std::string, std::string>(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 )

View file

@ -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<string,string>("db_disp_1p",DbComboDisp1P));
vArgs.push_back(pair<string,string>("db_disp_2p",DbComboDisp2P));
Win = dynamic_cast<CGroupContainer*>(pIM->getParser()->createGroupInstance(TEMPLATE_EDITCMD, "ui:interface", vArgs));
Win = dynamic_cast<CGroupContainer*>( CWidgetManager::getInstance()->getParser()->createGroupInstance(TEMPLATE_EDITCMD, "ui:interface", vArgs));
if (Win == NULL)
{
nlwarning ("cannot create %s", name.c_str());

View file

@ -802,7 +802,7 @@ void addCommandLine (CGroupList *pParent, uint cmdNb, const ucstring &cmdName)
vector< pair<string, string> > vParams;
vParams.push_back(pair<string,string>("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<CViewText*>(pNewCmd->getView(TEMPLATE_NEWMACRO_COMMAND_TEXT));
@ -969,7 +969,7 @@ void addMacroLine (CGroupList *pParent, uint macNb, const CMacroCmd &macro)
vector< pair<string, string> > vParams;
vParams.push_back(pair<string,string>("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<CViewText*>(pNewMacro->getView(TEMPLATE_MACRO_ELT_TEXT));

View file

@ -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);
}
}

View file

@ -1029,7 +1029,7 @@ class CHandlerChatGroupFilter : public IActionHandler
CCtrlTabButton *pTabButton= dynamic_cast<CCtrlTabButton*>(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<CCtrlBaseButton *>(ig->getCtrl("b"));
if (!cb) return NULL;

View file

@ -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<CGroupContainer *>(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<CGroupContainer *>(group);
if (!gc)

View file

@ -210,7 +210,7 @@ void createOptionalCatUI()
if (i>0)
params.push_back(pair<string,string>("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<CViewText*>(pNewLine->getView("name"));
@ -1086,7 +1086,7 @@ void initShardDisplay()
if (i>0)
params.push_back(pair<string,string>("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<CViewText*>(pNewLine->getView("name"));

View file

@ -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(),

View file

@ -3335,7 +3335,7 @@ private:
pGC->setActive(true);
// must set the text by hand
CViewText *vt= dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId(pIM->getParser()->getDefine("server_message_box_content_view_text")));
CViewText *vt= dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->getParser()->getDefine("server_message_box_content_view_text")));
if(vt)
vt->setTextFormatTaged(contentStr);

View file

@ -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<CGroupInScene *>(group);

View file

@ -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;
}

View file

@ -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);