feature/develop-atys
Nimetu 4 years ago
parent 72098f624d
commit 73610be10d

@ -768,11 +768,11 @@ void CGameContextMenu::updateContextMenuMissionsOptions( bool forceHide )
{ {
result = NLMISC::CI18N::get("uiMissionOptionNotReceived"); result = NLMISC::CI18N::get("uiMissionOptionNotReceived");
} }
if (result == ucstring("Qui etes-vous ?") if (result == string("Qui etes-vous ?")
|| result == ucstring("Wer bist Du?") || result == string("Wer bist Du?")
|| result == ucstring("Who are you?") || result == string("Who are you?")
|| result == ucstring("Quién eres tú?") || result == string("Quién eres tú?")
|| result == ucstring("Кто ты?")) || result == string("Кто ты?"))
{ {
pVTM->setActive(false); pVTM->setActive(false);
} }

@ -421,14 +421,14 @@ CViewBase *CChatTextManager::createMsgTextComplex(const string &msg, NLMISC::CRG
return para; return para;
} }
ucstring::size_type pos = 0; string::size_type pos = 0;
// Manage Translations // Manage Translations
CCDBNodeLeaf *node= NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TRANSLATION_ONLY_AS_TOOLTIP_CB", false); CCDBNodeLeaf *node= NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TRANSLATION_ONLY_AS_TOOLTIP_CB", false);
bool originalFirst = node->getValueBool(); bool originalFirst = node->getValueBool();
string::size_type startTr = msg.find(ucstring("{:")); string::size_type startTr = msg.find("{:");
string::size_type endOfOriginal = msg.find(ucstring("}@{")); string::size_type endOfOriginal = msg.find("}@{");
// Original/Translated case, example: {:enHello the world!}@{ Bonjour le monde ! // Original/Translated case, example: {:enHello the world!}@{ Bonjour le monde !
if (startTr != string::npos && endOfOriginal != string::npos) if (startTr != string::npos && endOfOriginal != string::npos)
@ -436,9 +436,9 @@ CViewBase *CChatTextManager::createMsgTextComplex(const string &msg, NLMISC::CRG
CViewBase *vt = createMsgTextSimple(msg.substr(0, startTr), col, justified, NULL); CViewBase *vt = createMsgTextSimple(msg.substr(0, startTr), col, justified, NULL);
para->addChild(vt); para->addChild(vt);
string texture = "flag-"+toLower(msg.substr(startTr+2, 2)).toString()+".tga"; string texture = "flag-"+toLowerAscii(msg.substr(startTr+2, 2))+".tga";
ucstring original = msg.substr(startTr+5, endOfOriginal-startTr-5); string original = msg.substr(startTr+5, endOfOriginal-startTr-5);
ucstring translation = msg.substr(endOfOriginal+3); string translation = msg.substr(endOfOriginal+3);
CCtrlButton *ctrlButton = new CCtrlButton(CViewBase::TCtorParam()); CCtrlButton *ctrlButton = new CCtrlButton(CViewBase::TCtorParam());
ctrlButton->setTexture(texture); ctrlButton->setTexture(texture);
ctrlButton->setTextureOver(texture); ctrlButton->setTextureOver(texture);

@ -849,10 +849,10 @@ void CGroupInSceneBubbleManager::chatOpen (uint32 nUID, const std::string &ucsTe
CCDBNodeLeaf *node= NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TRANSLATION_ONLY_AS_TOOLTIP_CB", false); CCDBNodeLeaf *node= NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TRANSLATION_ONLY_AS_TOOLTIP_CB", false);
bool originalFirst = node->getValueBool(); bool originalFirst = node->getValueBool();
ucstring::size_type pos = 0; string::size_type pos = 0;
ucstring::size_type textSize = ucsText.size(); string::size_type textSize = ucsText.size();
string::size_type startTr = ucsText.find(ucstring("{:")); string::size_type startTr = ucsText.find("{:");
string::size_type endOfOriginal = ucsText.find(ucstring("}@{")); string::size_type endOfOriginal = ucsText.find("}@{");
if (endOfOriginal != string::npos) if (endOfOriginal != string::npos)
{ {
if (!originalFirst) if (!originalFirst)

@ -2535,7 +2535,7 @@ void CInterfaceManager::displaySystemInfo(const string &str, const string &cat)
// If broadcast, parse lua code // If broadcast, parse lua code
if (toLower(cat) == "bc" && str.size() > 3 && str[0]=='@' && str[1]=='L' && str[2]=='U' && str[3]=='A') if (toLower(cat) == "bc" && str.size() > 3 && str[0]=='@' && str[1]=='L' && str[2]=='U' && str[3]=='A')
{ {
string code = str.substr(4, str.size()-4).toString(); string code = str.substr(4, str.size()-4);
if (!code.empty()) if (!code.empty())
CLuaManager::getInstance().executeLuaScript(code); CLuaManager::getInstance().executeLuaScript(code);
return; return;

@ -2334,7 +2334,7 @@ public:
if (gc) if (gc)
{ {
CGroupEditBox *geb = dynamic_cast<CGroupEditBox *>(gc->getGroup("change_contact_group_eb:eb")); CGroupEditBox *geb = dynamic_cast<CGroupEditBox *>(gc->getGroup("change_contact_group_eb:eb"));
geb->setInputString(ucstring("")); geb->setInputString(std::string(""));
} }
CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, sParams); CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, sParams);
} }
@ -2359,7 +2359,7 @@ public:
{ {
PeopleInterraction.FriendList.changeGroup(lastPeopleIndexChangeGroup, geb->getInputString()); PeopleInterraction.FriendList.changeGroup(lastPeopleIndexChangeGroup, geb->getInputString());
geb->setInputString(ucstring("")); geb->setInputString(std::string(""));
CPeopleList::TSortOrder order = (CPeopleList::TSortOrder)(NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CONTACT_LIST:SORT_ORDER")->getValue32()); CPeopleList::TSortOrder order = (CPeopleList::TSortOrder)(NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CONTACT_LIST:SORT_ORDER")->getValue32());
PeopleInterraction.FriendList.sortEx(order); PeopleInterraction.FriendList.sortEx(order);
} }

