diff --git a/nel/include/nel/gui/reflect.h b/nel/include/nel/gui/reflect.h index 579a9418b..3f0b936a9 100644 --- a/nel/include/nel/gui/reflect.h +++ b/nel/include/nel/gui/reflect.h @@ -42,9 +42,13 @@ namespace NLGUI UInt32, Float, String, +#ifdef RYZOM_LUA_UCSTRING UCString, +#endif StringRef, +#ifdef RYZOM_LUA_UCSTRING UCStringRef, +#endif RGBA, LuaMethod }; // other types will be added when needed @@ -79,9 +83,13 @@ namespace NLGUI TGetUInt32 GetUInt32; TGetFloat GetFloat; TGetString GetString; +#ifdef RYZOM_LUA_UCSTRING TGetUCString GetUCString; +#endif TGetStringRef GetStringRef; +#ifdef RYZOM_LUA_UCSTRING TGetUCStringRef GetUCStringRef; +#endif TGetRGBA GetRGBA; TLuaMethod GetLuaMethod; // lua method can only be obtained, not written ... } GetMethod; @@ -92,7 +100,9 @@ namespace NLGUI TSetUInt32 SetUInt32; TSetFloat SetFloat; TSetString SetString; +#ifdef RYZOM_LUA_UCSTRING TSetUCString SetUCString; +#endif TSetRGBA SetRGBA; } SetMethod; // name of the property diff --git a/nel/src/gui/interface_expr_user_fct.cpp b/nel/src/gui/interface_expr_user_fct.cpp index f5de62b6f..e2bb589e1 100644 --- a/nel/src/gui/interface_expr_user_fct.cpp +++ b/nel/src/gui/interface_expr_user_fct.cpp @@ -553,15 +553,19 @@ namespace NLGUI case CReflectedProperty::String: result.setString ((elem->*(pRP->GetMethod.GetString))()); break; +#ifdef RYZOM_LUA_UCSTRING case CReflectedProperty::UCString: result.setString ((elem->*(pRP->GetMethod.GetUCString))().toUtf8()); break; +#endif case CReflectedProperty::StringRef: result.setString ((elem->*(pRP->GetMethod.GetStringRef))()); break; +#ifdef RYZOM_LUA_UCSTRING case CReflectedProperty::UCStringRef: result.setString ((elem->*(pRP->GetMethod.GetUCStringRef))().toUtf8()); break; +#endif case CReflectedProperty::RGBA: result.setRGBA ((elem->*(pRP->GetMethod.GetRGBA))()); break; diff --git a/nel/src/gui/interface_link.cpp b/nel/src/gui/interface_link.cpp index c320f8c51..5b9bebb1f 100644 --- a/nel/src/gui/interface_link.cpp +++ b/nel/src/gui/interface_link.cpp @@ -117,18 +117,18 @@ namespace NLGUI return false; } break; +#ifdef RYZOM_LUA_UCSTRING case CReflectedProperty::UCString: case CReflectedProperty::UCStringRef: -#ifdef RYZOM_LUA_UCSTRING if (valueToAffect.toString()) { (destElem.*(property.SetMethod.SetUCString))(ucstring::makeFromUtf8(valueToAffect.getString())); } else -#endif { return false; } +#endif break; case CReflectedProperty::RGBA: if (valueToAffect.toRGBA()) diff --git a/nel/src/gui/lua_ihm.cpp b/nel/src/gui/lua_ihm.cpp index 9a6bacc3c..cdd87330c 100644 --- a/nel/src/gui/lua_ihm.cpp +++ b/nel/src/gui/lua_ihm.cpp @@ -1412,6 +1412,7 @@ namespace NLGUI case CReflectedProperty::String: ls.push( (reflectedObject.*(property.GetMethod.GetString))() ); break; +#ifdef RYZOM_LUA_UCSTRING case CReflectedProperty::UCString: { ucstring str = (reflectedObject.*(property.GetMethod.GetUCString))(); @@ -1434,6 +1435,7 @@ namespace NLGUI #endif } break; +#endif case CReflectedProperty::StringRef: ls.push( (reflectedObject.*(property.GetMethod.GetStringRef))() ); break; @@ -1508,6 +1510,7 @@ namespace NLGUI (target.*(property.SetMethod.SetString))(val); return; } +#ifdef RYZOM_LUA_UCSTRING case CReflectedProperty::UCString: case CReflectedProperty::UCStringRef: { @@ -1532,6 +1535,7 @@ namespace NLGUI (target.*(property.SetMethod.SetUCString))(val); return; } +#endif case CReflectedProperty::RGBA: { CRGBA color; diff --git a/ryzom/client/src/connection.cpp b/ryzom/client/src/connection.cpp index 1ec84433f..d7eaa2969 100644 --- a/ryzom/client/src/connection.cpp +++ b/ryzom/client/src/connection.cpp @@ -1863,8 +1863,9 @@ string getTarget(CCtrlBase * /* ctrl */, const string &targetName) return ""; } +#ifdef RYZOM_LUA_UCSTRING // ------------------------------------------------------------------------------------------------ -ucstring getUCTarget(CCtrlBase * /* ctrl */, const string &targetName) // TODO: UTF-8 Lua +ucstring getUCTarget(CCtrlBase * /* ctrl */, const string &targetName) { string sTmp = targetName; std::vector targetsVector; @@ -1884,6 +1885,7 @@ ucstring getUCTarget(CCtrlBase * /* ctrl */, const string &targetName) // TODO: return ((elem->*(pRP->GetMethod.GetUCString))()); return ucstring(""); // TODO: UTF-8 Lua } +#endif /*// Ask the server to rename a character // ------------------------------------------------------------------------------------------------ @@ -1955,7 +1957,11 @@ public: string sDBLink = getParam(Params, "dblink"); CharNameValidDBLink = sDBLink; +#ifdef RYZOM_LUA_UCSTRING string sName = getUCTarget(NULL,sTarget).toUtf8(); // TODO: UTF-8 Lua +#else + string sName = getTarget(NULL, sTarget); +#endif CInterfaceManager *pIM = CInterfaceManager::getInstance(); if (sName.empty())