develop
kaetemi 4 years ago
parent ad0e970785
commit 72d9f8ea4f

@ -59,10 +59,8 @@ namespace NLGUI
{ {
public: public:
virtual ~IViewTextProvider(){} virtual ~IViewTextProvider(){}
bool getString(uint32 stringId, std::string &result) { ucstring temp; bool res = getString(stringId, temp); result = temp.toUtf8(); return res; } virtual bool getString(uint32 stringId, std::string &result) = 0;
bool getDynString(uint32 dynStringId, std::string &result) { ucstring temp; bool res = getDynString(dynStringId, temp); result = temp.toUtf8(); return res; } virtual bool getDynString(uint32 dynStringId, std::string &result) = 0;
virtual bool getString( uint32 stringId, ucstring &result ) = 0; // TODO: UTF-8
virtual bool getDynString( uint32 dynStringId, ucstring &result ) = 0; // TODO: UTF-8
}; };
CViewTextID(const TCtorParam &param) : CViewText(param) CViewTextID(const TCtorParam &param) : CViewText(param)

@ -253,6 +253,7 @@ void appendToUpper(std::string &res, const std::string &str, ptrdiff_t &i);
/** UTF-8 case insensitive compare */ /** UTF-8 case insensitive compare */
int compareCaseInsensitive(const char *a, const char *b); int compareCaseInsensitive(const char *a, const char *b);
int compareCaseInsensitive(const char *a, size_t lenA, const char *b, size_t lenB); int compareCaseInsensitive(const char *a, size_t lenA, const char *b, size_t lenB);
inline int compareCaseInsensitive(const std::string &a, const std::string &b) { return compareCaseInsensitive(&a[0], a.size(), &b[0], b.size()); }
/** /**

@ -3345,10 +3345,10 @@ class CAHLoadScenario : public IActionHandler
if(val!=0) if(val!=0)
{ {
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
ucstring res; string res;
if (pSMC->getString(val,res)) if (pSMC->getString(val,res))
{ {
string charName = CEntityCL::removeTitleAndShardFromName(res.toUtf8()); string charName = CEntityCL::removeTitleAndShardFromName(res);
sessionBrowser.inviteCharacterByName(sessionBrowser._LastScheduleSessionCharId, charName); sessionBrowser.inviteCharacterByName(sessionBrowser._LastScheduleSessionCharId, charName);
if(!sessionBrowser.waitOneMessage(sessionBrowser.getMessageName("on_invokeResult"))) if(!sessionBrowser.waitOneMessage(sessionBrowser.getMessageName("on_invokeResult")))

@ -130,7 +130,7 @@ void CContextualCursor::del(const std::string &contextName)
// context : // context :
// Select a nex context. // Select a nex context.
//----------------------------------------------- //-----------------------------------------------
bool CContextualCursor::context(const std::string &contextName, float dist, const ucstring &cursName) bool CContextualCursor::context(const std::string &contextName, float dist, const std::string &cursName)
{ {
// Delete the context. // Delete the context.
TContext::iterator it = _Contexts.find(contextName); TContext::iterator it = _Contexts.find(contextName);
@ -163,7 +163,7 @@ bool CContextualCursor::context(const std::string &contextName, float dist, cons
if(cursName.empty()) if(cursName.empty())
cursor->setString(CI18N::get(functions.cursor)); cursor->setString(CI18N::get(functions.cursor));
else else
cursor->setString(cursName.toUtf8()); cursor->setString(cursName);
} }
} }
} }

@ -68,7 +68,7 @@ public:
void del(const std::string &contextName); void del(const std::string &contextName);
// Select a nex context. // Select a nex context.
bool context(const std::string &contextName, float dist = 0, const ucstring &cursName = ucstring("")); bool context(const std::string &contextName, float dist = 0, const std::string &cursName = std::string());
inline const std::string &context() const {return _Context;} inline const std::string &context() const {return _Context;}
// Check if there is an entity under the cursor. // Check if there is an entity under the cursor.

@ -197,7 +197,7 @@ static bool testMissionOption(sint32 priorityWanted)
// Get the Text for the cursor // Get the Text for the cursor
if(textID) if(textID)
{ {
ucstring result; string result;
bool res = STRING_MANAGER::CStringManagerClient::instance()->getDynString(textID, result); bool res = STRING_MANAGER::CStringManagerClient::instance()->getDynString(textID, result);
if (!res) if (!res)
result = NLMISC::CI18N::get("uiMissionOptionNotReceived"); result = NLMISC::CI18N::get("uiMissionOptionNotReceived");
@ -224,7 +224,7 @@ static bool testMissionRing()
uint32 textID = pNL->getValue32(); uint32 textID = pNL->getValue32();
// if the string is not received display a temp string // if the string is not received display a temp string
ucstring missionRingText; string missionRingText;
if(!STRING_MANAGER::CStringManagerClient::instance()->getDynString(textID, missionRingText)) if(!STRING_MANAGER::CStringManagerClient::instance()->getDynString(textID, missionRingText))
missionRingText = NLMISC::CI18N::get("uiMissionRingNameNotReceived"); missionRingText = NLMISC::CI18N::get("uiMissionRingNameNotReceived");
@ -445,7 +445,7 @@ void checkUnderCursor()
uint32 textID = pNL->getValue32(); uint32 textID = pNL->getValue32();
// if the string is not received display a temp string // if the string is not received display a temp string
ucstring webPageText; string webPageText;
if(!STRING_MANAGER::CStringManagerClient::instance()->getDynString(textID, webPageText)) if(!STRING_MANAGER::CStringManagerClient::instance()->getDynString(textID, webPageText))
webPageText = NLMISC::CI18N::get("uiWebPageNameNotReceived"); webPageText = NLMISC::CI18N::get("uiWebPageNameNotReceived");
@ -463,8 +463,8 @@ void checkUnderCursor()
{ {
// get the outpost name // get the outpost name
CSheetId outpostSheet(pNL->getValue32()); CSheetId outpostSheet(pNL->getValue32());
ucstring outpostName; string outpostName;
outpostName= ucstring(STRING_MANAGER::CStringManagerClient::getOutpostLocalizedName(outpostSheet)); outpostName= STRING_MANAGER::CStringManagerClient::getOutpostLocalizedName(outpostSheet);
// display the cursor // display the cursor
if(ContextCur.context("OUTPOST", 0.f, outpostName)) if(ContextCur.context("OUTPOST", 0.f, outpostName))
@ -570,8 +570,7 @@ void checkUnderCursor()
else else
{ {
cursor->setCursor("curs_pick.tga"); cursor->setCursor("curs_pick.tga");
ucstring contextText; string contextText = instref.ContextText;
contextText.fromUtf8(instref.ContextText);
if (ContextCur.context("WEBIG", 0.f, contextText)) if (ContextCur.context("WEBIG", 0.f, contextText))
return; return;
} }

@ -178,7 +178,7 @@ public :
CCompassTarget ct = pGC->getTarget(); CCompassTarget ct = pGC->getTarget();
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
ucstring oldName; string oldName;
if (!pSMC->getDynString(leaf->getOldValue32(), oldName)) if (!pSMC->getDynString(leaf->getOldValue32(), oldName))
{ {
nlwarning("Can't get compass target name"); nlwarning("Can't get compass target name");
@ -201,7 +201,7 @@ public :
{ {
// TODO : maybe the following code could be include in CGroupMap::checkCoords, but it is not called when the map is not visible... // TODO : maybe the following code could be include in CGroupMap::checkCoords, but it is not called when the map is not visible...
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
ucstring name; string name;
if (pSMC->getDynString((*tmpIt)->getValue32(), name)) if (pSMC->getDynString((*tmpIt)->getValue32(), name))
{ {
// if (_AlreadyReceived.count(name) == 0) // if (_AlreadyReceived.count(name) == 0)

@ -713,13 +713,13 @@ void CGameContextMenu::updateContextMenuMissionsOptions( bool forceHide )
uint32 textID = (uint32) _MissionOption[k]->getValue32(); uint32 textID = (uint32) _MissionOption[k]->getValue32();
if (textID) if (textID)
{ {
ucstring result; string result;
bool res = STRING_MANAGER::CStringManagerClient::instance()->getDynString(textID, result); bool res = STRING_MANAGER::CStringManagerClient::instance()->getDynString(textID, result);
if (!res) if (!res)
{ {
result = NLMISC::CI18N::get("uiMissionOptionNotReceived"); result = NLMISC::CI18N::get("uiMissionOptionNotReceived");
} }
pVTM->setText(result.toUtf8()); pVTM->setText(result);
pVTM->setActive(true); pVTM->setActive(true);
} }
else else
@ -754,13 +754,13 @@ void CGameContextMenu::updateContextMenuWebPage(uint options)
uint32 textID = (uint32) _WebPageTitle->getValue32(); uint32 textID = (uint32) _WebPageTitle->getValue32();
if (textID) if (textID)
{ {
ucstring result; string result;
bool res = STRING_MANAGER::CStringManagerClient::instance()->getDynString(textID, result); bool res = STRING_MANAGER::CStringManagerClient::instance()->getDynString(textID, result);
if (!res) if (!res)
{ {
result = NLMISC::CI18N::get("uiWebPageNameNotReceived"); result = NLMISC::CI18N::get("uiWebPageNameNotReceived");
} }
pVTM->setText(result.toUtf8()); pVTM->setText(result);
} }
else else
{ {
@ -834,13 +834,13 @@ void CGameContextMenu::updateContextMenuMissionRing()
// if the textId is ok and Flag is set. // if the textId is ok and Flag is set.
if ( textId ) if ( textId )
{ {
ucstring result; string result;
bool res = STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, result); bool res = STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, result);
if (!res) if (!res)
{ {
result = NLMISC::CI18N::get("uiMissionRingNameNotReceived"); result = NLMISC::CI18N::get("uiMissionRingNameNotReceived");
} }
pVTM->setText(result.toUtf8()); pVTM->setText(result);
pVTM->setActive(true); pVTM->setActive(true);
} }
else else

@ -1943,13 +1943,13 @@ public:
sint32 Slot; sint32 Slot;
bool cbIDStringReceived(ucstring &inout) bool cbIDStringReceived(string &inout)
{ {
if (UserEntity != NULL) if (UserEntity != NULL)
{ {
if (UserEntity->selection() == Slot) if (UserEntity->selection() == Slot)
{ {
ucstring copyInout = inout; string copyInout = inout;
CStringPostProcessRemoveTitle::cbIDStringReceived(inout); CStringPostProcessRemoveTitle::cbIDStringReceived(inout);
if (inout.empty()) if (inout.empty())
{ {
@ -1959,13 +1959,13 @@ public:
if (pChar != NULL) if (pChar != NULL)
womanTitle = pChar->getGender() == GSGENDER::female; womanTitle = pChar->getGender() == GSGENDER::female;
STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(CEntityCL::getTitleFromName(copyInout.toUtf8()), womanTitle); copyInout = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(CEntityCL::getTitleFromName(copyInout), womanTitle);
// Sometimes translation contains another title // Sometimes translation contains another title
ucstring::size_type pos = copyInout.find('$'); string::size_type pos = copyInout.find('$');
if (pos != ucstring::npos) if (pos != ucstring::npos)
{ {
copyInout = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(CEntityCL::getTitleFromName(copyInout.toUtf8()), womanTitle); copyInout = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(CEntityCL::getTitleFromName(copyInout), womanTitle);
} }
CStringPostProcessRemoveTitle::cbIDStringReceived(copyInout); CStringPostProcessRemoveTitle::cbIDStringReceived(copyInout);
@ -1987,7 +1987,7 @@ public:
sint32 Slot; sint32 Slot;
bool cbIDStringReceived(ucstring &inout) bool cbIDStringReceived(string &inout)
{ {
if (UserEntity != NULL) if (UserEntity != NULL)
{ {

@ -3625,11 +3625,11 @@ public:
return; return;
} }
ucstring txt; string txt;
CCDBNodeLeaf *node = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:PACK_ANIMAL:BEAST%d:NAME", index)); CCDBNodeLeaf *node = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:PACK_ANIMAL:BEAST%d:NAME", index));
if (node && CStringManagerClient::instance()->getDynString(node->getValue32(), txt)) if (node && CStringManagerClient::instance()->getDynString(node->getValue32(), txt))
{ {
CWidgetManager::getInstance()->setContextHelpText(CEntityCL::removeTitleFromName(txt.toUtf8())); CWidgetManager::getInstance()->setContextHelpText(CEntityCL::removeTitleFromName(txt));
} }
} }
}; };

@ -1732,10 +1732,11 @@ void CItemMenuInBagInfoWaiter::infoValidated(CDBCtrlSheet* ctrlSheet)
// get the CreatorTextID // get the CreatorTextID
bool isCraftedByUserEntity = false; bool isCraftedByUserEntity = false;
ucstring creatorNameString; string creatorNameString;
if( STRING_MANAGER::CStringManagerClient::instance()->getString ( itemInfo.CreatorName, creatorNameString) ) if( STRING_MANAGER::CStringManagerClient::instance()->getString ( itemInfo.CreatorName, creatorNameString) )
{ {
if ( toLower(UserEntity->getEntityName()+PlayerSelectedHomeShardNameWithParenthesis) == toLower(creatorNameString.toUtf8())) std::string userNameString = UserEntity->getEntityName() + PlayerSelectedHomeShardNameWithParenthesis;
if (NLMISC::compareCaseInsensitive(userNameString, creatorNameString) == 0)
isCraftedByUserEntity = true; isCraftedByUserEntity = true;
} }
@ -1840,10 +1841,11 @@ class CHandlerItemMenuCheck : public IActionHandler
if (getInventory().isItemInfoUpToDate(getInventory().getItemSlotId(pCS))) if (getInventory().isItemInfoUpToDate(getInventory().getItemSlotId(pCS)))
{ {
// get the CreatorTextID // get the CreatorTextID
ucstring creatorNameString; string creatorNameString;
if( STRING_MANAGER::CStringManagerClient::instance()->getString ( getInventory().getItemInfo(getInventory().getItemSlotId(pCS)).CreatorName, creatorNameString) ) if( STRING_MANAGER::CStringManagerClient::instance()->getString ( getInventory().getItemInfo(getInventory().getItemSlotId(pCS)).CreatorName, creatorNameString) )
{ {
if (toLower(UserEntity->getEntityName()+PlayerSelectedHomeShardNameWithParenthesis) == toLower(creatorNameString.toUtf8())) string userNameString = UserEntity->getEntityName() + PlayerSelectedHomeShardNameWithParenthesis;
if (NLMISC::compareCaseInsensitive(userNameString, creatorNameString) == 0)
isTextEditionActive = true; isTextEditionActive = true;
} }
} }

@ -913,10 +913,10 @@ NLMISC_COMMAND(slsn, "Temp : set the name of the last sender.", "<name>")
} }
// *************************************************************************** // ***************************************************************************
bool CStringPostProcessRemoveName::cbIDStringReceived(ucstring &inOut) bool CStringPostProcessRemoveName::cbIDStringReceived(string &inOut)
{ {
// extract the replacement id // extract the replacement id
string strNewTitle = CEntityCL::getTitleFromName(inOut.toUtf8()); string strNewTitle = CEntityCL::getTitleFromName(inOut);
// retrieve the translated string // retrieve the translated string
if (!strNewTitle.empty()) if (!strNewTitle.empty())
@ -927,7 +927,7 @@ bool CStringPostProcessRemoveName::cbIDStringReceived(ucstring &inOut)
ucstring::size_type pos = inOut.find('$'); ucstring::size_type pos = inOut.find('$');
if (pos != ucstring::npos) if (pos != ucstring::npos)
{ {
inOut = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(CEntityCL::getTitleFromName(inOut.toUtf8()), Woman); inOut = STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(CEntityCL::getTitleFromName(inOut), Woman);
} }
} }
} }
@ -938,16 +938,16 @@ bool CStringPostProcessRemoveName::cbIDStringReceived(ucstring &inOut)
} }
// *************************************************************************** // ***************************************************************************
bool CStringPostProcessRemoveTitle::cbIDStringReceived(ucstring &inOut) bool CStringPostProcessRemoveTitle::cbIDStringReceived(string &inOut)
{ {
inOut = CEntityCL::removeTitleAndShardFromName(inOut.toUtf8()); inOut = CEntityCL::removeTitleAndShardFromName(inOut);
return true; return true;
} }
// *************************************************************************** // ***************************************************************************
bool CStringPostProcessNPCRemoveTitle::cbIDStringReceived(ucstring &inOut) bool CStringPostProcessNPCRemoveTitle::cbIDStringReceived(string &inOut)
{ {
ucstring sOut = CEntityCL::removeTitleAndShardFromName(inOut.toUtf8()); string sOut = CEntityCL::removeTitleAndShardFromName(inOut);
if (sOut.empty()) if (sOut.empty())
{ {
CStringPostProcessRemoveName SPPRM; CStringPostProcessRemoveName SPPRM;

@ -157,7 +157,7 @@ class CStringPostProcessRemoveName : public CInterfaceManager::IStringProcess
public: public:
CStringPostProcessRemoveName():Woman(false) {} CStringPostProcessRemoveName():Woman(false) {}
bool Woman; bool Woman;
bool cbIDStringReceived(ucstring &inOut); bool cbIDStringReceived(std::string &inOut);
}; };
// *************************************************************************** // ***************************************************************************
@ -165,7 +165,7 @@ public:
class CStringPostProcessRemoveTitle : public CInterfaceManager::IStringProcess class CStringPostProcessRemoveTitle : public CInterfaceManager::IStringProcess
{ {
public: public:
bool cbIDStringReceived(ucstring &inOut); bool cbIDStringReceived(std::string &inOut);
}; };
// *************************************************************************** // ***************************************************************************
@ -173,7 +173,7 @@ public:
class CStringPostProcessNPCRemoveTitle : public CInterfaceManager::IStringProcess class CStringPostProcessNPCRemoveTitle : public CInterfaceManager::IStringProcess
{ {
public: public:
bool cbIDStringReceived(ucstring &inOut); bool cbIDStringReceived(std::string &inOut);
}; };

@ -164,11 +164,11 @@ void CBotChatPageDynamicMission::update()
{ {
uint32 textID = (uint32) NLGUI::CDBManager::getInstance()->getDbProp(toString(DM_CHOICE "%d:%d:TEXT", (int) k, (int) l))->getValue32(); uint32 textID = (uint32) NLGUI::CDBManager::getInstance()->getDbProp(toString(DM_CHOICE "%d:%d:TEXT", (int) k, (int) l))->getValue32();
// see if text has been receive // see if text has been receive
ucstring result; string result;
bool received = CStringManagerClient::instance()->getDynString(textID, result); bool received = CStringManagerClient::instance()->getDynString(textID, result);
if (received) if (received)
{ {
_ChoiceCB[k]->setText(l, result.toUtf8()); _ChoiceCB[k]->setText(l, result);
_TextReceived[k][l] = true; _TextReceived[k][l] = true;
} }
} }
@ -180,11 +180,11 @@ void CBotChatPageDynamicMission::update()
uint32 textID = (uint32) NLGUI::CDBManager::getInstance()->getDbProp(toString(DM_CHOICE "%d:%d:TEXT", (int) k, (int) l))->getValue32(); uint32 textID = (uint32) NLGUI::CDBManager::getInstance()->getDbProp(toString(DM_CHOICE "%d:%d:TEXT", (int) k, (int) l))->getValue32();
if (textID == 0 && !ClientCfg.Local) break; if (textID == 0 && !ClientCfg.Local) break;
// see if text has been received // see if text has been received
ucstring result; string result;
bool received = CStringManagerClient::instance()->getDynString(textID, result); bool received = CStringManagerClient::instance()->getDynString(textID, result);
if (received) if (received)
{ {
_ChoiceCB[k]->addText(result.toUtf8()); _ChoiceCB[k]->addText(result);
_TextReceived[k][l] = true; _TextReceived[k][l] = true;
} }
else else
@ -207,7 +207,7 @@ void CBotChatPageDynamicMission::update()
uint32 textID = NLGUI::CDBManager::getInstance()->getDbProp(DM_TITLE_DB_PATH)->getValue32(); uint32 textID = NLGUI::CDBManager::getInstance()->getDbProp(DM_TITLE_DB_PATH)->getValue32();
if (textID != 0) if (textID != 0)
{ {
ucstring result; string result;
if (CStringManagerClient::instance()->getDynString(textID, result)) if (CStringManagerClient::instance()->getDynString(textID, result))
{ {
textID = NLGUI::CDBManager::getInstance()->getDbProp(DM_DESCRIPTION_DB_PATH)->getValue32(); textID = NLGUI::CDBManager::getInstance()->getDbProp(DM_DESCRIPTION_DB_PATH)->getValue32();

@ -207,9 +207,9 @@ int CDBCtrlSheet::luaGetCreatorName(CLuaState &ls)
{ {
uint32 itemSlotId = getInventory().getItemSlotId(this); uint32 itemSlotId = getInventory().getItemSlotId(this);
CClientItemInfo itemInfo = getInventory().getItemInfo(itemSlotId); CClientItemInfo itemInfo = getInventory().getItemInfo(itemSlotId);
ucstring creatorName; string creatorName;
STRING_MANAGER::CStringManagerClient::instance()->getString(itemInfo.CreatorName, creatorName); STRING_MANAGER::CStringManagerClient::instance()->getString(itemInfo.CreatorName, creatorName);
CLuaIHM::push(ls, creatorName); CLuaIHM::push(ls, ucstring::makeFromUtf8(creatorName)); // FIXME: Lua UTF-8
return 1; return 1;
} }
@ -1460,7 +1460,7 @@ void CDBCtrlSheet::setupMission()
void CDBCtrlSheet::setupGuildFlag () void CDBCtrlSheet::setupGuildFlag ()
{ {
// Find the guild name // Find the guild name
ucstring usGuildName; string usGuildName;
sint32 nGuildName = _SheetId.getSInt32(); sint32 nGuildName = _SheetId.getSInt32();
if (_LastSheetId != nGuildName || _NeedSetup) if (_LastSheetId != nGuildName || _NeedSetup)
{ {
@ -4570,7 +4570,7 @@ ucstring CDBCtrlSheet::getItemActualName() const
return ucstring(); return ucstring();
else else
{ {
ucstring ret; string ret;
// If NameId not 0, get from StringManager // If NameId not 0, get from StringManager
uint32 nameId= getItemNameId(); uint32 nameId= getItemNameId();
if(nameId) if(nameId)
@ -4602,21 +4602,21 @@ ucstring CDBCtrlSheet::getItemActualName() const
{ {
// get description string for item format // get description string for item format
std::string formatID = getItemRMFaberStatType() != RM_FABER_STAT_TYPE::Unknown ? "uihelpItemFaberPrefixAndSuffix" : "uihelpItemFaberPrefix"; std::string formatID = getItemRMFaberStatType() != RM_FABER_STAT_TYPE::Unknown ? "uihelpItemFaberPrefixAndSuffix" : "uihelpItemFaberPrefix";
ucstring format; string format;
if (!CI18N::hasTranslation(formatID)) if (!CI18N::hasTranslation(formatID))
{ {
format = ucstring("%p %n %s"); // not found, uses default string format = "%p %n %s"; // not found, uses default string
} }
else else
{ {
format = CI18N::get(formatID); format = CI18N::get(formatID);
} }
// suffix // suffix
strFindReplace(format, ucstring("%p"), RM_CLASS_TYPE::toLocalString(getItemRMClassType())); strFindReplace(format, "%p", RM_CLASS_TYPE::toLocalString(getItemRMClassType()));
// name // name
strFindReplace(format, ucstring("%n"), ret); strFindReplace(format, "%n", ret);
// prefix // prefix
strFindReplace(format, ucstring("%s"), CI18N::get(toString("mpstatItemQualifier%d", (int) getItemRMFaberStatType()).c_str())); strFindReplace(format, "%s", CI18N::get(toString("mpstatItemQualifier%d", (int) getItemRMFaberStatType()).c_str()));
ret = format; ret = format;

@ -313,7 +313,7 @@ void CDBGroupListSheetText::updateCoords ()
else else
{ {
// if not received, must insert in list of pending dynstring to check each frame // if not received, must insert in list of pending dynstring to check each frame
ucstring result; string result;
if( !STRING_MANAGER::CStringManagerClient::instance()->getDynString ( curNameId, result) ) if( !STRING_MANAGER::CStringManagerClient::instance()->getDynString ( curNameId, result) )
_NameIdToUpdate.insert( _SheetChildren[i] ); _NameIdToUpdate.insert( _SheetChildren[i] );
} }
@ -492,7 +492,7 @@ void CDBGroupListSheetText::checkCoords ()
{ {
CSheetChild * cst = (*it); CSheetChild * cst = (*it);
// String result // String result
ucstring result; string result;
if( STRING_MANAGER::CStringManagerClient::instance()->getDynString ( cst->NameId, result) ) if( STRING_MANAGER::CStringManagerClient::instance()->getDynString ( cst->NameId, result) )
{ {
set< CSheetChild *>::iterator itTmp = it; set< CSheetChild *>::iterator itTmp = it;

@ -689,10 +689,10 @@ void CDBGroupListSheetTrade::checkCoords ()
{ {
CSheetChildTrade * cst = (*it); CSheetChildTrade * cst = (*it);
// String result // String result
ucstring result; string result;
if( pSMC->getString ( cst->LastVendorNameId, result) ) if( pSMC->getString ( cst->LastVendorNameId, result) )
{ {
cst->VendorNameString = CEntityCL::removeShardFromName(result.toUtf8()); cst->VendorNameString = CEntityCL::removeShardFromName(result);
set< CSheetChildTrade *>::iterator itTmp = it; set< CSheetChildTrade *>::iterator itTmp = it;
++it; ++it;
VendorNameIdToUpdate.erase(itTmp); VendorNameIdToUpdate.erase(itTmp);

@ -194,7 +194,7 @@ void CEncyclopediaManager::rebuildAlbumList()
nlassert(pTree != NULL); nlassert(pTree != NULL);
CGroupTree::SNode *pRoot = new CGroupTree::SNode; CGroupTree::SNode *pRoot = new CGroupTree::SNode;
ucstring res; string res;
// Add all albums // Add all albums
for (uint32 i = 0; i < _Albums.size(); ++i) for (uint32 i = 0; i < _Albums.size(); ++i)
@ -206,7 +206,7 @@ void CEncyclopediaManager::rebuildAlbumList()
if (_Albums[i].Name == _AlbumNameSelected) if (_Albums[i].Name == _AlbumNameSelected)
pAlb->Opened = true; pAlb->Opened = true;
if (pSMC->getDynString(_Albums[i].Name, res)) if (pSMC->getDynString(_Albums[i].Name, res))
pAlb->Text = res.toUtf8(); pAlb->Text = res;
else else
nlwarning("try to construct album without name"); nlwarning("try to construct album without name");
@ -218,7 +218,7 @@ void CEncyclopediaManager::rebuildAlbumList()
pThm->AHName = "ency_click_thema"; pThm->AHName = "ency_click_thema";
pThm->AHParams = toString(_Albums[i].Themas[j].Name); pThm->AHParams = toString(_Albums[i].Themas[j].Name);
if (pSMC->getDynString(_Albums[i].Themas[j].Name, res)) if (pSMC->getDynString(_Albums[i].Themas[j].Name, res))
pThm->Text = res.toUtf8(); pThm->Text = res;
else else
nlwarning("try to construct thema without name"); nlwarning("try to construct thema without name");
@ -426,7 +426,7 @@ bool CEncyclopediaManager::isStringWaiting()
for (uint32 i = 0; i < _Albums.size(); ++i) for (uint32 i = 0; i < _Albums.size(); ++i)
{ {
ucstring res; string res;
if (!pSMC->getDynString(_Albums[i].Name, res)) if (!pSMC->getDynString(_Albums[i].Name, res))
return true; return true;
for (uint32 j = 0; j < _Albums[i].Themas.size(); ++j) for (uint32 j = 0; j < _Albums[i].Themas.size(); ++j)

@ -394,18 +394,18 @@ void CGroupCompas::draw()
// The text // The text
char message[50]; char message[50];
ucstring distText; string distText;
if (displayedTarget.getType() != CCompassTarget::North) if (displayedTarget.getType() != CCompassTarget::North)
{ {
if (dist > 999.0f) if (dist > 999.0f)
{ {
smprintf (message, 50, "%.1f ", dist/1000.0f); smprintf (message, 50, "%.1f ", dist/1000.0f);
distText = ucstring (message) + CI18N::get("uiKilometerUnit"); distText = message + CI18N::get("uiKilometerUnit");
} }
else else
{ {
smprintf (message, 50, "%.0f ", dist); smprintf (message, 50, "%.0f ", dist);
distText = ucstring (message) + CI18N::get("uiMeterUnit"); distText = message + CI18N::get("uiMeterUnit");
} }
distText = distText + " - " + displayedTarget.Name; distText = distText + " - " + displayedTarget.Name;
} }
@ -415,7 +415,7 @@ void CGroupCompas::draw()
} }
if (_DistViewText != distText) if (_DistViewText != distText)
{ {
_DistView->setText(distText.toUtf8()); _DistView->setText(distText);
_DistViewText = distText; _DistViewText = distText;
} }
} }
@ -558,9 +558,9 @@ bool buildCompassTargetFromTeamMember(CCompassTarget &ct, uint teamMemberId)
ct.setPositionState(tracker); ct.setPositionState(tracker);
CStringManagerClient *pSMC = CStringManagerClient::instance(); CStringManagerClient *pSMC = CStringManagerClient::instance();
ucstring name; string name;
if (pSMC->getString(nameNode->getValue32(), name)) if (pSMC->getString(nameNode->getValue32(), name))
ct.Name = CEntityCL::removeTitleAndShardFromName(name.toUtf8()); // TODO : dynamic support for name ct.Name = CEntityCL::removeTitleAndShardFromName(name); // TODO : dynamic support for name
else else
ct.Name = CI18N::get("uiNotReceived"); ct.Name = CI18N::get("uiNotReceived");
return true; return true;
@ -711,7 +711,7 @@ void CGroupCompasMenu::setActive (bool state)
ct.setType(CCompassTarget::North); ct.setType(CCompassTarget::North);
ct.Name = CI18N::get("uiNorth"); ct.Name = CI18N::get("uiNorth");
Targets.push_back(ct); Targets.push_back(ct);
getRootMenu()->addLineAtIndex(lineIndex ++, ct.Name.toUtf8(), "set_compas", toString ("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); getRootMenu()->addLineAtIndex(lineIndex ++, ct.Name, "set_compas", toString ("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str()));
// Home // Home
CCDBNodeLeaf *pos = NLGUI::CDBManager::getInstance()->getDbProp(COMPASS_DB_PATH ":HOME_POINT"); CCDBNodeLeaf *pos = NLGUI::CDBManager::getInstance()->getDbProp(COMPASS_DB_PATH ":HOME_POINT");
sint32 px = (sint32) (pos->getValue64() >> 32); sint32 px = (sint32) (pos->getValue64() >> 32);
@ -721,7 +721,7 @@ void CGroupCompasMenu::setActive (bool state)
ct.setType(CCompassTarget::Home); ct.setType(CCompassTarget::Home);
ct.Name = CI18N::get("uiHome"); ct.Name = CI18N::get("uiHome");
Targets.push_back(ct); Targets.push_back(ct);
getRootMenu()->addLineAtIndex(lineIndex ++, ct.Name.toUtf8(), "set_compas", toString ("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); getRootMenu()->addLineAtIndex(lineIndex ++, ct.Name, "set_compas", toString ("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str()));
} }
// Respawn // Respawn
pos = NLGUI::CDBManager::getInstance()->getDbProp(COMPASS_DB_PATH ":BIND_POINT"); pos = NLGUI::CDBManager::getInstance()->getDbProp(COMPASS_DB_PATH ":BIND_POINT");
@ -732,7 +732,7 @@ void CGroupCompasMenu::setActive (bool state)
ct.setType(CCompassTarget::Respawn); ct.setType(CCompassTarget::Respawn);
ct.Name = CI18N::get("uiRespawn"); ct.Name = CI18N::get("uiRespawn");
Targets.push_back(ct); Targets.push_back(ct);
getRootMenu()->addLineAtIndex(lineIndex ++, ct.Name.toUtf8(), "set_compas", toString ("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); getRootMenu()->addLineAtIndex(lineIndex ++, ct.Name, "set_compas", toString ("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str()));
} }
// As of 6/5/2007 : The option to point the selection is always proposed even if no slot is currently targeted // As of 6/5/2007 : The option to point the selection is always proposed even if no slot is currently targeted
@ -777,7 +777,7 @@ void CGroupCompasMenu::setActive (bool state)
CCDBNodeLeaf *textIDLeaf = NLGUI::CDBManager::getInstance()->getDbProp(baseDbPath + toString(":%d:TARGET%d:TITLE", (int) k, (int) l), false); CCDBNodeLeaf *textIDLeaf = NLGUI::CDBManager::getInstance()->getDbProp(baseDbPath + toString(":%d:TARGET%d:TITLE", (int) k, (int) l), false);
if (textIDLeaf) if (textIDLeaf)
{ {
ucstring name; string name;
if (CStringManagerClient::instance()->getDynString(textIDLeaf->getValue32(), name)) if (CStringManagerClient::instance()->getDynString(textIDLeaf->getValue32(), name))
{ {
CCDBNodeLeaf *leafPosX= NLGUI::CDBManager::getInstance()->getDbProp(baseDbPath + toString(":%d:TARGET%d:X", (int) k, (int) l), false); CCDBNodeLeaf *leafPosX= NLGUI::CDBManager::getInstance()->getDbProp(baseDbPath + toString(":%d:TARGET%d:X", (int) k, (int) l), false);
@ -790,7 +790,7 @@ void CGroupCompasMenu::setActive (bool state)
ct.setPositionState(tracker); ct.setPositionState(tracker);
ct.Name = name; ct.Name = name;
Targets.push_back(ct); Targets.push_back(ct);
missionSubMenu->addLine(ct.Name.toUtf8(), "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); missionSubMenu->addLine(ct.Name, "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str()));
selectable= true; selectable= true;
} }
} }
@ -847,7 +847,7 @@ void CGroupCompasMenu::setActive (bool state)
ct.Pos = currCont->ContLandMarks[k].Pos; ct.Pos = currCont->ContLandMarks[k].Pos;
ct.Name = CStringManagerClient::getPlaceLocalizedName(currCont->ContLandMarks[k].TitleTextID); ct.Name = CStringManagerClient::getPlaceLocalizedName(currCont->ContLandMarks[k].TitleTextID);
Targets.push_back(ct); Targets.push_back(ct);
landMarkSubMenu->addLineAtIndex(contLandMarkIndex++, ct.Name.toUtf8(), "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); landMarkSubMenu->addLineAtIndex(contLandMarkIndex++, ct.Name, "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str()));
selectable= true; selectable= true;
} }
// separator? // separator?
@ -868,9 +868,9 @@ void CGroupCompasMenu::setActive (bool state)
CCompassTarget ct; CCompassTarget ct;
ct.setType(CCompassTarget::UserLandMark); ct.setType(CCompassTarget::UserLandMark);
ct.Pos = sortedLandmarks[k].Pos; ct.Pos = sortedLandmarks[k].Pos;
ct.Name = sortedLandmarks[k].Title; ct.Name = sortedLandmarks[k].Title.toUtf8();
Targets.push_back(ct); Targets.push_back(ct);
landMarkSubMenus[sortedLandmarks[k].Type]->addLine(ct.Name.toUtf8(), "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); landMarkSubMenus[sortedLandmarks[k].Type]->addLine(ct.Name, "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str()));
selectable= true; selectable= true;
} }
} }
@ -901,7 +901,7 @@ void CGroupCompasMenu::setActive (bool state)
if (buildCompassTargetFromTeamMember(ct, k)) if (buildCompassTargetFromTeamMember(ct, k))
{ {
Targets.push_back(ct); Targets.push_back(ct);
teamSubMenu->addLine(ct.Name.toUtf8(), "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); teamSubMenu->addLine(ct.Name, "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str()));
selectable= true; selectable= true;
} }
} }
@ -924,7 +924,7 @@ void CGroupCompasMenu::setActive (bool state)
if (buildCompassTargetFromAnimalMember(ct, k)) if (buildCompassTargetFromAnimalMember(ct, k))
{ {
Targets.push_back(ct); Targets.push_back(ct);
animalSubMenu->addLine(ct.Name.toUtf8(), "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); animalSubMenu->addLine(ct.Name, "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str()));
selectable= true; selectable= true;
} }
} }
@ -952,7 +952,7 @@ void CGroupCompasMenu::setActive (bool state)
CSmartPtr<CDialogEntityPositionState> tracker = new CDialogEntityPositionState( i ); CSmartPtr<CDialogEntityPositionState> tracker = new CDialogEntityPositionState( i );
ct.setPositionState(tracker); ct.setPositionState(tracker);
Targets.push_back(ct); Targets.push_back(ct);
dialogsSubMenu->addLine(ct.Name.toUtf8(), "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str())); dialogsSubMenu->addLine(ct.Name, "set_compas", toString("compass=%s|id=%d|menu=%s", _TargetCompass.c_str(), (int) Targets.size() - 1, _Id.c_str()));
selectable= true; selectable= true;
} }
} }

@ -46,7 +46,7 @@ class CCompassTarget
public: public:
enum TType { North = 0, Selection, Home, Respawn, ContinentLandMark, UserLandMark, PosTracker, NumTypes }; enum TType { North = 0, Selection, Home, Respawn, ContinentLandMark, UserLandMark, PosTracker, NumTypes };
NLMISC::CVector2f Pos; // Used for static target (ie not the current selection, a team member ...) NLMISC::CVector2f Pos; // Used for static target (ie not the current selection, a team member ...)
ucstring Name; std::string Name;
CCompassTarget(); CCompassTarget();
TType getType() const { return _Type; } TType getType() const { return _Type; }
void setType(TType type) { if (type == _Type) return; setPositionState(NULL); _Type = type; } void setType(TType type) { if (type == _Type) return; setPositionState(NULL); _Type = type; }
@ -124,11 +124,11 @@ private:
bool _Blinking; bool _Blinking;
double _StartBlinkTime; double _StartBlinkTime;
ucstring _CurrTargetName; std::string _CurrTargetName;
// The dist text // The dist text
CViewText *_DistView; CViewText *_DistView;
ucstring _DistViewText; std::string _DistViewText;
CViewRadar *_RadarView; CViewRadar *_RadarView;
CViewText *_RadarRangeView; CViewText *_RadarRangeView;

@ -60,7 +60,7 @@ void CGroupHTMLForum::addHTTPGetParams (string &url, bool /*trustedDomain*/)
{ {
ucstring user_name = UserEntity->getLoginName (); ucstring user_name = UserEntity->getLoginName ();
const SGuild &guild = CGuildManager::getInstance()->getGuild(); const SGuild &guild = CGuildManager::getInstance()->getGuild();
string gname = guild.Name.toUtf8(); string gname = guild.Name;
if (!gname.empty()) if (!gname.empty())
{ {
@ -92,7 +92,7 @@ void CGroupHTMLForum::addHTTPPostParams (SFormFields &formfields, bool /*trusted
{ {
ucstring user_name = UserEntity->getLoginName (); ucstring user_name = UserEntity->getLoginName ();
const SGuild &guild = CGuildManager::getInstance()->getGuild(); const SGuild &guild = CGuildManager::getInstance()->getGuild();
string gname = guild.Name.toUtf8(); string gname = guild.Name;
if (!gname.empty()) if (!gname.empty())
{ {

@ -456,7 +456,7 @@ void CGroupInSceneBubbleManager::update ()
{ {
if (_DynBubbles[i].DescWaiting != 0) if (_DynBubbles[i].DescWaiting != 0)
{ {
ucstring res; string res;
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
if (pSMC->getDynString(_DynBubbles[i].DescWaiting,res)) if (pSMC->getDynString(_DynBubbles[i].DescWaiting,res))
{ {
@ -1317,14 +1317,14 @@ class CAHDynChatClickOption : public IActionHandler
if (isBGDownloadEnabled()) if (isBGDownloadEnabled())
{ {
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
ucstring result; string result;
if (!pSMC->getDynString(optStrId, result)) if (!pSMC->getDynString(optStrId, result))
{ {
return; // shouldn't happen since the button isn't visible as long as the text has not been received ... return; // shouldn't happen since the button isn't visible as long as the text has not been received ...
} }
static volatile bool forceWarning = false; // for debug static volatile bool forceWarning = false; // for debug
ucstring::size_type pos= result.find(ucstring("{ros_exit}")); string::size_type pos= result.find("{ros_exit}");
if(pos != ucstring::npos || forceWarning) if(pos != string::npos || forceWarning)
{ {
if (AvailablePatchs != 0) if (AvailablePatchs != 0)
{ {
@ -1334,7 +1334,7 @@ class CAHDynChatClickOption : public IActionHandler
} }
} }
const string sMsg = "BOTCHAT:DYNCHAT_SEND"; static const string sMsg = "BOTCHAT:DYNCHAT_SEND";
CBitMemStream out; CBitMemStream out;
if(GenericMsgHeaderMngr.pushNameToStream(sMsg, out)) if(GenericMsgHeaderMngr.pushNameToStream(sMsg, out))
{ {

@ -992,9 +992,9 @@ void CGroupInSceneUserInfo::updateDynamicData ()
if (_GuildName) if (_GuildName)
{ {
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
ucstring ucsTmp; string ucsTmp;
if (pSMC->getString (_Entity->getGuildNameID(), ucsTmp)) if (pSMC->getString (_Entity->getGuildNameID(), ucsTmp))
_GuildName->setText(ucsTmp.toUtf8()); _GuildName->setText(ucsTmp);
// guildname color is the pvp color // guildname color is the pvp color
_GuildName->setColor(entityColor); _GuildName->setColor(entityColor);
@ -1018,9 +1018,9 @@ void CGroupInSceneUserInfo::updateDynamicData ()
if (_EventFaction) if (_EventFaction)
{ {
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
ucstring ucsTmp; string ucsTmp;
if (pSMC->getString (_Entity->getEventFactionID(), ucsTmp)) if (pSMC->getString(_Entity->getEventFactionID(), ucsTmp))
_EventFaction->setText(ucsTmp.toUtf8()); _EventFaction->setText(ucsTmp);
// guildname color depends of PVP faction or not // guildname color depends of PVP faction or not
_EventFaction->setColor(entityColor); _EventFaction->setColor(entityColor);

@ -1176,10 +1176,10 @@ void CGroupMap::checkCoords()
// update text if needed // update text if needed
if (!_MissionTargetTextReceived[k]) if (!_MissionTargetTextReceived[k])
{ {
ucstring result; string result;
if (STRING_MANAGER::CStringManagerClient::instance()->getDynString(_MissionTargetTextIDs[k], result)) if (STRING_MANAGER::CStringManagerClient::instance()->getDynString(_MissionTargetTextIDs[k], result))
{ {
_MissionLM[k]->setDefaultContextHelp(result.toUtf8()); _MissionLM[k]->setDefaultContextHelp(result);
_MissionTargetTextReceived[k] = true; _MissionTargetTextReceived[k] = true;
} }
} }
@ -1401,11 +1401,11 @@ void CGroupMap::checkCoords()
CInterfaceManager *im = CInterfaceManager::getInstance(); CInterfaceManager *im = CInterfaceManager::getInstance();
uint32 val = NLGUI::CDBManager::getInstance()->getDbProp(NLMISC::toString("SERVER:GROUP:%d:NAME",i))->getValue32(); uint32 val = NLGUI::CDBManager::getInstance()->getDbProp(NLMISC::toString("SERVER:GROUP:%d:NAME",i))->getValue32();
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
ucstring res; string res;
if (pSMC->getString(val,res)) if (pSMC->getString(val, res))
{ {
std::string res2 = CEntityCL::removeTitleAndShardFromName(res.toUtf8()); std::string res2 = CEntityCL::removeTitleAndShardFromName(res);
_TeammateLM[i]->setDefaultContextHelp(res2); _TeammateLM[i]->setDefaultContextHelp(res2);
} }
} }
@ -3197,7 +3197,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm)
if (it != _ContinentLM.end()) if (it != _ContinentLM.end())
{ {
ct.setType(CCompassTarget::ContinentLandMark); ct.setType(CCompassTarget::ContinentLandMark);
(*it)->getContextHelpAsUtf16(ct.Name); (*it)->getContextHelp(ct.Name);
mapToWorld(ct.Pos, (*it)->Pos); mapToWorld(ct.Pos, (*it)->Pos);
found = true; found = true;
} }
@ -3210,7 +3210,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm)
if (it != _MissionLM.end()) if (it != _MissionLM.end())
{ {
ct.setPositionState(_MissionPosStates[it - _MissionLM.begin()]); ct.setPositionState(_MissionPosStates[it - _MissionLM.begin()]);
(*it)->getContextHelpAsUtf16(ct.Name); (*it)->getContextHelp(ct.Name);
mapToWorld(ct.Pos, (*it)->Pos); mapToWorld(ct.Pos, (*it)->Pos);
found = true; found = true;
} }
@ -3224,7 +3224,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm)
if (it != _UserLM.end()) if (it != _UserLM.end())
{ {
ct.setType(CCompassTarget::UserLandMark); ct.setType(CCompassTarget::UserLandMark);
(*it)->getContextHelpAsUtf16(ct.Name); (*it)->getContextHelp(ct.Name);
mapToWorld(ct.Pos, (*it)->Pos); mapToWorld(ct.Pos, (*it)->Pos);
found = true; found = true;
} }
@ -3252,7 +3252,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm)
if (!isIsland()) if (!isIsland())
{ {
ct.setType(CCompassTarget::Respawn); ct.setType(CCompassTarget::Respawn);
(*it)->getContextHelpAsUtf16(ct.Name); (*it)->getContextHelp(ct.Name);
mapToWorld(ct.Pos, (*it)->Pos); mapToWorld(ct.Pos, (*it)->Pos);
found = true; found = true;
} }
@ -3298,7 +3298,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm)
{ {
if(_AnimalLM[i]==lm) if(_AnimalLM[i]==lm)
{ {
_AnimalLM[i]->getContextHelpAsUtf16(ct.Name); _AnimalLM[i]->getContextHelp(ct.Name);
// copy The Animal Pos retriever into the compass // copy The Animal Pos retriever into the compass
ct.setPositionState(_AnimalPosStates[i]); ct.setPositionState(_AnimalPosStates[i]);
found = true; found = true;
@ -3316,7 +3316,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm)
{ {
if(_TeammateLM[i]==lm) if(_TeammateLM[i]==lm)
{ {
_TeammateLM[i]->getContextHelpAsUtf16(ct.Name); _TeammateLM[i]->getContextHelp(ct.Name);
// copy The Animal Pos retriever into the compass // copy The Animal Pos retriever into the compass
ct.setPositionState(_TeammatePosStates[i]); ct.setPositionState(_TeammatePosStates[i]);
found = true; found = true;
@ -3346,7 +3346,7 @@ void CGroupMap::targetLandmarkResult(uint32 index)
CCompassTarget ct; CCompassTarget ct;
ct.Pos = _MatchedLandmarks[index].Pos; ct.Pos = _MatchedLandmarks[index].Pos;
ct.Name = _MatchedLandmarks[index].Title; ct.Name = _MatchedLandmarks[index].Title.toUtf8();
// type sets compass arrow color // type sets compass arrow color
ct.setType(CCompassTarget::UserLandMark); ct.setType(CCompassTarget::UserLandMark);
@ -3440,7 +3440,7 @@ bool CGroupMap::targetLandmarkByName(const ucstring &search, bool startsWith) co
{ {
ct.setType(CCompassTarget::UserLandMark); ct.setType(CCompassTarget::UserLandMark);
mapToWorld(ct.Pos, lm->Pos); mapToWorld(ct.Pos, lm->Pos);
lm->getContextHelpAsUtf16(ct.Name); lm->getContextHelp(ct.Name);
closest = dist; closest = dist;
found = true; found = true;
} }
@ -3453,7 +3453,7 @@ bool CGroupMap::targetLandmarkByName(const ucstring &search, bool startsWith) co
{ {
ct.setType(CCompassTarget::ContinentLandMark); ct.setType(CCompassTarget::ContinentLandMark);
mapToWorld(ct.Pos, lm->Pos); mapToWorld(ct.Pos, lm->Pos);
lm->getContextHelpAsUtf16(ct.Name); lm->getContextHelp(ct.Name);
closest = dist; closest = dist;
found = true; found = true;
} }
@ -3464,7 +3464,7 @@ bool CGroupMap::targetLandmarkByName(const ucstring &search, bool startsWith) co
{ {
ct.setType(CCompassTarget::ContinentLandMark); ct.setType(CCompassTarget::ContinentLandMark);
mapToWorld(ct.Pos, lmt->Pos); mapToWorld(ct.Pos, lmt->Pos);
ct.Name = CUtfStringView(lmt->getText()).toUtf16(); ct.Name = lmt->getText();
closest = dist; closest = dist;
found = true; found = true;
} }

@ -245,11 +245,11 @@ bool CGuildManager::isLeaderOfTheGuild()
} }
// *************************************************************************** // ***************************************************************************
ucstring CGuildManager::getGuildName() string CGuildManager::getGuildName()
{ {
if (_InGuild) if (_InGuild)
return _Guild.Name; return _Guild.Name;
return ucstring(""); return string();
} }
// *************************************************************************** // ***************************************************************************
@ -359,7 +359,7 @@ void CGuildManager::update()
for (uint i = 0; i < _GuildMembers.size(); ++i) for (uint i = 0; i < _GuildMembers.size(); ++i)
{ {
if (!pSMC->getString (_GuildMembers[i].NameID, _GuildMembers[i].Name)) bAllValid = false; if (!pSMC->getString (_GuildMembers[i].NameID, _GuildMembers[i].Name)) bAllValid = false;
else _GuildMembers[i].Name = CEntityCL::removeTitleAndShardFromName(_GuildMembers[i].Name.toUtf8()); else _GuildMembers[i].Name = CEntityCL::removeTitleAndShardFromName(_GuildMembers[i].Name);
} }
// If all is valid no more need update and if guild is opened update the interface // If all is valid no more need update and if guild is opened update the interface
@ -369,13 +369,13 @@ void CGuildManager::update()
if (node && node->getValueBool()) if (node && node->getValueBool())
{ {
// See if we need to show any online/offline messages // See if we need to show any online/offline messages
static map<ucstring, SGuildMember> CachedGuildMembers; static map<string, SGuildMember> CachedGuildMembers;
const string &onlineMessage = CI18N::get("uiPlayerOnline"); const string &onlineMessage = CI18N::get("uiPlayerOnline");
const string &offlineMessage = CI18N::get("uiPlayerOffline"); const string &offlineMessage = CI18N::get("uiPlayerOffline");
for (uint i = 0; i < _GuildMembers.size(); ++i) for (uint i = 0; i < _GuildMembers.size(); ++i)
{ {
map<ucstring, SGuildMember>::const_iterator it = CachedGuildMembers.find(_GuildMembers[i].Name); map<string, SGuildMember>::const_iterator it = CachedGuildMembers.find(_GuildMembers[i].Name);
if ( it != CachedGuildMembers.end() ) if ( it != CachedGuildMembers.end() )
{ {
if ( (*it).second.Online == _GuildMembers[i].Online) if ( (*it).second.Online == _GuildMembers[i].Online)
@ -391,7 +391,7 @@ void CGuildManager::update()
} }
string msg = (_GuildMembers[i].Online != ccs_offline) ? onlineMessage : offlineMessage; string msg = (_GuildMembers[i].Online != ccs_offline) ? onlineMessage : offlineMessage;
strFindReplace(msg, "%s", _GuildMembers[i].Name.toUtf8()); strFindReplace(msg, "%s", _GuildMembers[i].Name);
string cat = getStringCategory(msg, msg); string cat = getStringCategory(msg, msg);
map<string, CClientConfig::SSysInfoParam>::const_iterator it; map<string, CClientConfig::SSysInfoParam>::const_iterator it;
NLMISC::CRGBA col = CRGBA::Yellow; NLMISC::CRGBA col = CRGBA::Yellow;
@ -418,7 +418,7 @@ void CGuildManager::update()
{ {
uint i; uint i;
_Grade = EGSPD::CGuildGrade::Member; _Grade = EGSPD::CGuildGrade::Member;
ucstring sUserName = toLower(UserEntity->getEntityName()); string sUserName = toLower(UserEntity->getEntityName());
for (i = 0; i < _GuildMembers.size(); ++i) for (i = 0; i < _GuildMembers.size(); ++i)
{ {
if (toLower(_GuildMembers[i].Name) == sUserName) if (toLower(_GuildMembers[i].Name) == sUserName)
@ -471,7 +471,7 @@ void CGuildManager::update()
{ {
CViewText *pJoinPropPhraseView = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId(VIEW_JOIN_PROPOSAL_PHRASE)); CViewText *pJoinPropPhraseView = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId(VIEW_JOIN_PROPOSAL_PHRASE));
if (pJoinPropPhraseView != NULL) if (pJoinPropPhraseView != NULL)
pJoinPropPhraseView->setText(_JoinPropPhrase.toUtf8()); pJoinPropPhraseView->setText(_JoinPropPhrase);
pJoinProp->setActive(true); pJoinProp->setActive(true);
CWidgetManager::getInstance()->setTopWindow(pJoinProp); CWidgetManager::getInstance()->setTopWindow(pJoinProp);
@ -722,10 +722,10 @@ bool CDBGroupListAscensor::CSheetChildAscensor::isInvalidated(CDBGroupListSheetT
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
uint32 nameID = NLGUI::CDBManager::getInstance()->getDbProp("LOCAL:ASCENSOR:" + toString(Index) + ":NAME")->getValue32(); uint32 nameID = NLGUI::CDBManager::getInstance()->getDbProp("LOCAL:ASCENSOR:" + toString(Index) + ":NAME")->getValue32();
ucstring name; string name;
if (nameID && pSMC->getDynString(nameID, name)) if (nameID && pSMC->getDynString(nameID, name))
{ {
Text->setText(name.toUtf8()); Text->setText(name);
uint64 icon = NLGUI::CDBManager::getInstance()->getDbProp("LOCAL:ASCENSOR:" + toString(Index) + ":ICON")->getValue64(); uint64 icon = NLGUI::CDBManager::getInstance()->getDbProp("LOCAL:ASCENSOR:" + toString(Index) + ":ICON")->getValue64();
@ -831,7 +831,7 @@ class CAHGuildSheetOpen : public IActionHandler
// Set name // Set name
CViewText *pViewName = dynamic_cast<CViewText*>(pLine->getView(TEMPLATE_GUILD_MEMBER_NAME)); CViewText *pViewName = dynamic_cast<CViewText*>(pLine->getView(TEMPLATE_GUILD_MEMBER_NAME));
if (pViewName != NULL) if (pViewName != NULL)
pViewName->setText (rGuildMembers[i].Name.toUtf8()); pViewName->setText (rGuildMembers[i].Name);
// Set Grade // Set Grade
CViewText *pViewGrade = dynamic_cast<CViewText*>(pLine->getView(TEMPLATE_GUILD_MEMBER_GRADE)); CViewText *pViewGrade = dynamic_cast<CViewText*>(pLine->getView(TEMPLATE_GUILD_MEMBER_GRADE));
@ -875,7 +875,7 @@ class CAHGuildSheetOpen : public IActionHandler
CCtrlBase *inviteButton = pLine->getCtrl("invite_button"); CCtrlBase *inviteButton = pLine->getCtrl("invite_button");
if (inviteButton != NULL) if (inviteButton != NULL)
inviteButton->setActive(rGuildMembers[i].Online != ccs_offline && rGuildMembers[i].Name.toUtf8() != UserEntity->getEntityName()); inviteButton->setActive(rGuildMembers[i].Online != ccs_offline && rGuildMembers[i].Name != UserEntity->getEntityName());
// Enter Date // Enter Date
CViewText *pViewEnterDate = dynamic_cast<CViewText*>(pLine->getView(TEMPLATE_GUILD_MEMBER_ENTER_DATE)); CViewText *pViewEnterDate = dynamic_cast<CViewText*>(pLine->getView(TEMPLATE_GUILD_MEMBER_ENTER_DATE));
@ -883,13 +883,13 @@ class CAHGuildSheetOpen : public IActionHandler
{ {
CRyzomTime rt; CRyzomTime rt;
rt.updateRyzomClock(rGuildMembers[i].EnterDate); rt.updateRyzomClock(rGuildMembers[i].EnterDate);
ucstring str = toString("%04d", rt.getRyzomYear()) + " "; string str = toString("%04d", rt.getRyzomYear()) + " ";
str += CI18N::get("uiJenaYear") + " : "; str += CI18N::get("uiJenaYear") + " : ";
str += CI18N::get("uiAtysianCycle") + " "; str += CI18N::get("uiAtysianCycle") + " ";
str += toString("%01d", rt.getRyzomCycle()+1) +", "; str += toString("%01d", rt.getRyzomCycle()+1) +", ";
str += CI18N::get("ui"+MONTH::toString( (MONTH::EMonth)rt.getRyzomMonthInCurrentCycle() )) + ", "; str += CI18N::get("ui"+MONTH::toString( (MONTH::EMonth)rt.getRyzomMonthInCurrentCycle() )) + ", ";
str += toString("%02d", rt.getRyzomDayOfMonth()+1); str += toString("%02d", rt.getRyzomDayOfMonth()+1);
pViewEnterDate->setText(str.toUtf8()); pViewEnterDate->setText(str);
} }
// Add to the list // Add to the list
@ -989,12 +989,12 @@ class CAHGuildSheetMenuOpen : public IActionHandler
public: public:
// Current selection // Current selection
static sint32 MemberIndexSelected; // Index of the member selected when right clicked static sint32 MemberIndexSelected; // Index of the member selected when right clicked
static ucstring MemberNameSelected; // Name of the member selected when right clicked (for extra check) static std::string MemberNameSelected; // Name of the member selected when right clicked (for extra check)
}; };
REGISTER_ACTION_HANDLER (CAHGuildSheetMenuOpen, "guild_member_menu_open"); REGISTER_ACTION_HANDLER (CAHGuildSheetMenuOpen, "guild_member_menu_open");
sint32 CAHGuildSheetMenuOpen::MemberIndexSelected= -1; sint32 CAHGuildSheetMenuOpen::MemberIndexSelected= -1;
ucstring CAHGuildSheetMenuOpen::MemberNameSelected; std::string CAHGuildSheetMenuOpen::MemberNameSelected;
// *************************************************************************** // ***************************************************************************
@ -1084,17 +1084,17 @@ public:
MemberIndexSelected= nLineNb; MemberIndexSelected= nLineNb;
MemberNameSelected = rGuildMembers[nLineNb].Name; MemberNameSelected = rGuildMembers[nLineNb].Name;
CPeopleInterraction::displayTellInMainChat(MemberNameSelected.toUtf8()); CPeopleInterraction::displayTellInMainChat(MemberNameSelected);
} }
// Current selection // Current selection
static sint32 MemberIndexSelected; // Index of the member selected when left clicked static sint32 MemberIndexSelected; // Index of the member selected when left clicked
static ucstring MemberNameSelected; // Name of the member selected when lef clicked static std::string MemberNameSelected; // Name of the member selected when lef clicked
}; };
REGISTER_ACTION_HANDLER(CAHGuildSheetTellMember, "guild_tell_member"); REGISTER_ACTION_HANDLER(CAHGuildSheetTellMember, "guild_tell_member");
sint32 CAHGuildSheetTellMember::MemberIndexSelected= -1; sint32 CAHGuildSheetTellMember::MemberIndexSelected= -1;
ucstring CAHGuildSheetTellMember::MemberNameSelected; string CAHGuildSheetTellMember::MemberNameSelected;
// *************************************************************************** // ***************************************************************************
class CAHGuildSheetSetLeader : public IActionHandler class CAHGuildSheetSetLeader : public IActionHandler

@ -37,7 +37,7 @@ struct SGuildMember
{ {
uint32 Index; // Index in the DB uint32 Index; // Index in the DB
uint32 NameID; uint32 NameID;
ucstring Name; std::string Name;
EGSPD::CGuildGrade::TGuildGrade Grade; EGSPD::CGuildGrade::TGuildGrade Grade;
TCharConnectionState Online; TCharConnectionState Online;
uint32 EnterDate; uint32 EnterDate;
@ -54,7 +54,7 @@ struct SGuildMember
struct SGuild struct SGuild
{ {
uint32 NameID; uint32 NameID;
ucstring Name; std::string Name;
uint64 Icon; uint64 Icon;
bool QuitGuildAvailable; bool QuitGuildAvailable;
@ -131,7 +131,7 @@ public:
bool isLeaderOfTheGuild(); bool isLeaderOfTheGuild();
/// If the player is in a guild get the guild name else return empty /// If the player is in a guild get the guild name else return empty
ucstring getGuildName(); std::string getGuildName();
/// If the player is in a guild get the amount of money the guild owns else return zero /// If the player is in a guild get the amount of money the guild owns else return zero
uint64 getMoney(); uint64 getMoney();
@ -270,7 +270,7 @@ private:
// Join Proposal handling // Join Proposal handling
uint32 _JoinPropPhraseID; uint32 _JoinPropPhraseID;
ucstring _JoinPropPhrase; std::string _JoinPropPhrase;
bool _JoinPropUpdate; bool _JoinPropUpdate;
}; };

@ -310,12 +310,12 @@ public:
class CStringManagerTextProvider : public CViewTextID::IViewTextProvider class CStringManagerTextProvider : public CViewTextID::IViewTextProvider
{ {
bool getString( uint32 stringId, ucstring &result ) bool getString( uint32 stringId, string &result )
{ {
return STRING_MANAGER::CStringManagerClient::instance()->getString( stringId, result ); return STRING_MANAGER::CStringManagerClient::instance()->getString( stringId, result );
} }
bool getDynString( uint32 dynStringId, ucstring &result ) bool getDynString( uint32 dynStringId, string &result )
{ {
return STRING_MANAGER::CStringManagerClient::instance()->getDynString( dynStringId, result ); return STRING_MANAGER::CStringManagerClient::instance()->getDynString( dynStringId, result );
} }
@ -400,7 +400,7 @@ public:
} }
} }
// get the title translated // get the title translated
ucstring sTitleTranslated = botName; // FIXME: UTF-8 string sTitleTranslated = botName; // FIXME: UTF-8
CStringPostProcessRemoveName spprn; CStringPostProcessRemoveName spprn;
spprn.Woman = womanTitle; spprn.Woman = womanTitle;
spprn.cbIDStringReceived(sTitleTranslated); spprn.cbIDStringReceived(sTitleTranslated);
@ -412,14 +412,14 @@ public:
{ {
// But if there is no name, display only the title // But if there is no name, display only the title
if (botName.empty()) if (botName.empty())
botName = sTitleTranslated.toUtf8(); botName = sTitleTranslated;
} }
else else
{ {
// Else we want the title ! // Else we want the title !
if (!botName.empty()) if (!botName.empty())
botName += " "; botName += " ";
botName += sTitleTranslated.toUtf8(); botName += sTitleTranslated;
} }
formatedResult += botName; formatedResult += botName;
@ -2347,7 +2347,7 @@ void CInterfaceManager::processServerIDString()
for (uint32 i = 0; i < _IDStringWaiters.size(); ++i) for (uint32 i = 0; i < _IDStringWaiters.size(); ++i)
{ {
bool bAffect = false; bool bAffect = false;
ucstring ucstrToAffect; string ucstrToAffect;
SIDStringWaiter *pISW = _IDStringWaiters[i]; SIDStringWaiter *pISW = _IDStringWaiters[i];
if (pISW->IdOrString == true) // ID ! if (pISW->IdOrString == true) // ID !
{ {
@ -2374,7 +2374,7 @@ void CInterfaceManager::processServerIDString()
if (bValid) if (bValid)
{ {
ucstrToAffect = STRING_MANAGER::CStringManagerClient::getLocalizedName(ucstrToAffect); ucstrToAffect = STRING_MANAGER::CStringManagerClient::getLocalizedName(ucstrToAffect);
val.setString (ucstrToAffect.toUtf8()); val.setString (ucstrToAffect);
CInterfaceLink::setTargetProperty (pISW->Target, val); CInterfaceLink::setTargetProperty (pISW->Target, val);
} }
@ -4243,10 +4243,10 @@ bool CInterfaceManager::parseTokens(string& ucstr)
else if (token_param == "guild") else if (token_param == "guild")
{ {
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
ucstring ucGuildName; string ucGuildName;
if (pSMC->getString(pTokenSubjectEntity->getGuildNameID(), ucGuildName)) if (pSMC->getString(pTokenSubjectEntity->getGuildNameID(), ucGuildName))
{ {
token_replacement = ucGuildName.empty() ? token_replacement : ucGuildName.toUtf8(); token_replacement = ucGuildName.empty() ? token_replacement : ucGuildName;
} }
} }
else if (token_param.substr(0, 3) == "gs(" && else if (token_param.substr(0, 3) == "gs(" &&

@ -249,7 +249,7 @@ public:
{ {
public: public:
virtual ~IStringProcess() { } virtual ~IStringProcess() { }
virtual bool cbIDStringReceived(ucstring &inOut) = 0; // called when string or id is received (return true if valid the change) virtual bool cbIDStringReceived(std::string &inOut) = 0; // called when string or id is received (return true if valid the change)
}; };
void addServerString (const std::string &sTarget, uint32 id, IStringProcess *cb = NULL); void addServerString (const std::string &sTarget, uint32 id, IStringProcess *cb = NULL);

@ -3276,9 +3276,7 @@ void CLuaIHMRyzom::browseNpcWebPage(const std::string &htmlId, const std::string
{ {
userName = UserEntity->getDisplayName(); userName = UserEntity->getDisplayName();
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
ucstring ucsTmp; pSMC->getString(UserEntity->getGuildNameID(), guildName);
pSMC->getString(UserEntity->getGuildNameID(), ucsTmp);
guildName = ucsTmp.toString();
while (guildName.find(' ') != string::npos) while (guildName.find(' ') != string::npos)
{ {
@ -3329,16 +3327,16 @@ void CLuaIHMRyzom::clearHtmlUndoRedo(const std::string &htmlId)
ucstring CLuaIHMRyzom::getDynString(sint32 dynStringId) ucstring CLuaIHMRyzom::getDynString(sint32 dynStringId)
{ {
//H_AUTO(Lua_CLuaIHM_getDynString) //H_AUTO(Lua_CLuaIHM_getDynString)
ucstring result; string result;
STRING_MANAGER::CStringManagerClient::instance()->getDynString(dynStringId, result); STRING_MANAGER::CStringManagerClient::instance()->getDynString(dynStringId, result);
return result; return ucstring::makeFromUtf8(result); // TODO: Lua UTF-8
} }
// *************************************************************************** // ***************************************************************************
bool CLuaIHMRyzom::isDynStringAvailable(sint32 dynStringId) bool CLuaIHMRyzom::isDynStringAvailable(sint32 dynStringId)
{ {
//H_AUTO(Lua_CLuaIHM_isDynStringAvailable) //H_AUTO(Lua_CLuaIHM_isDynStringAvailable)
ucstring result; string result;
bool res = STRING_MANAGER::CStringManagerClient::instance()->getDynString(dynStringId, result); bool res = STRING_MANAGER::CStringManagerClient::instance()->getDynString(dynStringId, result);
return res; return res;
} }
@ -3490,7 +3488,7 @@ string CLuaIHMRyzom::getGuildMemberName(sint32 nMemberId)
if ((nMemberId < 0) || (nMemberId >= getNbGuildMembers())) if ((nMemberId < 0) || (nMemberId >= getNbGuildMembers()))
return ""; return "";
return CGuildManager::getInstance()->getGuildMembers()[nMemberId].Name.toString(); return CGuildManager::getInstance()->getGuildMembers()[nMemberId].Name;
} }
// *************************************************************************** // ***************************************************************************

@ -934,7 +934,7 @@ class CHandlerChatGroupFilter : public IActionHandler
case CChatGroup::dyn_chat: case CChatGroup::dyn_chat:
uint32 index = PeopleInterraction.TheUserChat.Filter.getTargetDynamicChannelDbIndex(); uint32 index = PeopleInterraction.TheUserChat.Filter.getTargetDynamicChannelDbIndex();
uint32 textId = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:DYN_CHAT:CHANNEL"+toString(index)+":NAME")->getValue32(); uint32 textId = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:DYN_CHAT:CHANNEL"+toString(index)+":NAME")->getValue32();
ucstring title; string title;
STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title); STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title);
if (title.empty()) if (title.empty())
{ {
@ -944,7 +944,7 @@ class CHandlerChatGroupFilter : public IActionHandler
} }
else else
{ {
pUserBut->setHardText(title.toUtf8()); pUserBut->setHardText(title);
} }
break; break;
} }
@ -1297,7 +1297,7 @@ void CPeopleInterraction::addContactInList(uint32 contactId, const ucstring &nam
//================================================================================================================= //=================================================================================================================
void CPeopleInterraction::addContactInList(uint32 contactId, uint32 nameID, TCharConnectionState online, uint8 nList) void CPeopleInterraction::addContactInList(uint32 contactId, uint32 nameID, TCharConnectionState online, uint8 nList)
{ {
ucstring name; string name;
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
if (pSMC->getString(nameID, name)) if (pSMC->getString(nameID, name))
{ {
@ -1357,7 +1357,7 @@ void CPeopleInterraction::updateWaitingContacts()
for (uint32 i = 0; i < WaitingContacts.size();) for (uint32 i = 0; i < WaitingContacts.size();)
{ {
SWaitingContact &w = WaitingContacts[i]; SWaitingContact &w = WaitingContacts[i];
ucstring name; string name;
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
if (pSMC->getString(w.NameId, name)) if (pSMC->getString(w.NameId, name))
{ {
@ -1393,7 +1393,7 @@ void CPeopleInterraction::updateContactInList(uint32 contactId, TCharConnectionS
// Only show the message if this player is not in my guild (because then the guild manager will show a message) // Only show the message if this player is not in my guild (because then the guild manager will show a message)
std::vector<SGuildMember> GuildMembers = CGuildManager::getInstance()->getGuildMembers(); std::vector<SGuildMember> GuildMembers = CGuildManager::getInstance()->getGuildMembers();
bool bOnlyFriend = true; bool bOnlyFriend = true;
ucstring name = toLower(FriendList.getName(index)); string name = toLower(FriendList.getName(index).toUtf8());
for (uint i = 0; i < GuildMembers.size(); ++i) for (uint i = 0; i < GuildMembers.size(); ++i)
{ {
if (toLower(GuildMembers[i].Name) == name) if (toLower(GuildMembers[i].Name) == name)
@ -2635,12 +2635,12 @@ public:
uint32 canWrite = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:DYN_CHAT:CHANNEL"+s+":WRITE_RIGHT")->getValue32(); uint32 canWrite = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:DYN_CHAT:CHANNEL"+s+":WRITE_RIGHT")->getValue32();
if (canWrite != 0) if (canWrite != 0)
{ {
ucstring title; string title;
STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title); STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title);
// replace dynamic channel name and shortcut // replace dynamic channel name and shortcut
string res = CI18N::get("uiFilterMenuDynamic"); string res = CI18N::get("uiFilterMenuDynamic");
strFindReplace(res, "%channel", title.toUtf8()); strFindReplace(res, "%channel", title);
strFindReplace(res, "%shortcut", s); strFindReplace(res, "%shortcut", s);
pMenu->addLineAtIndex(5 + insertion_index, res, "chat_target_selected", "dyn"+s, "dyn"+s); pMenu->addLineAtIndex(5 + insertion_index, res, "chat_target_selected", "dyn"+s, "dyn"+s);
@ -2828,9 +2828,9 @@ class CHandlerSelectChatSource : public IActionHandler
pVTM->setActive(active); pVTM->setActive(active);
if (active) if (active)
{ {
ucstring title; string title;
STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title); STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title);
pVTM->setText("["+s+"] " + title.toUtf8()); pVTM->setText("["+s+"] " + title);
} }
} }
} }
@ -2953,9 +2953,9 @@ class CHandlerSelectChatSource : public IActionHandler
bool active = (textId != 0); bool active = (textId != 0);
if (active) if (active)
{ {
ucstring title; string title;
STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title); STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title);
menu->addLineAtIndex(insertionIndex, "["+s+"] " + title.toUtf8(), FILTER_TOGGLE, "dyn"+s); menu->addLineAtIndex(insertionIndex, "["+s+"] " + title, FILTER_TOGGLE, "dyn"+s);
menu->setUserGroupLeft(insertionIndex, createMenuCheckBox(FILTER_TOGGLE, "dyn"+s, pi.ChatInput.DynamicChat[i].isListeningWindow(cw))); menu->setUserGroupLeft(insertionIndex, createMenuCheckBox(FILTER_TOGGLE, "dyn"+s, pi.ChatInput.DynamicChat[i].isListeningWindow(cw)));
++insertionIndex; ++insertionIndex;
} }

@ -3266,8 +3266,8 @@ private:
STRING_MANAGER::CStringManagerClient *pSMC= STRING_MANAGER::CStringManagerClient::instance(); STRING_MANAGER::CStringManagerClient *pSMC= STRING_MANAGER::CStringManagerClient::instance();
// get the content string (should have been received!) // get the content string (should have been received!)
ucstring contentStr; string contentStr;
ucstring titleStr; string titleStr;
if(!pSMC->getDynString(_TextId[ContentType], contentStr)) if(!pSMC->getDynString(_TextId[ContentType], contentStr))
return; return;
@ -3294,8 +3294,8 @@ private:
} }
if(i != digitMaxEnd) if(i != digitMaxEnd)
{ {
ucstring web_app = contentStr.substr(digitStart, i-digitStart); string web_app = contentStr.substr(digitStart, i-digitStart);
contentStr = ucstring(ClientCfg.WebIgMainDomain + "/") + web_app + ucstring("/index.php?") + contentStr.substr((size_t)i + 1); contentStr = string(ClientCfg.WebIgMainDomain + "/") + web_app + string("/index.php?") + contentStr.substr((size_t)i + 1);
} }
else else
{ {
@ -3329,7 +3329,7 @@ private:
if (is_webig) if (is_webig)
{ {
CGroupHTML *groupHtml; CGroupHTML *groupHtml;
string group = titleStr.toString(); string group = titleStr;
// <missing:XXX> // <missing:XXX>
group = group.substr(9, group.size()-10); group = group.substr(9, group.size()-10);
groupHtml = dynamic_cast<CGroupHTML*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:"+group+":content:html")); groupHtml = dynamic_cast<CGroupHTML*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:"+group+":content:html"));
@ -3352,7 +3352,7 @@ private:
{ {
if (group == "webig") if (group == "webig")
pGC->setActive(true); pGC->setActive(true);
string url = contentStr.toString(); string url = contentStr;
addWebIGParams(url, true); addWebIGParams(url, true);
groupHtml->browse(url.c_str()); groupHtml->browse(url.c_str());
CWidgetManager::getInstance()->setTopWindow(pGC); CWidgetManager::getInstance()->setTopWindow(pGC);
@ -3372,7 +3372,7 @@ private:
// must set the text by hand // must set the text by hand
CViewText *vt= dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId(CWidgetManager::getInstance()->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) if(vt)
vt->setTextFormatTaged(contentStr.toUtf8()); vt->setTextFormatTaged(contentStr);
// open // open
CWidgetManager::getInstance()->setTopWindow(pGC); CWidgetManager::getInstance()->setTopWindow(pGC);

@ -64,11 +64,11 @@ public:
void flushStringCache(); void flushStringCache();
bool getString(uint32 stringId, std::string &result); bool getString(uint32 stringId, std::string &result);
bool getString(uint32 stringId, ucstring &result) { std::string temp; bool res = getString(stringId, temp); result.fromUtf8(temp); return res; } // FIXME: UTF-8 // bool getString(uint32 stringId, ucstring &result) { std::string temp; bool res = getString(stringId, temp); result.fromUtf8(temp); return res; } // FIXME: UTF-8
void waitString(uint32 stringId, const IStringWaiterRemover *premover, std::string *result); void waitString(uint32 stringId, const IStringWaiterRemover *premover, std::string *result);
void waitString(uint32 stringId, IStringWaitCallback *pcallback); void waitString(uint32 stringId, IStringWaitCallback *pcallback);
bool getDynString(uint32 dynStringId, std::string &result); bool getDynString(uint32 dynStringId, std::string &result);
bool getDynString(uint32 dynStringId, ucstring &result) { std::string temp; bool res = getString(dynStringId, temp); result.fromUtf8(temp); return res; } // FIXME: UTF-8 // bool getDynString(uint32 dynStringId, ucstring &result) { std::string temp; bool res = getString(dynStringId, temp); result.fromUtf8(temp); return res; } // FIXME: UTF-8
void waitDynString(uint32 stringId, const IStringWaiterRemover *premover, std::string *result); void waitDynString(uint32 stringId, const IStringWaiterRemover *premover, std::string *result);
void waitDynString(uint32 stringId, IStringWaitCallback *pcallback); void waitDynString(uint32 stringId, IStringWaitCallback *pcallback);

Loading…
Cancel
Save