@ -287,7 +287,7 @@ void CPeopleList::sortEx(TSortOrder order)
{ {
newGroup = true; newGroup = true;
} }
while (groupIndex < _GroupContainers.size() && _GroupContainers[groupIndex].first != _Peoples[k].Group.toString()) while (groupIndex < _GroupContainers.size() && _GroupContainers[groupIndex].first != _Peoples[k].Group)
{ {
newGroup = true; newGroup = true;
++groupIndex; ++groupIndex;
@ -479,44 +479,44 @@ void CPeopleList::setContactId(uint index, uint32 contactId)
} }
//================================================================== //==================================================================
void CPeopleList::changeGroup(uint index, const ucstring &groupName) void CPeopleList::changeGroup(uint index, const std::string &groupName)
{ {
if (index >= _Peoples.size()) if (index >= _Peoples.size())
{ {
nlwarning("<CPeopleList::changeGroup> bad index."); nlwarning("<CPeopleList::changeGroup> bad index.");
return; return;
} }
ucstring group = groupName; std::string group = groupName;
if (group.toString() == "General") if (group == "General")
group = ucstring(""); group.clear();
_Peoples[index].Group = group; _Peoples[index].Group = group;
for (uint k = 0; k < _GroupContainers.size(); ++k) for (uint k = 0; k < _GroupContainers.size(); ++k)
{ {
if (_GroupContainers[k].first == group.toString()) if (_GroupContainers[k].first == group)
return; return;
} }
vector<pair<string, string> > properties; vector<pair<string, string> > properties;
properties.push_back(make_pair(string("posparent"), string("parent"))); properties.push_back(make_pair(string("posparent"), string("parent")));
properties.push_back(make_pair(string("id"), _ContainerID + "_group_" + toString(_GroupContainers.size()))); properties.push_back(make_pair(string("id"), _ContainerID + "_group_" + toString(_GroupContainers.size())));
if (group.toString() == "") if (group.empty())
properties.push_back(make_pair(string("title"), "General")); properties.push_back(make_pair(string("title"), "General"));
else else
properties.push_back(make_pair(string("title"), group.toString())); properties.push_back(make_pair(string("title"), group));
CGroupContainer *gc = dynamic_cast<CGroupContainer *>(CWidgetManager::getInstance()->getParser()->createGroupInstance("people_list_group_header", "ui:interface", properties, false)); CGroupContainer *gc = dynamic_cast<CGroupContainer *>(CWidgetManager::getInstance()->getParser()->createGroupInstance("people_list_group_header", "ui:interface", properties, false));
if (group.toString() == "") if (group.empty())
gc->setUCTitle(ucstring("General")); gc->setTitle(std::string("General"));
else else
gc->setUCTitle(group.toString()); gc->setTitle(group);
gc->setSavable(false); gc->setSavable(false);
CInterfaceGroup *pRoot = dynamic_cast<CInterfaceGroup*>(CWidgetManager::getInstance()->getElementFromId("ui:interface")); CInterfaceGroup *pRoot = dynamic_cast<CInterfaceGroup*>(CWidgetManager::getInstance()->getElementFromId("ui:interface"));
pRoot->addGroup (gc); pRoot->addGroup (gc);
_BaseContainer->attachContainer(gc); _BaseContainer->attachContainer(gc);
_GroupContainers.push_back(make_pair(group.toString(), gc)); _GroupContainers.push_back(make_pair(group, gc));
std::sort(_GroupContainers.begin(), _GroupContainers.end()); std::sort(_GroupContainers.begin(), _GroupContainers.end());
} }
@ -627,8 +627,8 @@ void CPeopleList::saveContactGroups()
{ {
xmlNodePtr newNode = xmlNewChild(node, NULL, (const xmlChar*)"contact", NULL); xmlNodePtr newNode = xmlNewChild(node, NULL, (const xmlChar*)"contact", NULL);
xmlSetProp(newNode, (const xmlChar*)"name", (const xmlChar*)_Peoples[k].getName().toString().c_str()); xmlSetProp(newNode, (const xmlChar*)"name", (const xmlChar*)_Peoples[k].getName().c_str());
xmlSetProp(newNode, (const xmlChar*)"group", (const xmlChar*)_Peoples[k].Group.toString().c_str()); xmlSetProp(newNode, (const xmlChar*)"group", (const xmlChar*)_Peoples[k].Group.c_str());
} }
stream.flush(); stream.flush();
fd.close(); fd.close();

