mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-25 08:16:16 +00:00
MODIFIED: Resolved some GCC build errors.
This commit is contained in:
parent
d71a00399b
commit
6208a10c26
22 changed files with 140 additions and 72 deletions
|
@ -19,9 +19,9 @@
|
|||
|
||||
extern "C"
|
||||
{
|
||||
#include <lua/lua.h>
|
||||
#include <lua/lauxlib.h>
|
||||
#include <lua/lualib.h>
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
#include <lualib.h>
|
||||
}
|
||||
|
||||
// load the lua dll, return 1 on success
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
FIND_PACKAGE( Libwww REQUIRED )
|
||||
FIND_PACKAGE( CURL REQUIRED )
|
||||
FIND_PACKAGE( Lua51 REQUIRED )
|
||||
FIND_PACKAGE( Luabind REQUIRED )
|
||||
|
||||
FILE(GLOB SRC *.cpp *.h)
|
||||
FILE(GLOB HEADERS ../../include/nel/gui/*.h)
|
||||
|
||||
|
@ -7,8 +12,22 @@ SET_TARGET_PROPERTIES(nelgui PROPERTIES LINK_INTERFACE_LIBRARIES "")
|
|||
NL_DEFAULT_PROPS(nelgui "NeL, Library: NeL GUI")
|
||||
NL_ADD_RUNTIME_FLAGS(nelgui)
|
||||
|
||||
INCLUDE_DIRECTORIES( ${LUA_INCLUDE_DIR} )
|
||||
|
||||
NL_ADD_LIB_SUFFIX(nelgui)
|
||||
|
||||
#MESSAGE( "libww libs: ${LIBWWW_LIBRARIES}" )
|
||||
|
||||
TARGET_LINK_LIBRARIES( nelgui
|
||||
nelmisc
|
||||
nel3d
|
||||
${LUA_LIBRARIES}
|
||||
${LUABIND_LIBRARIES}
|
||||
${LIBXML2_LIBRARIES}
|
||||
${LIBWWW_LIBRARIES}
|
||||
${CURL_LIBRARIES}
|
||||
)
|
||||
|
||||
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
|
||||
INSTALL(TARGETS nelgui LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
|
||||
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
|
||||
|
|
|
@ -146,7 +146,7 @@ namespace NLGUI
|
|||
_ToolTipParent= TTCtrl;
|
||||
if(prop)
|
||||
{
|
||||
_ToolTipParent = stringToToolTipParent( std::string( prop ) );
|
||||
_ToolTipParent = stringToToolTipParent( std::string( (const char*)prop ) );
|
||||
}
|
||||
|
||||
// Tooltip special parent
|
||||
|
|
|
@ -282,7 +282,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "onover" )
|
||||
{
|
||||
_AHOnOver = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnOver = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( "onover", value );
|
||||
return;
|
||||
}
|
||||
|
@ -295,7 +296,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "onclick_l" )
|
||||
{
|
||||
_AHOnLeftClick = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnLeftClick = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( "onclick_l", value );
|
||||
return;
|
||||
}
|
||||
|
@ -308,7 +310,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "ondblclick_l" )
|
||||
{
|
||||
_AHOnLeftDblClick = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnLeftDblClick = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( "ondblclick_l", value );
|
||||
return;
|
||||
}
|
||||
|
@ -321,7 +324,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "onlongclick_l" )
|
||||
{
|
||||
_AHOnLeftLongClick = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnLeftLongClick = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( "onlongclick_l", value );
|
||||
return;
|
||||
}
|
||||
|
@ -334,7 +338,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "onclick_r" )
|
||||
{
|
||||
_AHOnRightClick = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnRightClick = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( "onclick_r", value );
|
||||
return;
|
||||
}
|
||||
|
@ -347,7 +352,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "onclock_tick" )
|
||||
{
|
||||
_AHOnClockTick = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnClockTick = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( "onclock_tick", value );
|
||||
return;
|
||||
}
|
||||
|
@ -543,27 +549,27 @@ namespace NLGUI
|
|||
{
|
||||
prop = (char*) xmlGetProp( cur, BAD_CAST "onover" );
|
||||
if( prop != NULL )
|
||||
mapAHString( "onover", std::string( prop ) );
|
||||
mapAHString( "onover", std::string( (const char*)prop ) );
|
||||
|
||||
prop = (char*) xmlGetProp( cur, BAD_CAST "onclick_l" );
|
||||
if( prop != NULL )
|
||||
mapAHString( "onclick_l", std::string( prop ) );
|
||||
mapAHString( "onclick_l", std::string( (const char*)prop ) );
|
||||
|
||||
prop = (char*) xmlGetProp( cur, BAD_CAST "ondblclick_l" );
|
||||
if( prop != NULL )
|
||||
mapAHString( "ondblclick_l", std::string( prop ) );
|
||||
mapAHString( "ondblclick_l", std::string( (const char*)prop ) );
|
||||
|
||||
prop = (char*) xmlGetProp( cur, BAD_CAST "onclick_r" );
|
||||
if( prop != NULL )
|
||||
mapAHString( "onclick_r", std::string( prop ) );
|
||||
mapAHString( "onclick_r", std::string( (const char*)prop ) );
|
||||
|
||||
prop = (char*) xmlGetProp( cur, BAD_CAST "onlongclick_l" );
|
||||
if( prop != NULL )
|
||||
mapAHString( "onlongclick_l", std::string( prop ) );
|
||||
mapAHString( "onlongclick_l", std::string( (const char*)prop ) );
|
||||
|
||||
prop = (char*) xmlGetProp( cur, BAD_CAST "onclock_tick" );
|
||||
if( prop != NULL )
|
||||
mapAHString( "onclock_tick", std::string( prop ) );
|
||||
mapAHString( "onclock_tick", std::string( (const char*)prop ) );
|
||||
}
|
||||
|
||||
// Context menu association
|
||||
|
|
|
@ -231,7 +231,7 @@ namespace NLGUI
|
|||
prop = (char*) xmlGetProp (cur, (xmlChar*)"align");
|
||||
if (prop)
|
||||
{
|
||||
setAlignFromString( std::string( prop ) );
|
||||
setAlignFromString( std::string( (const char*)prop ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -292,7 +292,8 @@ namespace NLGUI
|
|||
{
|
||||
_IsDBLink = true;
|
||||
_DBLink.link( value.c_str() );
|
||||
_DBLink.getNodePtr()->addObserver( this, ICDBNode::CTextId() );
|
||||
ICDBNode::CTextId dummy;
|
||||
_DBLink.getNodePtr()->addObserver( this, dummy );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1733,7 +1733,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "on_open" )
|
||||
{
|
||||
_AHOnOpen = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnOpen = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( name, value );
|
||||
return;
|
||||
}
|
||||
|
@ -1746,7 +1747,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "on_close" )
|
||||
{
|
||||
_AHOnClose = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnClose = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( name, value );
|
||||
return;
|
||||
}
|
||||
|
@ -1759,7 +1761,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "on_close_button" )
|
||||
{
|
||||
_AHOnCloseButton = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnCloseButton = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( name, value );
|
||||
return;
|
||||
}
|
||||
|
@ -1772,7 +1775,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "on_move" )
|
||||
{
|
||||
_AHOnMove = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnMove = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( name, value );
|
||||
return;
|
||||
}
|
||||
|
@ -1785,7 +1789,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "on_deactive_check" )
|
||||
{
|
||||
_AHOnDeactiveCheck = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnDeactiveCheck = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( name, value );
|
||||
return;
|
||||
}
|
||||
|
@ -1798,7 +1803,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "on_resize" )
|
||||
{
|
||||
_AHOnResize = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnResize = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( name, value );
|
||||
return;
|
||||
}
|
||||
|
@ -1811,7 +1817,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "on_alpha_settings_changed" )
|
||||
{
|
||||
_AHOnAlphaSettingsChanged = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnAlphaSettingsChanged = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( name, value );
|
||||
return;
|
||||
}
|
||||
|
@ -1824,7 +1831,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "on_begin_move" )
|
||||
{
|
||||
_AHOnBeginMove = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnBeginMove = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( name, value );
|
||||
return;
|
||||
}
|
||||
|
@ -2224,35 +2232,35 @@ namespace NLGUI
|
|||
{
|
||||
ptr = xmlGetProp( cur, BAD_CAST "on_open" );
|
||||
if( ptr != NULL )
|
||||
mapAHString( "on_open", std::string( ptr ) );
|
||||
mapAHString( "on_open", std::string( (const char*)ptr ) );
|
||||
|
||||
ptr = xmlGetProp( cur, BAD_CAST "on_close" );
|
||||
if( ptr != NULL )
|
||||
mapAHString( "on_close", std::string( ptr ) );
|
||||
mapAHString( "on_close", std::string( (const char*)ptr ) );
|
||||
|
||||
ptr = xmlGetProp( cur, BAD_CAST "on_close_button" );
|
||||
if( ptr != NULL )
|
||||
mapAHString( "on_close_button", std::string( ptr ) );
|
||||
mapAHString( "on_close_button", std::string( (const char*)ptr ) );
|
||||
|
||||
ptr = xmlGetProp( cur, BAD_CAST "on_move" );
|
||||
if( ptr != NULL )
|
||||
mapAHString( "on_move", std::string( ptr ) );
|
||||
mapAHString( "on_move", std::string( (const char*)ptr ) );
|
||||
|
||||
ptr = xmlGetProp( cur, BAD_CAST "on_deactive_check" );
|
||||
if( ptr != NULL )
|
||||
mapAHString( "on_deactive_check", std::string( ptr ) );
|
||||
mapAHString( "on_deactive_check", std::string( (const char*)ptr ) );
|
||||
|
||||
ptr = xmlGetProp( cur, BAD_CAST "on_resize" );
|
||||
if( ptr != NULL )
|
||||
mapAHString( "on_resize", std::string( ptr ) );
|
||||
mapAHString( "on_resize", std::string( (const char*)ptr ) );
|
||||
|
||||
ptr = xmlGetProp( cur, BAD_CAST "on_alpha_settings_changed" );
|
||||
if( ptr != NULL )
|
||||
mapAHString( "on_alpha_settings_changed", std::string( ptr ) );
|
||||
mapAHString( "on_alpha_settings_changed", std::string( (const char*)ptr ) );
|
||||
|
||||
ptr = xmlGetProp( cur, BAD_CAST "on_begin_move" );
|
||||
if( ptr != NULL )
|
||||
mapAHString( "on_begin_move", std::string( ptr ) );
|
||||
mapAHString( "on_begin_move", std::string( (const char*)ptr ) );
|
||||
}
|
||||
|
||||
ptr = xmlGetProp (cur, (xmlChar*)"max_w");
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "nel/gui/widget_manager.h"
|
||||
#include "nel/gui/view_renderer.h"
|
||||
#include "nel/gui/db_manager.h"
|
||||
#include <limits>
|
||||
|
||||
using namespace std;
|
||||
using namespace NLMISC;
|
||||
|
@ -538,7 +539,7 @@ namespace NLGUI
|
|||
{
|
||||
prop = (char*) xmlGetProp( cur, BAD_CAST "onenter" );
|
||||
if( prop != NULL )
|
||||
mapAHString( "onenter", std::string( prop ) );
|
||||
mapAHString( "onenter", std::string( (const char*)prop ) );
|
||||
}
|
||||
|
||||
prop = (char*) xmlGetProp( cur, (xmlChar*)"onchange" );
|
||||
|
|
|
@ -139,7 +139,7 @@ namespace NLGUI
|
|||
ptr = (char*) xmlGetProp( cur, (xmlChar*)"options" );
|
||||
if (ptr)
|
||||
{
|
||||
_Options = std::string( ptr );
|
||||
_Options = std::string( (const char*)ptr );
|
||||
}
|
||||
|
||||
// The first type in display type struct is the default display type
|
||||
|
|
|
@ -507,7 +507,7 @@ namespace NLGUI
|
|||
ptr = (char*) xmlGetProp( cur, (xmlChar*)"hardtext" );
|
||||
if (ptr)
|
||||
{
|
||||
_HardText = std::string( ptr );
|
||||
_HardText = std::string( (const char*)ptr );
|
||||
const char *propPtr = ptr;
|
||||
ucstring Text = ucstring(propPtr);
|
||||
if ((strlen(propPtr)>2) && (propPtr[0] == 'u') && (propPtr[1] == 'i'))
|
||||
|
|
|
@ -2180,7 +2180,7 @@ namespace NLGUI
|
|||
if (prop)
|
||||
{
|
||||
if( editorMode )
|
||||
_Extends = std::string( prop );
|
||||
_Extends = std::string( (const char*)prop );
|
||||
|
||||
CGroupMenu *gm = dynamic_cast<CGroupMenu *>(CWidgetManager::getInstance()->getElementFromId(prop));
|
||||
if (!gm)
|
||||
|
|
|
@ -462,7 +462,7 @@ namespace NLGUI
|
|||
ptr = (char*) xmlGetProp( cur, (xmlChar*)"hardtext" );
|
||||
if (ptr)
|
||||
{
|
||||
_HardText = std::string( ptr );
|
||||
_HardText = std::string( (const char*)ptr );
|
||||
const char *propPtr = ptr;
|
||||
ucstring Text = ucstring(propPtr);
|
||||
if ((strlen(propPtr)>2) && (propPtr[0] == 'u') && (propPtr[1] == 'i'))
|
||||
|
|
|
@ -61,7 +61,8 @@ namespace NLGUI
|
|||
{
|
||||
if( name == "on_wheel_up" )
|
||||
{
|
||||
_AHWheelUp = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHWheelUp = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( name, value );
|
||||
return;
|
||||
}
|
||||
|
@ -74,7 +75,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "on_wheel_down" )
|
||||
{
|
||||
_AHWheelDown = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHWheelDown = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( name, value );
|
||||
return;
|
||||
}
|
||||
|
@ -119,11 +121,11 @@ namespace NLGUI
|
|||
{
|
||||
CXMLAutoPtr ptr( (char*) xmlGetProp( cur, BAD_CAST "on_wheel_up" ) );
|
||||
if( ptr != NULL )
|
||||
mapAHString( "on_wheel_up", std::string( ptr ) );
|
||||
mapAHString( "on_wheel_up", std::string( (const char*)ptr ) );
|
||||
|
||||
ptr = (char*) xmlGetProp( cur, BAD_CAST "on_wheel_down" );
|
||||
if( ptr != NULL )
|
||||
mapAHString( "on_wheel_down", std::string( ptr ) );
|
||||
mapAHString( "on_wheel_down", std::string( (const char*)ptr ) );
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -362,13 +362,13 @@ namespace NLGUI
|
|||
ptr = (char*) xmlGetProp( cur, (xmlChar*)"posparent" );
|
||||
if (ptr)
|
||||
{
|
||||
setPosParent( std::string( ptr ) );
|
||||
setPosParent( std::string( (const char*)ptr ) );
|
||||
}
|
||||
|
||||
ptr = (char*) xmlGetProp( cur, (xmlChar*)"sizeparent" );
|
||||
if (ptr)
|
||||
{
|
||||
setSizeParent( std::string( ptr ) );
|
||||
setSizeParent( std::string( (const char*)ptr ) );
|
||||
}
|
||||
|
||||
ptr = (char*) xmlGetProp (cur, (xmlChar*)"sizeref");
|
||||
|
|
|
@ -348,27 +348,27 @@ namespace NLGUI
|
|||
{
|
||||
ptr = (char*) xmlGetProp( cur, BAD_CAST "on_active" );
|
||||
if( ptr != NULL )
|
||||
mapAHString( "on_active", std::string( ptr ) );
|
||||
mapAHString( "on_active", std::string( (const char*)ptr ) );
|
||||
|
||||
ptr = (char*) xmlGetProp( cur, BAD_CAST "on_deactive" );
|
||||
if( ptr != NULL )
|
||||
mapAHString( "on_deactive", std::string( ptr ) );
|
||||
mapAHString( "on_deactive", std::string( (const char*)ptr ) );
|
||||
|
||||
ptr = (char*) xmlGetProp( cur, BAD_CAST "group_onclick_r" );
|
||||
if( ptr != NULL )
|
||||
mapAHString( "group_onclick_r", std::string( ptr ) );
|
||||
mapAHString( "group_onclick_r", std::string( (const char*)ptr ) );
|
||||
|
||||
ptr = (char*) xmlGetProp( cur, BAD_CAST "group_onclick_l" );
|
||||
if( ptr != NULL )
|
||||
mapAHString( "group_onclick_l", std::string( ptr ) );
|
||||
mapAHString( "group_onclick_l", std::string( (const char*)ptr ) );
|
||||
|
||||
ptr = (char*) xmlGetProp( cur, BAD_CAST "on_enter" );
|
||||
if( ptr != NULL )
|
||||
mapAHString( "on_enter", std::string( ptr ) );
|
||||
mapAHString( "on_enter", std::string( (const char*)ptr ) );
|
||||
|
||||
ptr = (char*) xmlGetProp( cur, BAD_CAST "on_escape" );
|
||||
if( ptr != NULL )
|
||||
mapAHString( "on_escape", std::string( ptr ) );
|
||||
mapAHString( "on_escape", std::string( (const char*)ptr ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -562,7 +562,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "on_active" )
|
||||
{
|
||||
_AHOnActive = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnActive = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( name, value );
|
||||
return;
|
||||
}
|
||||
|
@ -575,7 +576,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "on_deactive" )
|
||||
{
|
||||
_AHOnDeactive = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnDeactive = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( name, value );
|
||||
return;
|
||||
}
|
||||
|
@ -623,7 +625,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "group_onclick_r" )
|
||||
{
|
||||
_AHOnRightClick = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnRightClick = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( name, value );
|
||||
return;
|
||||
}
|
||||
|
@ -636,7 +639,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "group_onclick_l" )
|
||||
{
|
||||
_AHOnLeftClick = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnLeftClick = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( name, value );
|
||||
return;
|
||||
}
|
||||
|
@ -649,7 +653,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "on_enter" )
|
||||
{
|
||||
_AHOnEnter = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnEnter = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( name, value );
|
||||
return;
|
||||
}
|
||||
|
@ -678,7 +683,8 @@ namespace NLGUI
|
|||
else
|
||||
if( name == "on_escape" )
|
||||
{
|
||||
_AHOnEscape = CAHManager::getInstance()->getAH( value, std::string() );
|
||||
std::string dummy;
|
||||
_AHOnEscape = CAHManager::getInstance()->getAH( value, dummy );
|
||||
mapAHString( name, value );
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1000,7 +1000,7 @@ namespace NLGUI
|
|||
std::string target;
|
||||
if( ptr != NULL )
|
||||
{
|
||||
target = std::string( ptr );
|
||||
target = std::string( (const char*)ptr );
|
||||
if( !editorMode )
|
||||
CInterfaceLink::splitLinkTargets(std::string((const char*)ptr), parentGroup, targets);
|
||||
}
|
||||
|
@ -1134,17 +1134,17 @@ namespace NLGUI
|
|||
|
||||
ptr = xmlGetProp( cur, BAD_CAST "entry" );
|
||||
if( ptr != NULL )
|
||||
data.entry = std::string( ptr );
|
||||
data.entry = std::string( (const char*)ptr );
|
||||
|
||||
data.type = type;
|
||||
|
||||
ptr = xmlGetProp( cur, BAD_CAST "value" );
|
||||
if( ptr != NULL )
|
||||
data.value = std::string( ptr );
|
||||
data.value = std::string( (const char*)ptr );
|
||||
|
||||
ptr = xmlGetProp( cur, BAD_CAST "size" );
|
||||
if( ptr != NULL )
|
||||
fromString( std::string( ptr ), data.size );
|
||||
fromString( std::string( (const char*)ptr ), data.size );
|
||||
|
||||
variableCache[ data.entry ] = data;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include "nel/gui/lua_ihm.h"
|
||||
#include "nel/gui/view_pointer_base.h"
|
||||
|
||||
#include <limits>
|
||||
|
||||
using namespace std;
|
||||
using namespace NLMISC;
|
||||
using namespace NL3D;
|
||||
|
|
|
@ -426,6 +426,8 @@ void CEntityManager::initialize(uint nbMaxEntity)
|
|||
_Entities.resize(_NbMaxEntity, 0);
|
||||
_EntityGroundFXHandle.resize(_NbMaxEntity);
|
||||
}
|
||||
|
||||
ICDBNode::CTextId textId;
|
||||
|
||||
// Add an observer on the mission database
|
||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
||||
|
@ -433,21 +435,28 @@ void CEntityManager::initialize(uint nbMaxEntity)
|
|||
for (i=0; i<MAX_NUM_MISSIONS; i++)
|
||||
for (j=0; j<MAX_NUM_MISSION_TARGETS; j++)
|
||||
{
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&MissionTargetObserver, ICDBNode::CTextId( "SERVER:MISSIONS:"+toString(i)+":TARGET"+toString(j)+":TITLE" ) );
|
||||
textId = ICDBNode::CTextId( "SERVER:MISSIONS:"+toString(i)+":TARGET"+toString(j)+":TITLE" );
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&MissionTargetObserver, textId );
|
||||
}
|
||||
|
||||
// Add an Observer to the Team database
|
||||
for (i=0; i<MaxNumPeopleInTeam; i++)
|
||||
{
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&TeamUIDObserver, ICDBNode::CTextId( toString(TEAM_DB_PATH ":%d:UID", i) ) );
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&TeamPresentObserver, ICDBNode::CTextId( toString(TEAM_DB_PATH ":%d:NAME", i) ));
|
||||
textId = ICDBNode::CTextId( toString(TEAM_DB_PATH ":%d:UID", i) );
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&TeamUIDObserver, textId );
|
||||
|
||||
textId = ICDBNode::CTextId( toString(TEAM_DB_PATH ":%d:NAME", i) );
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&TeamPresentObserver, textId );
|
||||
}
|
||||
|
||||
// Add an Observer to the Animal database
|
||||
for (i=0; i<MAX_INVENTORY_ANIMAL; i++)
|
||||
{
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&AnimalUIDObserver, ICDBNode::CTextId( toString("SERVER:PACK_ANIMAL:BEAST%d:UID",i) ));
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&AnimalStatusObserver, ICDBNode::CTextId( toString("SERVER:PACK_ANIMAL:BEAST%d:STATUS",i) ));
|
||||
textId = ICDBNode::CTextId( toString("SERVER:PACK_ANIMAL:BEAST%d:UID",i) );
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&AnimalUIDObserver, textId );
|
||||
|
||||
textId = ICDBNode::CTextId( toString("SERVER:PACK_ANIMAL:BEAST%d:STATUS",i) );
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&AnimalStatusObserver, textId );
|
||||
}
|
||||
|
||||
}// initialize //
|
||||
|
|
|
@ -86,12 +86,14 @@ bool CGroupPhraseSkillFilter::parse (xmlNodePtr cur, CInterfaceGroup *parentGrou
|
|||
|
||||
// Add observer on each Brick Families because if some brick is learned, a new skill may be displayed
|
||||
string sTmp;
|
||||
ICDBNode::CTextId textId;
|
||||
for (uint k = 0; k < BRICK_FAMILIES::NbFamilies; ++k)
|
||||
{
|
||||
_BrickFamilyObs[k].Owner= this;
|
||||
_BrickFamilyObs[k].BrickFamily= (BRICK_FAMILIES::TBrickFamily)k;
|
||||
sTmp = string(DB_BRICKS)+":"+NLMISC::toString((sint32)k)+":BRICKS";
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&(_BrickFamilyObs[k]), ICDBNode::CTextId( sTmp ));
|
||||
textId = ICDBNode::CTextId( sTmp );
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&(_BrickFamilyObs[k]), textId );
|
||||
}
|
||||
|
||||
_MustRebuild = true;
|
||||
|
|
|
@ -86,10 +86,13 @@ bool CGroupSkills::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
|
|||
_SkillsObs.Owner = this;
|
||||
|
||||
string sTmp;
|
||||
ICDBNode::CTextId textId;
|
||||
|
||||
for (uint k = 0; k < SKILLS::NUM_SKILLS; ++k)
|
||||
{
|
||||
sTmp = string(DB_SKILLS)+":"+NLMISC::toString((sint32)k)+":BaseSKILL";
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver (&_SkillsObs, ICDBNode::CTextId( sTmp ));
|
||||
textId = ICDBNode::CTextId( sTmp );
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver (&_SkillsObs, textId );
|
||||
}
|
||||
|
||||
_MustRebuild = true;
|
||||
|
@ -280,10 +283,12 @@ CGroupSkills::~CGroupSkills()
|
|||
|
||||
CInterfaceManager *pIM= CInterfaceManager::getInstance();
|
||||
string sTmp;
|
||||
ICDBNode::CTextId textId;
|
||||
for (uint k = 0; k < SKILLS::NUM_SKILLS; ++k)
|
||||
{
|
||||
sTmp = string(DB_SKILLS)+":"+NLMISC::toString((sint32)k)+":BaseSKILL";
|
||||
NLGUI::CDBManager::getInstance()->getDB()->removeObserver(&_SkillsObs, ICDBNode::CTextId( sTmp ) );
|
||||
textId = ICDBNode::CTextId( sTmp );
|
||||
NLGUI::CDBManager::getInstance()->getDB()->removeObserver(&_SkillsObs, textId );
|
||||
}
|
||||
|
||||
// first remove any nodes from the tree group
|
||||
|
|
|
@ -3520,12 +3520,16 @@ void CInterfaceManager::CServerToLocalAutoCopy::init(const std::string &dbPath)
|
|||
// if found
|
||||
if(_ServerCounter)
|
||||
{
|
||||
ICDBNode::CTextId textId;
|
||||
|
||||
// **** Add Observers on all nodes
|
||||
// add the observers when server node change
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&_ServerObserver, ICDBNode::CTextId( string("SERVER:") + dbPath ) );
|
||||
textId = ICDBNode::CTextId( string("SERVER:") + dbPath );
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&_ServerObserver, textId );
|
||||
|
||||
// add the observers when local node change
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&_LocalObserver, ICDBNode::CTextId( string("LOCAL:") + dbPath ) );
|
||||
textId = ICDBNode::CTextId( string("LOCAL:") + dbPath );
|
||||
NLGUI::CDBManager::getInstance()->getDB()->addObserver(&_LocalObserver, textId );
|
||||
|
||||
// **** Init the Nodes shortcut
|
||||
// Parse all Local Nodes
|
||||
|
|
|
@ -118,6 +118,8 @@ public:
|
|||
|
||||
char * end = ptr.getDatas() + strlen( ptr.getDatas() );
|
||||
char * dataTok = strtok( ptr.getDatas()," ,");
|
||||
NLMISC::ICDBNode::CTextId textId;
|
||||
|
||||
while(dataTok)
|
||||
{
|
||||
std::string data (dataTok);
|
||||
|
@ -160,7 +162,8 @@ public:
|
|||
return NULL;
|
||||
}
|
||||
}
|
||||
if ( ! NLGUI::CDBManager::getInstance()->getDB()->addObserver(obs,NLMISC::ICDBNode::CTextId (data) ) )
|
||||
textId = NLMISC::ICDBNode::CTextId( data );
|
||||
if ( ! NLGUI::CDBManager::getInstance()->getDB()->addObserver(obs,textId ) )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue