diff --git a/nel/src/gui/view_renderer.cpp b/nel/src/gui/view_renderer.cpp index 405781440..ea177dff0 100644 --- a/nel/src/gui/view_renderer.cpp +++ b/nel/src/gui/view_renderer.cpp @@ -883,6 +883,7 @@ namespace NLGUI driver->setCursorScale( CViewRenderer::hwCursorScale ); char bufTmp[256], tgaName[256]; + tgaName[0] = 0; string sTGAname; float uvMinU, uvMinV, uvMaxU, uvMaxV; while (!iFile.eof()) diff --git a/ryzom/client/src/entity_cl.cpp b/ryzom/client/src/entity_cl.cpp index b28d3fda6..5071f771d 100644 --- a/ryzom/client/src/entity_cl.cpp +++ b/ryzom/client/src/entity_cl.cpp @@ -2295,7 +2295,7 @@ void CEntityCL::onStringAvailable(uint /* stringId */, const std::string &value) womanTitle = ( c->getGender() == GSGENDER::female ); } - string replacement = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(_TitleRaw.toUtf8(), womanTitle); + string replacement = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(_TitleRaw, womanTitle); // Sometimes translation contains another title { @@ -2305,11 +2305,11 @@ void CEntityCL::onStringAvailable(uint /* stringId */, const std::string &value) _EntityName = _EntityName = STRING_MANAGER::CStringManagerClient::getLocalizedName(sn.substr(0, pos)); string::size_type pos2 = replacement.find('$', pos + 1); _TitleRaw = replacement.substr(pos+1, pos2 - pos - 1); - replacement = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(_TitleRaw.toUtf8(), womanTitle); + replacement = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(_TitleRaw, womanTitle); } } - _Tags = STRING_MANAGER::CStringManagerClient::getTitleInfos(_TitleRaw.toUtf8(), womanTitle); + _Tags = STRING_MANAGER::CStringManagerClient::getTitleInfos(_TitleRaw, womanTitle); if (!replacement.empty() || !ClientCfg.DebugStringManager) { @@ -2320,7 +2320,7 @@ void CEntityCL::onStringAvailable(uint /* stringId */, const std::string &value) _NameEx = replacement; newtitle = _NameEx.toUtf8(); } - CHARACTER_TITLE::ECharacterTitle titleEnum = CHARACTER_TITLE::toCharacterTitle( _TitleRaw.toUtf8() ); + CHARACTER_TITLE::ECharacterTitle titleEnum = CHARACTER_TITLE::toCharacterTitle( _TitleRaw ); if ( titleEnum >= CHARACTER_TITLE::BeginGmTitle && titleEnum <= CHARACTER_TITLE::EndGmTitle ) { _GMTitle = titleEnum - CHARACTER_TITLE::BeginGmTitle; @@ -2352,13 +2352,13 @@ void CEntityCL::onStringAvailable(uint /* stringId */, const std::string &value) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:player:header_opened:player_title")); - if (pVT != NULL) pVT->setText(_Title.toUtf8()); + if (pVT != NULL) pVT->setText(_Title); CGroupContainer *pGC = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:player")); if (pGC != NULL) pGC->setUCTitle(_EntityName); CSkillManager *pSM = CSkillManager::getInstance(); - pSM->setPlayerTitle(_TitleRaw.toUtf8()); + pSM->setPlayerTitle(_TitleRaw); } // Must rebuild the in scene interface 'cause name has changed diff --git a/ryzom/client/src/entity_cl.h b/ryzom/client/src/entity_cl.h index 3ac01ed25..0f1296780 100644 --- a/ryzom/client/src/entity_cl.h +++ b/ryzom/client/src/entity_cl.h @@ -769,25 +769,25 @@ public: bool isAnOutpostAlly() const; /// Return the entity title - const ucstring &getTitle() const + const std::string &getTitle() const { return _Title; } /// Return the entity tags - const ucstring &getTag(uint8 id) const + const std::string &getTag(uint8 id) const { if (_Tags.size() > id) { return _Tags[id]; } - static ucstring empty; + static const std::string empty; return empty; } /// Return the raw unparsed entity title - const ucstring getTitleRaw() const + const std::string &getTitleRaw() const { - return ucstring(_TitleRaw); + return _TitleRaw; } /// Return true if this entity has a reserved title @@ -933,11 +933,11 @@ protected: // Current Name for the entity std::string _EntityName; // Current entity title - ucstring _Title; + std::string _Title; // Current entity tags std::vector _Tags; // Current entity title string id - ucstring _TitleRaw; + std::string _TitleRaw; // Current permanent content symbol for the entity std::string _PermanentStatutIcon; // Has reserved title? diff --git a/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp b/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp index c5dc116e3..e5021ca00 100644 --- a/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp +++ b/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp @@ -202,7 +202,7 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity) const char *templateName; const char *theTribeName = ""; std::string entityName = entity->getDisplayName(); - std::string entityTitle = entity->getTitle().toUtf8(); + std::string entityTitle = entity->getTitle(); // For some NPC's the name is empty and only a title is given, // in that case, treat the title as the name. diff --git a/ryzom/client/src/interface_v3/interface_manager.cpp b/ryzom/client/src/interface_v3/interface_manager.cpp index 40413914e..a0d36f535 100644 --- a/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/ryzom/client/src/interface_v3/interface_manager.cpp @@ -4218,13 +4218,13 @@ bool CInterfaceManager::parseTokens(string& ucstr) // special case where there is only a title, very rare case for some NPC if (name.empty()) { - name = pTokenSubjectEntity->getTitle().toUtf8(); + name = pTokenSubjectEntity->getTitle(); } token_replacement = name.empty() ? token_replacement : name; } else if (token_param == "title") { - string title = pTokenSubjectEntity->getTitle().toUtf8(); + string title = pTokenSubjectEntity->getTitle(); token_replacement = title.empty() ? token_replacement : title; } else if (token_param == "race") diff --git a/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index c9dc2767e..21322295e 100644 --- a/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -1371,7 +1371,7 @@ int CLuaIHMRyzom::getPlayerName(CLuaState &ls) int CLuaIHMRyzom::getPlayerTitleRaw(CLuaState &ls) { CLuaIHM::checkArgCount(ls, "getPlayerTitleRaw", 0); - ls.push(UserEntity->getTitleRaw().toUtf8()); + ls.push(UserEntity->getTitleRaw()); return 1; } @@ -1379,7 +1379,7 @@ int CLuaIHMRyzom::getPlayerTitleRaw(CLuaState &ls) int CLuaIHMRyzom::getPlayerTitle(CLuaState &ls) { CLuaIHM::checkArgCount(ls, "getPlayerTitle", 0); - ls.push(UserEntity->getTitle().toUtf8()); + ls.push(UserEntity->getTitle()); return 1; } @@ -1453,7 +1453,7 @@ int CLuaIHMRyzom::getTargetTitleRaw(CLuaState &ls) if (!target) return 0; - ls.push(target->getTitleRaw().toUtf8()); + ls.push(target->getTitleRaw()); return 1; } @@ -1465,7 +1465,7 @@ int CLuaIHMRyzom::getTargetTitle(CLuaState &ls) if (!target) return 0; - ls.push(target->getTitle().toUtf8()); + ls.push(target->getTitle()); return 1; } diff --git a/ryzom/client/src/player_cl.cpp b/ryzom/client/src/player_cl.cpp index 437149f16..58deeac56 100644 --- a/ryzom/client/src/player_cl.cpp +++ b/ryzom/client/src/player_cl.cpp @@ -743,7 +743,7 @@ void CPlayerCL::updateVisualPropertyVpa(const NLMISC::TGameCycle &/* gameCycle * } // update title when gender changed - const string replacement = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(_TitleRaw.toUtf8(), _Gender == GSGENDER::female); + const string replacement = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(_TitleRaw, _Gender == GSGENDER::female); if (!replacement.empty() || !ClientCfg.DebugStringManager) { // Get extended name @@ -754,7 +754,7 @@ void CPlayerCL::updateVisualPropertyVpa(const NLMISC::TGameCycle &/* gameCycle * if (_Slot == 0) { CViewText *pVT = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:player:header_opened:player_title")); - if (pVT != NULL) pVT->setText(_Title.toUtf8()); + if (pVT != NULL) pVT->setText(_Title); } // rebuild in scene interface diff --git a/ryzom/client/src/player_r2_cl.cpp b/ryzom/client/src/player_r2_cl.cpp index 8f7621755..75effe9bf 100644 --- a/ryzom/client/src/player_r2_cl.cpp +++ b/ryzom/client/src/player_r2_cl.cpp @@ -446,7 +446,7 @@ void CPlayerR2CL::updateVisualPropertyVpa(const NLMISC::TGameCycle &/* gameCycle } // update title when gender changed - const string replacement(STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(_TitleRaw.toUtf8(),_Gender == GSGENDER::female)); + const string replacement(STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(_TitleRaw,_Gender == GSGENDER::female)); if (!replacement.empty()) { // Get extended name