@ -110,7 +110,7 @@ public:
sint getIndexFromContactId(uint32 contactId); sint getIndexFromContactId(uint32 contactId);
// For Friend Groups management // For Friend Groups management
void changeGroup(uint index, const ucstring &groupName); void changeGroup(uint index, const std::string &groupName);
void readContactGroups(); void readContactGroups();
void saveContactGroups(); void saveContactGroups();
@ -162,7 +162,7 @@ private:
TCharConnectionState Online; TCharConnectionState Online;
bool Blocked; bool Blocked;
uint32 ContactId; uint32 ContactId;
ucstring Group; std::string Group;
bool operator < (const CPeople &other) const { return getName() < other.getName(); } bool operator < (const CPeople &other) const { return getName() < other.getName(); }
std::string getName() const { return Container->getTitle(); } std::string getName() const { return Container->getTitle(); }
}; };

@ -147,7 +147,7 @@ extern bool CharNameValidArrived;
extern bool CharNameValid; extern bool CharNameValid;
bool IsInRingSession = false; bool IsInRingSession = false;
TSessionId HighestMainlandSessionId; // highest in the position stack TSessionId HighestMainlandSessionId; // highest in the position stack
ucstring lastUniversMessage; std::string lastUniversMessage;
extern const char *CDBBankNames[INVALID_CDB_BANK+1]; extern const char *CDBBankNames[INVALID_CDB_BANK+1];

Loading…
Cancel
Save