|
|
@ -425,6 +425,9 @@ CViewBase *CChatTextManager::createMsgTextComplex(const ucstring &msg, NLMISC::C
|
|
|
|
ucstring::size_type pos = 0;
|
|
|
|
ucstring::size_type pos = 0;
|
|
|
|
|
|
|
|
|
|
|
|
// Manage Translations
|
|
|
|
// Manage Translations
|
|
|
|
|
|
|
|
CCDBNodeLeaf *node= NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TRANSLATION_ONLY_AS_TOOLTIP_CB", false);
|
|
|
|
|
|
|
|
bool originalFirst = node->getValueBool();
|
|
|
|
|
|
|
|
|
|
|
|
string::size_type startTr = msg.find(ucstring("{:"));
|
|
|
|
string::size_type startTr = msg.find(ucstring("{:"));
|
|
|
|
string::size_type endOfOriginal = msg.find(ucstring("}@{"));
|
|
|
|
string::size_type endOfOriginal = msg.find(ucstring("}@{"));
|
|
|
|
|
|
|
|
|
|
|
@ -436,12 +439,22 @@ CViewBase *CChatTextManager::createMsgTextComplex(const ucstring &msg, NLMISC::C
|
|
|
|
|
|
|
|
|
|
|
|
string texture = "flag-"+toLower(msg.substr(startTr+2, 2)).toString()+".tga";
|
|
|
|
string texture = "flag-"+toLower(msg.substr(startTr+2, 2)).toString()+".tga";
|
|
|
|
ucstring original = msg.substr(startTr+5, endOfOriginal-startTr-5);
|
|
|
|
ucstring original = msg.substr(startTr+5, endOfOriginal-startTr-5);
|
|
|
|
pos = endOfOriginal+3;
|
|
|
|
ucstring 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);
|
|
|
|
ctrlButton->setTexturePushed(texture);
|
|
|
|
ctrlButton->setTexturePushed(texture);
|
|
|
|
|
|
|
|
if (!originalFirst)
|
|
|
|
|
|
|
|
{
|
|
|
|
ctrlButton->setDefaultContextHelp(original);
|
|
|
|
ctrlButton->setDefaultContextHelp(original);
|
|
|
|
|
|
|
|
pos = endOfOriginal+3;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ctrlButton->setDefaultContextHelp(translation);
|
|
|
|
|
|
|
|
pos = startTr+5;
|
|
|
|
|
|
|
|
textSize = endOfOriginal;
|
|
|
|
|
|
|
|
}
|
|
|
|
ctrlButton->setId("tr");
|
|
|
|
ctrlButton->setId("tr");
|
|
|
|
para->addChild(ctrlButton);
|
|
|
|
para->addChild(ctrlButton);
|
|
|
|
}
|
|
|
|
}
|
|
|
|