develop
kaetemi 4 years ago
parent 6cd52d7871
commit 1963bdedcc

@ -85,9 +85,10 @@ namespace NLGUI
/// Get the ContextHelp for this control. Default is to return _ContextHelp
virtual void getContextHelp(ucstring &help) const {help= _ContextHelp;}
virtual void getContextHelp(std::string &help) const {help= _ContextHelp;}
virtual void getContextHelpAsUtf16(ucstring &help) const {help.fromUtf8(_ContextHelp);}
/// Get the ContextHelp for this control, with tooltip specific code. Default behaviour is identical to getContextHelp.
virtual void getContextHelpToolTip(ucstring &help) const { getContextHelp(help); }
virtual void getContextHelpToolTip(std::string &help) const { getContextHelp(help); }
// Get the name of the context help window. Default to "context_help"
virtual std::string getContextHelpWindowName() const;
/// Get the ContextHelp ActionHandler. If "", noop
@ -123,8 +124,10 @@ namespace NLGUI
void setToolTipPosRef(THotSpot pos) { _ToolTipPosRef = pos;}
/// replace the default contextHelp
ucstring getDefaultContextHelp() const {return _ContextHelp;}
void setDefaultContextHelp(const ucstring &help) {_ContextHelp= help;}
std::string getDefaultContextHelp() const {return _ContextHelp;}
void setDefaultContextHelp(const std::string &help) {_ContextHelp= help;}
ucstring getDefaultContextHelpAsUtf16() const {return ucstring::makeFromUtf8(_ContextHelp);}
void setDefaultContextHelpAsUtf16(const ucstring &help) {_ContextHelp= help.toUtf8();}
void setOnContextHelp(const std::string &help) {_OnContextHelp= help;}
void setOnContextHelpAHParams(const std::string &p) {_OnContextHelpParams= p;}
@ -158,7 +161,7 @@ namespace NLGUI
int luaSetTooltipUtf8(CLuaState &ls);
REFLECT_EXPORT_START(CCtrlBase, CViewBase)
REFLECT_UCSTRING("tooltip", getDefaultContextHelp, setDefaultContextHelp);
REFLECT_UCSTRING("tooltip", getDefaultContextHelpAsUtf16, setDefaultContextHelpAsUtf16); // FIXME: Lua UTF-8
REFLECT_LUA_METHOD("setTooltipUtf8", luaSetTooltipUtf8);
REFLECT_EXPORT_END
@ -171,7 +174,7 @@ namespace NLGUI
protected:
// This is the ContextHelp filled by default in parse()
ucstring _ContextHelp;
std::string _ContextHelp;
CStringShared _OnContextHelp;
CStringShared _OnContextHelpParams;
CStringShared _ToolTipSpecialParent;

@ -333,8 +333,8 @@ namespace NLGUI
void updateTooltipCoords(CCtrlBase *newCtrl);
/// for ContextHelp action handler only: set the result name
void setContextHelpText( const ucstring &text ){ _ContextHelpText = text; }
ucstring& getContextHelpText(){ return _ContextHelpText; }
void setContextHelpText( const std::string &text ){ _ContextHelpText = text; }
std::string& getContextHelpText(){ return _ContextHelpText; }
/// force disable the context help
void disableContextHelp();
@ -626,7 +626,7 @@ namespace NLGUI
SInterfaceTimes interfaceTimes;
ucstring _ContextHelpText;
std::string _ContextHelpText;
bool _ContextHelpActive;
bool inGame;

@ -127,9 +127,9 @@ namespace NLGUI
{
// Force I18N tooltip
if (!editorMode)
_ContextHelp = CI18N::get((const char *)prop);
_ContextHelp = CI18N::get((const char *)prop).toUtf8();
else
_ContextHelp.fromUtf8((const char *)prop);
_ContextHelp = (const char *)prop;
}
else
{
@ -138,9 +138,9 @@ namespace NLGUI
if (prop)
{
if (!editorMode && NLMISC::startsWith((const char *)prop, "ui"))
_ContextHelp = CI18N::get((const char *)prop);
_ContextHelp = CI18N::get((const char *)prop).toUtf8();
else
_ContextHelp.fromUtf8((const char *)prop);
_ContextHelp = (const char *)prop;
}
}
@ -197,12 +197,12 @@ namespace NLGUI
{
if( name == "tooltip" )
{
return _ContextHelp.toUtf8();
return _ContextHelp;
}
else
if( name == "tooltip_i18n" )
{
return _ContextHelp.toUtf8();
return _ContextHelp;
}
else
if( name == "on_tooltip" )
@ -259,18 +259,18 @@ namespace NLGUI
if( name == "tooltip" )
{
if (!editorMode && NLMISC::startsWith(value, "ui"))
_ContextHelp = CI18N::get(value);
_ContextHelp = CI18N::get(value).toUtf8();
else
_ContextHelp.fromUtf8(value);
_ContextHelp = value;
return;
}
else
if( name == "tooltip_i18n" )
{
if (!editorMode)
_ContextHelp = CI18N::get(value);
_ContextHelp = CI18N::get(value).toUtf8();
else
_ContextHelp.fromUtf8(value);
_ContextHelp = value;
return;
}
else
@ -382,8 +382,8 @@ namespace NLGUI
if( node == NULL )
return NULL;
xmlNewProp( node, BAD_CAST "tooltip", BAD_CAST _ContextHelp.toString().c_str() );
xmlNewProp( node, BAD_CAST "tooltip_i18n", BAD_CAST _ContextHelp.toString().c_str() );
xmlNewProp( node, BAD_CAST "tooltip", BAD_CAST _ContextHelp.c_str() );
xmlNewProp( node, BAD_CAST "tooltip_i18n", BAD_CAST _ContextHelp.c_str() );
xmlNewProp( node, BAD_CAST "on_tooltip", BAD_CAST _OnContextHelp.toString().c_str() );
xmlNewProp( node, BAD_CAST "on_tooltip_params", BAD_CAST _OnContextHelpParams.toString().c_str() );
xmlNewProp( node, BAD_CAST "tooltip_parent", BAD_CAST tooltipParentToString( _ToolTipParent ).c_str() );
@ -476,7 +476,7 @@ namespace NLGUI
// ***************************************************************************
bool CCtrlBase::emptyContextHelp() const
{
ucstring help;
std::string help;
getContextHelp(help);
std::string sTmp = _OnContextHelp;
return help.empty() && sTmp.empty();
@ -494,12 +494,15 @@ namespace NLGUI
void CCtrlBase::serial(NLMISC::IStream &f)
{
CViewBase::serial(f);
uint version = f.serialVersion(1);
nlassert(version);
f.serial(_ContextHelp);
f.serial(_OnContextHelp);
f.serial(_OnContextHelpParams);
f.serial(_ToolTipSpecialParent);
f.serialEnum(_ToolTipParent);
//
THotSpot tmpToolTipParentPosRef = _ToolTipParentPosRef;
THotSpot tmpToolTipPosRef = _ToolTipPosRef;
@ -515,7 +518,7 @@ namespace NLGUI
_ToolTipPosRef = tmpToolTipPosRef;
_ToolTipParentPosRefAlt = tmpToolTipParentPosRefAlt;
_ToolTipPosRefAlt = tmpToolTipPosRefAlt;
//
nlSerialBitBool(f, _ToolTipInstant);
}
@ -577,7 +580,7 @@ namespace NLGUI
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
std::string tooltip = ls.toString(1);
setDefaultContextHelp(ucstring::makeFromUtf8(tooltip));
setDefaultContextHelp(tooltip);
return 0;
}

@ -3538,7 +3538,7 @@ namespace NLGUI
_RightButton->setTexturePushed (pLayer->getValStr ("right_button_tx_popin"));
_RightButton->setTextureOver (pLayer->getValStr ("right_button_tx_over"));
_RightButton->setActionOnLeftClick ("ic_popin");
_RightButton->setDefaultContextHelp(CI18N::get("uiPopinWindow"));
_RightButton->setDefaultContextHelp(CI18N::get("uiPopinWindow").toUtf8());
}
else // else the container can be deactivated ? deactivate button
{
@ -3546,7 +3546,7 @@ namespace NLGUI
_RightButton->setTexturePushed (pLayer->getValStr ("right_button_tx_deactive"));
_RightButton->setTextureOver (pLayer->getValStr ("right_button_tx_over"));
_RightButton->setActionOnLeftClick ("ic_deactive");
_RightButton->setDefaultContextHelp(CI18N::get("uiClose"));
_RightButton->setDefaultContextHelp(CI18N::get("uiClose").toUtf8());
}
}
}
@ -3559,7 +3559,7 @@ namespace NLGUI
_RightButton->setTexturePushed (pLayer->getValStr ("right_button_tx_popup"));
_RightButton->setTextureOver (pLayer->getValStr ("right_button_tx_over"));
_RightButton->setActionOnLeftClick ("ic_popup");
_RightButton->setDefaultContextHelp(CI18N::get("uiPopupWindow"));
_RightButton->setDefaultContextHelp(CI18N::get("uiPopupWindow").toUtf8());
}
_RightButton->setActive(!_Locked);
}
@ -3602,7 +3602,7 @@ namespace NLGUI
_HelpButton->setTexturePushed (pLayer->getValStr ("help_button_tx"));
_HelpButton->setTextureOver (pLayer->getValStr ("help_button_tx_over"));
_HelpButton->setActionOnLeftClick ("ic_help");
_HelpButton->setDefaultContextHelp(CI18N::get("uiHelp"));
_HelpButton->setDefaultContextHelp(CI18N::get("uiHelp").toUtf8());
}
// if not layer 0

@ -2888,7 +2888,7 @@ namespace NLGUI
ctrlButton->setModulateGlobalColorAll (false);
// Translate the tooltip
ctrlButton->setDefaultContextHelp(ucstring::makeFromUtf8(getLinkTitle()));
ctrlButton->setDefaultContextHelp(getLinkTitle());
ctrlButton->setText(tmpStr);
// empty url / button disabled
bool disabled = string(getLink()).empty();
@ -3229,12 +3229,12 @@ namespace NLGUI
{
if (CI18N::hasTranslation(tooltip))
{
ctrlButton->setDefaultContextHelp(CI18N::get(tooltip));
ctrlButton->setDefaultContextHelp(CI18N::get(tooltip).toUtf8());
//ctrlButton->setOnContextHelp(CI18N::get(tooltip).toString());
}
else
{
ctrlButton->setDefaultContextHelp(ucstring::makeFromUtf8(tooltip));
ctrlButton->setDefaultContextHelp(tooltip);
//ctrlButton->setOnContextHelp(string(tooltip));
}
@ -5467,11 +5467,11 @@ namespace NLGUI
{
if (CI18N::hasTranslation(tooltip))
{
ctrlButton->setDefaultContextHelp(CI18N::get(tooltip));
ctrlButton->setDefaultContextHelp(CI18N::get(tooltip).toUtf8());
}
else
{
ctrlButton->setDefaultContextHelp(ucstring::makeFromUtf8(tooltip));
ctrlButton->setDefaultContextHelp(tooltip);
}
}

@ -3346,7 +3346,7 @@ namespace NLGUI
pTooltip->setRenderLayer(getRenderLayer());
std::string tempTooltipStr = tempTooltips[i].toUtf8();
bool isI18N = NLMISC::startsWith(tempTooltipStr, "ui");
pTooltip->setDefaultContextHelp(isI18N ? CI18N::get(tempTooltipStr) : ucstring::makeFromUtf8(tempTooltipStr));
pTooltip->setDefaultContextHelp(isI18N ? CI18N::get(tempTooltipStr).toUtf8() : tempTooltipStr);
pTooltip->setParentPos(this);
pTooltip->setParentPosRef(Hotspot_BR);
pTooltip->setPosRef(Hotspot_BR);

@ -1516,7 +1516,7 @@ namespace NLGUI
CViewText *pTxt = (CViewText*)groupContextHelp->getView("text");
if (pTxt != NULL)
{
pTxt->setTextFormatTaged(_ContextHelpText.toUtf8());
pTxt->setTextFormatTaged(_ContextHelpText);
// update only to get correct W/H
groupContextHelp->updateCoords ();

@ -2317,7 +2317,7 @@ public:
CCtrlBase *pBut = pNewLine->getCtrl("but");
if (pBut != NULL)
{
pBut->setDefaultContextHelp(tooltip);
pBut->setDefaultContextHelp(tooltip.toUtf8());
}
addGroupInList(pNewLine);
}

@ -1692,7 +1692,7 @@ void initBloomConfigUI()
if(!supportBloom)
{
if(group)
group->setDefaultContextHelp(CI18N::get("uiFxTooltipBloom"));
group->setDefaultContextHelp(CI18N::get("uiFxTooltipBloom").toUtf8());
ClientCfg.writeBool("FXAA", false);
ClientCfg.writeBool("Bloom", false);
@ -1702,6 +1702,6 @@ void initBloomConfigUI()
else
{
if(group)
group->setDefaultContextHelp(ucstring(""));
group->setDefaultContextHelp(std::string());
}
}

@ -2116,7 +2116,7 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler
pVBR->setColor(CRGBA(0,0,0,0));
if (pTooltip)
pTooltip->setDefaultContextHelp(ucstring(""));
pTooltip->setDefaultContextHelp(std::string());
return;
}
@ -2140,7 +2140,7 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler
pVBR->setColor(CRGBA(0,0,0,0));
if (pTooltip)
pTooltip->setDefaultContextHelp(CI18N::get("uittTargetUnknown"));
pTooltip->setDefaultContextHelp(CI18N::get("uittTargetUnknown").toUtf8());
return;
}
@ -2169,7 +2169,7 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler
pVBR->setColor(CRGBA(0,0,0,0));
if (pTooltip)
pTooltip->setDefaultContextHelp(ucstring(""));
pTooltip->setDefaultContextHelp(std::string());
return;
}
@ -2194,7 +2194,7 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler
CCtrlBase *tooltip = dynamic_cast<CCtrlBase*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:target:header_opened:force"));
if (tooltip)
{
ucstring str;
string str;
if (nForceRegion == 1)
nForceRegion = 2;
@ -2205,7 +2205,7 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler
sint min = (nForceRegion-2) * 50 + (nLevelForce-1) * 10 + 1;
sint max = (nForceRegion-2) * 50 + nLevelForce * 10;
str= CI18N::get("uittTargetLevel");
str= CI18N::get("uittTargetLevel").toUtf8();
strFindReplace(str, "%min", toString(min));
strFindReplace(str, "%max", toString(max));
}
@ -2214,16 +2214,16 @@ class CActionHandlerSetTargetForceRegionLevel: public IActionHandler
{
sint n = (nForceRegion-1) * 50;
if (pE->isNPC())
str= CI18N::get("uittTargetGuardBoss");
str= CI18N::get("uittTargetGuardBoss").toUtf8();
else
str= CI18N::get("uittTargetBoss");
str= CI18N::get("uittTargetBoss").toUtf8();
strFindReplace(str, "%n", toString("%d", n) );
}
// Named
else
{
sint n = (nForceRegion-1) * 50;
str= CI18N::get("uittTargetNamed");
str= CI18N::get("uittTargetNamed").toUtf8();
strFindReplace(str, "%n", toString("%d", n) );
}
@ -4059,7 +4059,7 @@ public:
ucstring str;
fillPlayerBarText(str, "HP", SCORES::hit_points, "uittPlayerLifeFormat");
CWidgetManager::getInstance()->setContextHelpText(str);
CWidgetManager::getInstance()->setContextHelpText(str.toUtf8());
}
};
REGISTER_ACTION_HANDLER(CHandlerPlayerTTLife, "player_tt_life");
@ -4076,7 +4076,7 @@ public:
ucstring str;
fillPlayerBarText(str, "STA", SCORES::stamina, "uittPlayerStaminaFormat");
CWidgetManager::getInstance()->setContextHelpText(str);
CWidgetManager::getInstance()->setContextHelpText(str.toUtf8());
}
};
REGISTER_ACTION_HANDLER(CHandlerPlayerTTStamina, "player_tt_stamina");
@ -4093,7 +4093,7 @@ public:
ucstring str;
fillPlayerBarText(str, "SAP", SCORES::sap, "uittPlayerSapFormat");
CWidgetManager::getInstance()->setContextHelpText(str);
CWidgetManager::getInstance()->setContextHelpText(str.toUtf8());
}
};
REGISTER_ACTION_HANDLER(CHandlerPlayerTTSap, "player_tt_sap");
@ -4110,7 +4110,7 @@ public:
ucstring str;
fillPlayerBarText(str, "FOCUS", SCORES::focus, "uittPlayerFocusFormat");
CWidgetManager::getInstance()->setContextHelpText(str);
CWidgetManager::getInstance()->setContextHelpText(str.toUtf8());
}
};
REGISTER_ACTION_HANDLER(CHandlerPlayerTTFocus, "player_tt_focus");
@ -4140,7 +4140,7 @@ public:
ucstring str= CI18N::get("uittBulkFormat");
strFindReplace(str, "%v", toString("%.2f", val) );
strFindReplace(str, "%m", toString(maxVal) );
CWidgetManager::getInstance()->setContextHelpText(str);
CWidgetManager::getInstance()->setContextHelpText(str.toUtf8());
}
};
REGISTER_ACTION_HANDLER(CHandlerGetTTBulk, "get_tt_bulk");

@ -3473,76 +3473,76 @@ void setConsoModSuccessTooltip( CDBCtrlSheet *cs )
CInterfaceManager * pIM = CInterfaceManager::getInstance();
CCDBNodeLeaf * nodeSM = NULL;
ucstring ustr;
string ustr;
if( CSheetId(cs->getSheetId()).toString() == "mod_melee_success.sbrick" )
{
ustr = CI18N::get("uittModMeleeSuccess");
ustr = CI18N::get("uittModMeleeSuccess").toUtf8();
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:MELEE", false);
}
else
if( CSheetId(cs->getSheetId()).toString() == "mod_range_success.sbrick" )
{
ustr = CI18N::get("uittModRangeSuccess");
ustr = CI18N::get("uittModRangeSuccess").toUtf8();
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:RANGE", false);
}
else
if( CSheetId(cs->getSheetId()).toString() == "mod_craft_success.sbrick" )
{
ustr = CI18N::get("uittModCraftSuccess");
ustr = CI18N::get("uittModCraftSuccess").toUtf8();
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:CRAFT", false);
}
else
if( CSheetId(cs->getSheetId()).toString() == "mod_defense_success.sbrick" )
{
ustr = CI18N::get("uittModDefenseSuccess");
ustr = CI18N::get("uittModDefenseSuccess").toUtf8();
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:DODGE", false);
}
else
if( CSheetId(cs->getSheetId()).toString() == "mod_dodge_success.sbrick" )
{
ustr = CI18N::get("uittModDodgeSuccess");
ustr = CI18N::get("uittModDodgeSuccess").toUtf8();
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:DODGE", false);
}
else
if( CSheetId(cs->getSheetId()).toString() == "mod_parry_success.sbrick" )
{
ustr = CI18N::get("uittModParrySuccess");
ustr = CI18N::get("uittModParrySuccess").toUtf8();
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:PARRY", false);
}
else
if( CSheetId(cs->getSheetId()).toString() == "mod_forage_success.sbrick" )
{
ustr = CI18N::get("uittModForageSuccess");
ustr = CI18N::get("uittModForageSuccess").toUtf8();
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::common_ecosystem)+":FORAGE", false);
}
else
if( CSheetId(cs->getSheetId()).toString() == "mod_desert_forage_success.sbrick" )
{
ustr = CI18N::get("uittModDesertForageSuccess");
ustr = CI18N::get("uittModDesertForageSuccess").toUtf8();
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::desert)+":FORAGE", false);
}
else
if( CSheetId(cs->getSheetId()).toString() == "mod_forest_forage_success.sbrick" )
{
ustr = CI18N::get("uittModForestForageSuccess");
ustr = CI18N::get("uittModForestForageSuccess").toUtf8();
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::forest)+":FORAGE", false);
}
else
if( CSheetId(cs->getSheetId()).toString() == "mod_lacustre_forage_success.sbrick" )
{
ustr = CI18N::get("uittModLacustreForageSuccess");
ustr = CI18N::get("uittModLacustreForageSuccess").toUtf8();
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::lacustre)+":FORAGE", false);
}
else
if( CSheetId(cs->getSheetId()).toString() == "mod_jungle_forage_success.sbrick" )
{
ustr = CI18N::get("uittModJungleForageSuccess");
ustr = CI18N::get("uittModJungleForageSuccess").toUtf8();
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::jungle)+":FORAGE", false);
}
else
if( CSheetId(cs->getSheetId()).toString() == "mod_primary_root_forage_success.sbrick" )
{
ustr = CI18N::get("uittModPrimaryRootForageSuccess");
ustr = CI18N::get("uittModPrimaryRootForageSuccess").toUtf8();
nodeSM = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:CHARACTER_INFO:SUCCESS_MODIFIER:ECO:"+toString((uint8)ECOSYSTEM::primary_root)+":FORAGE", false);
}
@ -3576,19 +3576,19 @@ public:
// special tooltip? (pvp outpost and xp catalyzer)
sint specialTTId= getBonusMalusSpecialTT(cs);
if(specialTTId==BONUS_MALUS::XpCatalyser)
CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittXpBonus"));
CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittXpBonus").toUtf8());
else if(specialTTId==BONUS_MALUS::OutpostPVPOn)
CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittPvpOutpostOn"));
CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittPvpOutpostOn").toUtf8());
else if(specialTTId==BONUS_MALUS::OutpostPVPOutOfZone)
CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittPvpOutpostOutOfZone"));
CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittPvpOutpostOutOfZone").toUtf8());
else if(specialTTId==BONUS_MALUS::OutpostPVPInRound)
CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittPvpOutpostInRound"));
CWidgetManager::getInstance()->setContextHelpText(CI18N::get("uittPvpOutpostInRound").toUtf8());
else if(specialTTId==BONUS_MALUS::DeathPenalty)
{
CCDBNodeLeaf * node = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:USER:DEATH_XP_MALUS", false);
if( node )
{
ucstring txt = CI18N::get("uittDeathPenalty");
string txt = CI18N::get("uittDeathPenalty").toUtf8();
strFindReplace(txt, "%dp", toString((100*node->getValue16())/254));
CWidgetManager::getInstance()->setContextHelpText(txt);
}
@ -3597,10 +3597,10 @@ public:
else if( getAuraDisabledState(cs) )
{
// get the normal string, and append a short info.
ucstring str;
std::string str;
cs->getContextHelp(str);
str+= CI18N::get("uittAuraDisabled");
str+= CI18N::get("uittAuraDisabled").toUtf8();
// and replace the context help that is required.
CWidgetManager::getInstance()->setContextHelpText(str);
@ -3630,7 +3630,7 @@ public:
CCDBNodeLeaf *node = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:PACK_ANIMAL:BEAST%d:NAME", index));
if (node && CStringManagerClient::instance()->getDynString(node->getValue32(), txt))
{
CWidgetManager::getInstance()->setContextHelpText(CEntityCL::removeTitleFromName(txt));
CWidgetManager::getInstance()->setContextHelpText(CEntityCL::removeTitleFromName(txt).toUtf8());
}
}
};
@ -3676,7 +3676,7 @@ public:
str += toString(minTimeRemaining);
// replace the context help that is required.
CWidgetManager::getInstance()->setContextHelpText(str);
CWidgetManager::getInstance()->setContextHelpText(str.toUtf8());
}
};
REGISTER_ACTION_HANDLER( CHandlerAnimalDeadPopupTooltip, "animal_dead_popup_tooltip");

@ -1699,7 +1699,7 @@ public:
else
strFindReplace(str, "%comp", CI18N::get("uittPhraseCombatRestrictOK"));
CWidgetManager::getInstance()->setContextHelpText(str);
CWidgetManager::getInstance()->setContextHelpText(str.toUtf8());
}
};
REGISTER_ACTION_HANDLER( CHandlerCombatRestrictTooltip, "phrase_combat_restrict_tooltip");

@ -1810,12 +1810,12 @@ void CActionPhraseFaber::updateItemResult()
// display something only for magic/protect stat
if( RM_FABER_STAT_TYPE::isMagicResistStat(RM_FABER_STAT_TYPE::TRMStatType(i)) ||
RM_FABER_STAT_TYPE::isMagicProtectStat(RM_FABER_STAT_TYPE::TRMStatType(i)) )
statToolTip->setDefaultContextHelp(CI18N::get("uiFaberStatActive"));
statToolTip->setDefaultContextHelp(CI18N::get("uiFaberStatActive").toUtf8());
else
statToolTip->setDefaultContextHelp(ucstring());
statToolTip->setDefaultContextHelp(std::string());
}
else
statToolTip->setDefaultContextHelp(CI18N::get("uiFaberStatGrayed"));
statToolTip->setDefaultContextHelp(CI18N::get("uiFaberStatGrayed").toUtf8());
}
}

@ -600,12 +600,12 @@ void CBotChatPageTrade::updateTradeModal()
if (_BuyMean == MoneyGuildXP)
{
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughMoney"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughMoney"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughMoney").toUtf8());
}
else
{
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughGuildMoney"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildMoney"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildMoney").toUtf8());
}
return;
}
@ -616,7 +616,7 @@ void CBotChatPageTrade::updateTradeModal()
if (confirmTradeGroup) confirmTradeGroup->setActive(false);
if (cantTradeGroup) cantTradeGroup->setActive(true);
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughGuildXP"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildXP"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildXP").toUtf8());
return;
}
}
@ -677,7 +677,7 @@ void CBotChatPageTrade::updateTradeModal()
if (cantTradeGroup) cantTradeGroup->setActive(true);
// can't sell more than what is in inventory
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiBCNotAvailable"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBCNotAvailable"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBCNotAvailable").toUtf8());
ok= false;
}
@ -692,7 +692,7 @@ void CBotChatPageTrade::updateTradeModal()
if (cantTradeGroup) cantTradeGroup->setActive(true);
// can't sell more than what is in inventory
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiBadQuantity"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBadQuantity"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBadQuantity").toUtf8());
ok= false;
}
}
@ -710,7 +710,7 @@ void CBotChatPageTrade::updateTradeModal()
if (confirmTradeGroup) confirmTradeGroup->setActive(false);
if (cantTradeGroup) cantTradeGroup->setActive(true);
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughMoney"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughMoney"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughMoney").toUtf8());
}
else if (_BuyMean == MoneyFactionPoints)
{
@ -722,7 +722,7 @@ void CBotChatPageTrade::updateTradeModal()
confirmTradeGroup->setActive(false);
cantTradeGroup->setActive(true);
cantTradeButton->setText(CI18N::get("uiNotEnoughFP_"+PVP_CLAN::toString(fpType)));
cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughFP_"+PVP_CLAN::toString(fpType)));
cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughFP_"+PVP_CLAN::toString(fpType)).toUtf8());
}
else
{
@ -745,7 +745,7 @@ void CBotChatPageTrade::updateTradeModal()
if (confirmTradeGroup) confirmTradeGroup->setActive(false);
if (cantTradeGroup) cantTradeGroup->setActive(true);
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughSkillPoints"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughSkillPoints"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughSkillPoints").toUtf8());
}
else
{
@ -761,7 +761,7 @@ void CBotChatPageTrade::updateTradeModal()
if (confirmTradeGroup) confirmTradeGroup->setActive(false);
if (cantTradeGroup) cantTradeGroup->setActive(true);
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiNotEnoughGuildXP"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildXP"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittNotEnoughGuildXP").toUtf8());
}
else
{
@ -780,7 +780,7 @@ void CBotChatPageTrade::updateTradeModal()
if (cantTradeGroup) cantTradeGroup->setActive(true);
// can't sell less than the basic price
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiBadResalePrice"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBadResalePrice"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBadResalePrice").toUtf8());
}
// else ok, can resell
else
@ -812,7 +812,7 @@ void CBotChatPageTrade::updateTradeModal()
if (_SellDlgOn && priceWithoutFame == 0)
{
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiWontBuyThis"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittWontBuyThis"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittWontBuyThis").toUtf8());
}
else if (_SellDlgOn && priceWithoutFame == std::numeric_limits<uint64>::max())
{
@ -821,7 +821,7 @@ void CBotChatPageTrade::updateTradeModal()
else if (quantity == 0 || quantity == std::numeric_limits<uint32>::max())
{
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiBadQuantity"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBadQuantity"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBadQuantity").toUtf8());
}
}
}
@ -893,7 +893,7 @@ void CBotChatPageTrade::startBuyDialog(CDBCtrlSheet *sheet, CCtrlBase * /* pCall
{
confirmButton->setActive( true );
// no need any context help because too simple
confirmButton->setDefaultContextHelp(ucstring());
confirmButton->setDefaultContextHelp(std::string());
if(isItem)
{
CItemSheet * itemSheet = dynamic_cast<CItemSheet*> ( SheetMngr.get( CSheetId( sheet->getSheetId() ) ) );
@ -1003,7 +1003,7 @@ void CBotChatPageTrade::startSellDialog(CDBCtrlSheet *sheet, CCtrlBase * /* pCal
{
confirmButton->setActive( !sheet->getLockedByOwner() );
confirmButton->setText(CI18N::get("uiSellImmediately"));
confirmButton->setDefaultContextHelp(CI18N::get("uittDirectSellButton"));
confirmButton->setDefaultContextHelp(CI18N::get("uittDirectSellButton").toUtf8());
}
// set item or skill name
@ -2428,7 +2428,7 @@ public:
void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */)
{
// \todo yoyo: for now disable tooltip
CWidgetManager::getInstance()->setContextHelpText(ucstring());
CWidgetManager::getInstance()->setContextHelpText(std::string());
}
};
REGISTER_ACTION_HANDLER(CHandlerBotChatTTItemType, "botchat_tt_item_type");

@ -3379,13 +3379,13 @@ void CDBCtrlSheet::setupItemInfoWaiter()
}
// ***************************************************************************
void CDBCtrlSheet::getContextHelp(ucstring &help) const
void CDBCtrlSheet::getContextHelp(std::string &help) const
{
if (getType() == CCtrlSheetInfo::SheetType_Skill)
{
// just show the name of the skill
// the sheet id is interpreted as a skill enum
help= STRING_MANAGER::CStringManagerClient::getSkillLocalizedName( (SKILLS::ESkills)_SheetId.getSInt32() );
help= CUtfStringView(STRING_MANAGER::CStringManagerClient::getSkillLocalizedName( (SKILLS::ESkills)_SheetId.getSInt32() )).toUtf8();
}
else if(getType() == CCtrlSheetInfo::SheetType_Macro)
{
@ -3432,7 +3432,7 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const
strFindReplace(dispText, ucstring("%n"), macroName);
strFindReplace(dispText, ucstring("%k"), assignedTo);
strFindReplace(dispText, ucstring("%c"), dispCommands);
help = dispText;
help = dispText.toUtf8();
}
else if(getType() == CCtrlSheetInfo::SheetType_Item)
{
@ -3443,10 +3443,10 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const
{
// call lua function to update tooltip window
_ItemInfoWaiter.sendRequest();
help = _ItemInfoWaiter.infoValidated();
help = _ItemInfoWaiter.infoValidated().toUtf8();
// its expected to get at least item name back
if (help.empty())
help = getItemActualName();
help = getItemActualName().toUtf8();
}
else if (!_ContextHelp.empty())
{
@ -3454,7 +3454,7 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const
}
else
{
help = getItemActualName();
help = getItemActualName().toUtf8();;
}
}
else
@ -3485,7 +3485,7 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const
CSBrickManager *pBM= CSBrickManager::getInstance();
CSBrickSheet *brick= pBM->getBrick(CSheetId(getSheetId()));
if(brick)
help= STRING_MANAGER::CStringManagerClient::getSBrickLocalizedName(brick->Id);
help= CUtfStringView(STRING_MANAGER::CStringManagerClient::getSBrickLocalizedName(brick->Id)).toUtf8();
else
help= _ContextHelp;
}
@ -3494,7 +3494,7 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const
sint32 phraseId= getSheetId();
if (phraseId == 0)
{
help = ucstring();
help = std::string();
}
else
{
@ -3512,10 +3512,11 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const
game = game["game"];
game.callMethodByNameNoThrow("updatePhraseTooltip", 1, 1);
// retrieve result from stack
help = ucstring();
ucstring tmpHelp;
if (!ls->empty())
{
CLuaIHM::pop(*ls, help);
CLuaIHM::pop(*ls, tmpHelp); // FIXME: Lua UTF-8
help = tmpHelp.toUtf8();
}
else
{
@ -3548,7 +3549,7 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const
{
CSPhraseSheet *phrase= dynamic_cast<CSPhraseSheet*>(SheetMngr.get(CSheetId(getSheetId())));
if(phrase)
help= STRING_MANAGER::CStringManagerClient::getSPhraseLocalizedName(phrase->Id);
help= CUtfStringView(STRING_MANAGER::CStringManagerClient::getSPhraseLocalizedName(phrase->Id)).toUtf8();
else
help= _ContextHelp;
}
@ -3556,14 +3557,14 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const
{
const COutpostBuildingSheet *outpost = asOutpostBuildingSheet();
if (outpost)
help = CStringManagerClient::getOutpostBuildingLocalizedName(CSheetId(_SheetId.getSInt32()));
help = CUtfStringView(CStringManagerClient::getOutpostBuildingLocalizedName(CSheetId(_SheetId.getSInt32()))).toUtf8();
else
help = _ContextHelp;
}
}
// ***************************************************************************
void CDBCtrlSheet::getContextHelpToolTip(ucstring &help) const
void CDBCtrlSheet::getContextHelpToolTip(std::string &help) const
{
// Special case for buff items and spell crystals, only for tooltips
if (getType() == CCtrlSheetInfo::SheetType_Item)
@ -3574,7 +3575,7 @@ void CDBCtrlSheet::getContextHelpToolTip(ucstring &help) const
if (useItemInfoForFamily(item->Family))
{
_ItemInfoWaiter.sendRequest();
help = _ItemInfoWaiter.infoValidated();
help = _ItemInfoWaiter.infoValidated().toUtf8();
return;
}
}

@ -393,9 +393,9 @@ public:
NLMISC::CRGBA getSheetColor() const {return _SheetColor;}
/// Special ContextHelp for ctrl sheet.
virtual void getContextHelp(ucstring &help) const;
virtual void getContextHelp(std::string &help) const;
virtual void getContextHelpToolTip(ucstring &help) const;
virtual void getContextHelpToolTip(std::string &help) const;
/** true if an item of another ctrlSheet can be dropped on this slot.

@ -1051,14 +1051,14 @@ void CDBGroupListSheetText::CSheetChild::updateViewTextAsItem()
if(Ctrl && Text && Ctrl->getSheetCategory() == CDBCtrlSheet::Item)
{
// get the text
ucstring text;
std::string text;
Ctrl->getContextHelp(text);
// Text color red if requirement not met
if(Ctrl->getType() == CCtrlSheetInfo::SheetType_Item)
{
if(!Ctrl->checkItemRequirement())
text= CI18N::get("uiItemCannotUseColor") + text;
text= CI18N::get("uiItemCannotUseColor").toUtf8() + text;
}
// For item, add some information
@ -1075,18 +1075,18 @@ void CDBGroupListSheetText::CSheetChild::updateViewTextAsItem()
if(ipList.empty())
{
if(pIS->isUsedAsCraftRequirement())
text+= "\n" + CI18N::get("uiItemMpCraftRequirement");
text+= "\n" + CI18N::get("uiItemMpCraftRequirement").toUtf8();
else
text+= "\n" + CI18N::get("uiItemMpNoCraft");
text+= "\n" + CI18N::get("uiItemMpNoCraft").toUtf8();
}
else
text+= "\n" + CI18N::get("uiItemMpCanCraft") + ipList;
text+= "\n" + CI18N::get("uiItemMpCanCraft").toUtf8() + ipList.toUtf8();
}
}
}
// set text
Text->setTextFormatTaged(text.toUtf8());
Text->setTextFormatTaged(text);
}
}

@ -133,9 +133,9 @@ public:
// Called at updateCoords to remake the text
virtual void updateViewText(CDBGroupListSheetText * /* pFather */)
{
ucstring text;
std::string text;
Ctrl->getContextHelp(text);
Text->setText(text.toUtf8());
Text->setText(text);
}
// create a CViewText object that is displayed next to the item. This is the opportunnity to create

@ -77,7 +77,7 @@ void CDBGroupListSheetTextPhrase::CSheetChildPhrase::init(CDBGroupListSheetText
// ***************************************************************************
void CDBGroupListSheetTextPhrase::CSheetChildPhrase::updateViewText(CDBGroupListSheetText * /* pFather */)
{
ucstring text;
std::string text;
if(Ctrl->getType()!=CCtrlSheetInfo::SheetType_SPhrase)
return;
@ -87,14 +87,14 @@ void CDBGroupListSheetTextPhrase::CSheetChildPhrase::updateViewText(CDBGroupList
// append the level if possible
if(LevelDB)
{
ucstring fmt= CI18N::get("uiPhraseLevelFmt");
std::string fmt= CI18N::get("uiPhraseLevelFmt").toUtf8();
strFindReplace(fmt, "%d", toString(LevelCache));
text+= "\n" + fmt;
}
#endif
// set
Text->setText(text.toUtf8());
Text->setText(text);
}

@ -41,14 +41,14 @@ CDBGroupListSheetTextPhraseId::CSheetChildPhrase::CSheetChildPhrase()
// ***************************************************************************
void CDBGroupListSheetTextPhraseId::CSheetChildPhrase::updateViewText(CDBGroupListSheetText * /* pFather */)
{
ucstring text;
std::string text;
if(Ctrl->getType()!=CCtrlSheetInfo::SheetType_SPhraseId)
return;
// Get the User Name of the phrase
Ctrl->getContextHelp(text);
Text->setText(text.toUtf8());
Text->setText(text);
}
// ***************************************************************************

@ -248,16 +248,16 @@ void CDBGroupListSheetTrade::CSheetChildTrade::update(CDBGroupListSheetText *pFa
void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetText *pFather)
{
H_AUTO(CDBGroupListSheetTrade_updateViewText);
ucstring text;
std::string text;
Ctrl->getContextHelp(text);
// Append first the type of the sheet to select
switch ( Ctrl->getSheetCategory() )
{
case CDBCtrlSheet::Item: break; // none for item. consider useless
case CDBCtrlSheet::Pact: text= CI18N::get("uiBotChatPact") + text; break;
case CDBCtrlSheet::Skill: text= CI18N::get("uiBotChatSkill") + text; break;
case CDBCtrlSheet::GuildFlag: text= CI18N::get("uiBotChatSkill") + text; break;
case CDBCtrlSheet::Phrase: text= CI18N::get("uiBotChatPhrase") + text; break;
case CDBCtrlSheet::Pact: text= CI18N::get("uiBotChatPact").toUtf8() + text; break;
case CDBCtrlSheet::Skill: text= CI18N::get("uiBotChatSkill").toUtf8() + text; break;
case CDBCtrlSheet::GuildFlag: text= CI18N::get("uiBotChatSkill").toUtf8() + text; break;
case CDBCtrlSheet::Phrase: text= CI18N::get("uiBotChatPhrase").toUtf8() + text; break;
default: break;
}
@ -268,11 +268,11 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
if (pOBS != NULL)
{
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
text += string("\n") + pSMC->getOutpostBuildingLocalizedDescription(CSheetId(Ctrl->getSheetId()));
text += "\n" + CI18N::get("uiBotChatPrice") + NLMISC::formatThousands(toString(pOBS->CostDapper));
text += CI18N::get("uiBotChatTime") + toString(pOBS->CostTime/60) + CI18N::get("uiBotChatTimeMinute");
text += string("\n") + CUtfStringView(pSMC->getOutpostBuildingLocalizedDescription(CSheetId(Ctrl->getSheetId()))).toUtf8();
text += "\n" + CI18N::get("uiBotChatPrice").toUtf8() + NLMISC::formatThousands(toString(pOBS->CostDapper));
text += CI18N::get("uiBotChatTime").toUtf8() + toString(pOBS->CostTime/60) + CI18N::get("uiBotChatTimeMinute").toUtf8();
if ((pOBS->CostTime % 60) != 0)
text += toString(pOBS->CostTime%60) + CI18N::get("uiBotChatTimeSecond");
text += toString(pOBS->CostTime%60) + CI18N::get("uiBotChatTimeSecond").toUtf8();
}
}
@ -288,16 +288,16 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
if(!weaponRestriction.empty() && weaponRestriction!=CI18N::get("uiawrSF"))
{
weaponRestriction= CI18N::get("uiPhraseWRHeader") + weaponRestriction;
text+= "\n" + weaponRestriction;
text+= "\n" + weaponRestriction.toUtf8();
}
}
// Get the Text color
ucstring colorTag("@{FFFF}");
std::string colorTag("@{FFFF}");
if(Ctrl->getType() == CCtrlSheetInfo::SheetType_Item)
{
if(!Ctrl->checkItemRequirement())
colorTag= CI18N::get("uiItemCannotUseColor");
colorTag= CI18N::get("uiItemCannotUseColor").toUtf8();
}
// For item, add some information
@ -314,12 +314,12 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
if(ipList.empty())
{
if(pIS->isUsedAsCraftRequirement())
text+= "\n" + CI18N::get("uiItemMpCraftRequirement");
text+= "\n" + CI18N::get("uiItemMpCraftRequirement").toUtf8();
else
text+= "\n" + CI18N::get("uiItemMpNoCraft");
text+= "\n" + CI18N::get("uiItemMpNoCraft").toUtf8();
}
else
text+= "\n" + CI18N::get("uiItemMpCanCraft") + ipList;
text+= "\n" + CI18N::get("uiItemMpCanCraft").toUtf8() + ipList.toUtf8();
}
}
}
@ -331,9 +331,9 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
if(Ctrl->getSheetCategory() == CDBCtrlSheet::Phrase)
{
if (LastPrice != -1)
text+= "\n" + CI18N::get("uiBotChatSkillPointCost") + toString(LastPrice);
text+= "\n" + CI18N::get("uiBotChatSkillPointCost").toUtf8() + toString(LastPrice);
else
text+= "\n" + CI18N::get("uiBotChatSkillPointCostNotReceived");
text+= "\n" + CI18N::get("uiBotChatSkillPointCostNotReceived").toUtf8();
}
else
{
@ -345,8 +345,8 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
const CItemSheet *pIS = Ctrl->asItemSheet();
if (pIS && pIS->Family == ITEMFAMILY::GUILD_OPTION)
{
text+= "\n" + CI18N::get("uiBotChatSkillPointCost") + toString(pIS->GuildOption.XPCost);
text+= "\n" + CI18N::get("uiBotChatPrice") + NLMISC::formatThousands(toString(pIS->GuildOption.MoneyCost));
text+= "\n" + CI18N::get("uiBotChatSkillPointCost").toUtf8() + toString(pIS->GuildOption.XPCost);
text+= "\n" + CI18N::get("uiBotChatPrice").toUtf8() + NLMISC::formatThousands(toString(pIS->GuildOption.MoneyCost));
guildOption= true;
}
}
@ -381,10 +381,10 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
if (LastPrice > 0)
{
if(displayMulPrice)
text+= "\n" + CI18N::get("uiBotChatPrice") + NLMISC::formatThousands(toString(sint32(LastPrice * priceFactor))) + " ("
text+= "\n" + CI18N::get("uiBotChatPrice").toUtf8() + NLMISC::formatThousands(toString(sint32(LastPrice * priceFactor))) + " ("
+ NLMISC::formatThousands(toString( sint32(factor) * sint32(LastPrice * priceFactor) )) + ")";
else
text+= "\n" + CI18N::get("uiBotChatPrice") + NLMISC::formatThousands(toString( sint32(factor * LastPrice * priceFactor) ));
text+= "\n" + CI18N::get("uiBotChatPrice").toUtf8() + NLMISC::formatThousands(toString( sint32(factor * LastPrice * priceFactor) ));
}
if ((LastFactionPointPrice != 0) && (LastFactionType >= PVP_CLAN::BeginClans) && (LastFactionType <= PVP_CLAN::EndClans))
@ -394,8 +394,8 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
else
text+= "\n";
text+= CI18N::get("uiBotChatFactionType") + PVP_CLAN::toString((PVP_CLAN::TPVPClan)LastFactionType)
+ CI18N::get("uiBotChatFactionPointPrice") + NLMISC::formatThousands(toString(LastFactionPointPrice));
text+= CI18N::get("uiBotChatFactionType").toUtf8() + PVP_CLAN::toString((PVP_CLAN::TPVPClan)LastFactionType)
+ CI18N::get("uiBotChatFactionPointPrice").toUtf8() + NLMISC::formatThousands(toString(LastFactionPointPrice));
}
// some additional info for resale
@ -407,31 +407,31 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
{
// append price
if(pIS && pIS->Stackable>1 && zeFather->getMultiplyPriceByQuantityFlag())
text+= CI18N::get("uiBotChatRetirePrice") + NLMISC::formatThousands(toString(LastPriceRetire)) + " ("
text+= CI18N::get("uiBotChatRetirePrice").toUtf8() + NLMISC::formatThousands(toString(LastPriceRetire)) + " ("
+ NLMISC::formatThousands(toString(factor * LastPriceRetire)) + ")";
else
text+= CI18N::get("uiBotChatRetirePrice") + NLMISC::formatThousands(toString(factor * LastPriceRetire));
text+= CI18N::get("uiBotChatRetirePrice").toUtf8() + NLMISC::formatThousands(toString(factor * LastPriceRetire));
// set resale time left
ucstring fmt= CI18N::get("uiBotChatResaleTimeLeft");
std::string fmt= CI18N::get("uiBotChatResaleTimeLeft").toUtf8();
strFindReplace(fmt, "%d", toString(LastResaleTimeLeft/RYZOM_DAY_IN_HOUR));
strFindReplace(fmt, "%h", toString(LastResaleTimeLeft%RYZOM_DAY_IN_HOUR));
text+= "\n" + fmt;
// force special color (according if retirable or not)
if(LastSellerType == BOTCHATTYPE::UserRetirable || LastSellerType == BOTCHATTYPE::ResaleAndUserRetirable)
colorTag= CI18N::get("uiItemUserSellColor");
colorTag= CI18N::get("uiItemUserSellColor").toUtf8();
else
colorTag= CI18N::get("uiItemUserSellColorNotRetirable");
colorTag= CI18N::get("uiItemUserSellColorNotRetirable").toUtf8();
}
// Append (NPC) tag if NPC item
if(LastSellerType == BOTCHATTYPE::NPC)
{
text+= "\n" + CI18N::get("uiBotChatNPCTag");
text+= "\n" + CI18N::get("uiBotChatNPCTag").toUtf8();
}
// else display the name of the vendor (not if this is the player himself, to avoid flood)
else if (LastSellerType == BOTCHATTYPE::Resale)
{
text+= "\n" + CI18N::get("uiBotChatVendorTag") + VendorNameString;
text+= "\n" + CI18N::get("uiBotChatVendorTag").toUtf8() + VendorNameString.toUtf8();
}
}
}
@ -441,14 +441,14 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
if(zeFather->sellerTypeWanted() &&
(LastSellerType == BOTCHATTYPE::User || LastSellerType == BOTCHATTYPE::UserRetirable) )
{
text+= "\n" + CI18N::get("uiItemSold");
text+= "\n" + CI18N::get("uiItemSold").toUtf8();
// force special color
colorTag= CI18N::get("uiItemSoldColor");
colorTag= CI18N::get("uiItemSoldColor").toUtf8();
}
// error case
else
{
text+= "\n" + CI18N::get("uiPriceNotReceived");
text+= "\n" + CI18N::get("uiPriceNotReceived").toUtf8();
}
}
}
@ -457,7 +457,7 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
// setup color and text
text= colorTag + text;
Text->setTextFormatTaged(text.toUtf8());
Text->setTextFormatTaged(text);
}
// ***************************************************************************

@ -424,11 +424,10 @@ void CGroupCompas::draw()
CCtrlBase *toolTip = getCtrl("tt");
if (toolTip)
{
ucstring text;
if (displayedTarget.getType() != CCompassTarget::North)
toolTip->setDefaultContextHelp(CI18N::get("uittCompassDistance"));
toolTip->setDefaultContextHelp(CI18N::get("uittCompassDistance").toUtf8());
else
toolTip->setDefaultContextHelp(text);
toolTip->setDefaultContextHelp(std::string());
}
if (displayedTarget.Name != _CurrTargetName)

@ -759,7 +759,7 @@ CGroupInSceneBubbleManager::CPopupContext *CGroupInSceneBubbleManager::buildCont
void CGroupInSceneBubbleManager::addContextHelp (const ucstring &message, const string &targetName, uint time)
{
ucstring finalMessage = message;
std::string finalMessage = message.toUtf8();
CInterfaceElement *target;
CPopupContext *context = CGroupInSceneBubbleManager::buildContextHelp ("context_help_", targetName, target, time);
if (context)
@ -787,7 +787,7 @@ void CGroupInSceneBubbleManager::addContextHelp (const ucstring &message, const
}
}
text->setText(finalMessage.toUtf8());
text->setText(finalMessage);
}
}
context->Group->setActive(true);

@ -1122,7 +1122,7 @@ void CGroupInSceneUserInfo::updateDynamicData ()
{
CInterfaceGroup *group = getGroup ("right");
CForageSourceCL *forageSource = static_cast<CForageSourceCL*>(_Entity);
ucstring txt( CI18N::get( "uittForageContent" ) + toString( ": %u", forageSource->getCurrentQuantity() ) );
string txt( CI18N::get( "uittForageContent" ).toUtf8() + toString( ": %u", forageSource->getCurrentQuantity() ) );
CCtrlBase *toolTip = group->getCtrl ("tt1");
if ( toolTip )
toolTip->setDefaultContextHelp( txt );

@ -697,7 +697,7 @@ bool CGroupMap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
{
_HomeLM->setParent(this);
addCtrl(_HomeLM);
_HomeLM->setDefaultContextHelp(NLMISC::CI18N::get("uiHome"));
_HomeLM->setDefaultContextHelp(NLMISC::CI18N::get("uiHome").toUtf8());
}
// create animals Landmark: pack Animals.
@ -709,7 +709,7 @@ bool CGroupMap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
{
_AnimalLM[i]->setParent(this);
addCtrl(_AnimalLM[i]);
_AnimalLM[i]->setDefaultContextHelp(NLMISC::CI18N::get(NLMISC::toString("uiPATitleMount%d", i+1)));
_AnimalLM[i]->setDefaultContextHelp(NLMISC::CI18N::get(NLMISC::toString("uiPATitleMount%d", i+1)).toUtf8());
}
}
@ -722,7 +722,7 @@ bool CGroupMap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
{
_TeammateLM[i]->setParent(this);
addCtrl(_TeammateLM[i]);
_TeammateLM[i]->setDefaultContextHelp(NLMISC::CI18N::get(NLMISC::toString("uittLMTeam%d",i)));
_TeammateLM[i]->setDefaultContextHelp(NLMISC::CI18N::get(NLMISC::toString("uittLMTeam%d",i)).toUtf8());
}
}
}
@ -1179,7 +1179,7 @@ void CGroupMap::checkCoords()
ucstring result;
if (STRING_MANAGER::CStringManagerClient::instance()->getDynString(_MissionTargetTextIDs[k], result))
{
_MissionLM[k]->setDefaultContextHelp(result);
_MissionLM[k]->setDefaultContextHelp(result.toUtf8());
_MissionTargetTextReceived[k] = true;
}
}
@ -1201,7 +1201,7 @@ void CGroupMap::checkCoords()
CEntityCL *sel = EntitiesMngr.entity(UserEntity->selection());
if (sel)
{
_TargetLM->setDefaultContextHelp(NLMISC::CI18N::get("uiTargetTwoPoint") + sel->removeTitleAndShardFromName(sel->getEntityName()));
_TargetLM->setDefaultContextHelp(NLMISC::CI18N::get("uiTargetTwoPoint").toUtf8() + sel->removeTitleAndShardFromName(sel->getEntityName()).toUtf8());
}
}
}
@ -1374,7 +1374,7 @@ void CGroupMap::checkCoords()
case ANIMAL_TYPE::Packer: sPrefix = "uiPATitlePacker"; break;
case ANIMAL_TYPE::Demon: sPrefix = "uiPATitleDemon"; break;
}
_AnimalLM[i]->setDefaultContextHelp(NLMISC::CI18N::get(sPrefix+toString(i+1)));
_AnimalLM[i]->setDefaultContextHelp(NLMISC::CI18N::get(sPrefix+toString(i+1)).toUtf8());
}
}
}
@ -1408,7 +1408,7 @@ void CGroupMap::checkCoords()
if (pSMC->getString(val,res))
{
res = CEntityCL::removeTitleAndShardFromName(res);
_TeammateLM[i]->setDefaultContextHelp(res);
_TeammateLM[i]->setDefaultContextHelp(res.toUtf8());
}
}
updateLMPosFromDBPos(_TeammateLM[i], px, py);
@ -2811,7 +2811,7 @@ void CGroupMap::addLandMark(TLandMarkButtonVect &destList, const NLMISC::CVector
CLandMarkButton *lmb = createLandMarkButton(options);
lmb->setParent(this);
lmb->Pos = pos;
lmb->setDefaultContextHelp(title);
lmb->setDefaultContextHelp(title.toUtf8());
destList.push_back(lmb);
addCtrl(lmb);
}
@ -2937,7 +2937,7 @@ void CGroupMap::updateUserLandMark(CCtrlButton *button, const ucstring &newTitle
_CurContinent->UserLandMarks[k].Type = (uint8)lmType;
updateLandMarkButton(_UserLM[k], getUserLandMarkOptions(k));
button->setDefaultContextHelp(newTitle);
button->setDefaultContextHelp(newTitle.toUtf8());
CInterfaceManager::getInstance()->saveLandmarks();
return;
@ -3199,7 +3199,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm)
if (it != _ContinentLM.end())
{
ct.setType(CCompassTarget::ContinentLandMark);
(*it)->getContextHelp(ct.Name);
(*it)->getContextHelpAsUtf16(ct.Name);
mapToWorld(ct.Pos, (*it)->Pos);
found = true;
}
@ -3212,7 +3212,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm)
if (it != _MissionLM.end())
{
ct.setPositionState(_MissionPosStates[it - _MissionLM.begin()]);
(*it)->getContextHelp(ct.Name);
(*it)->getContextHelpAsUtf16(ct.Name);
mapToWorld(ct.Pos, (*it)->Pos);
found = true;
}
@ -3226,7 +3226,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm)
if (it != _UserLM.end())
{
ct.setType(CCompassTarget::UserLandMark);
(*it)->getContextHelp(ct.Name);
(*it)->getContextHelpAsUtf16(ct.Name);
mapToWorld(ct.Pos, (*it)->Pos);
found = true;
}
@ -3254,7 +3254,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm)
if (!isIsland())
{
ct.setType(CCompassTarget::Respawn);
(*it)->getContextHelp(ct.Name);
(*it)->getContextHelpAsUtf16(ct.Name);
mapToWorld(ct.Pos, (*it)->Pos);
found = true;
}
@ -3300,7 +3300,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm)
{
if(_AnimalLM[i]==lm)
{
_AnimalLM[i]->getContextHelp(ct.Name);
_AnimalLM[i]->getContextHelpAsUtf16(ct.Name);
// copy The Animal Pos retriever into the compass
ct.setPositionState(_AnimalPosStates[i]);
found = true;
@ -3318,7 +3318,7 @@ void CGroupMap::targetLandmark(CCtrlButton *lm)
{
if(_TeammateLM[i]==lm)
{
_TeammateLM[i]->getContextHelp(ct.Name);
_TeammateLM[i]->getContextHelpAsUtf16(ct.Name);
// copy The Animal Pos retriever into the compass
ct.setPositionState(_TeammatePosStates[i]);
found = true;
@ -3380,7 +3380,7 @@ CGroupMap::CLandMarkButton* CGroupMap::findClosestLandmark(const CVector2f &cent
for(TLandMarkButtonVect::const_iterator it = landmarks.begin(); it != landmarks.end(); ++it)
{
ucstring lc;
(*it)->getContextHelp(lc);
(*it)->getContextHelpAsUtf16(lc);
if(filterLandmark(lc, keywords, startsWith)) {
CVector2f pos;
mapToWorld(pos, (*it)->Pos);
@ -3442,7 +3442,7 @@ bool CGroupMap::targetLandmarkByName(const ucstring &search, bool startsWith) co
{
ct.setType(CCompassTarget::UserLandMark);
mapToWorld(ct.Pos, lm->Pos);
lm->getContextHelp(ct.Name);
lm->getContextHelpAsUtf16(ct.Name);
closest = dist;
found = true;
}
@ -3455,7 +3455,7 @@ bool CGroupMap::targetLandmarkByName(const ucstring &search, bool startsWith) co
{
ct.setType(CCompassTarget::ContinentLandMark);
mapToWorld(ct.Pos, lm->Pos);
lm->getContextHelp(ct.Name);
lm->getContextHelpAsUtf16(ct.Name);
closest = dist;
found = true;
}

@ -857,17 +857,17 @@ class CAHGuildSheetOpen : public IActionHandler
case ccs_online:
onlineView->setTexture("w_online.tga");
if (toolTip)
toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnline"));
toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnline").toUtf8());
break;
case ccs_online_abroad:
onlineView->setTexture("w_online_abroad.tga");
if (toolTip)
toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnlineAbroad"));
toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOnlineAbroad").toUtf8());
break;
default:
onlineView->setTexture("w_offline.tga");
if (toolTip)
toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOffline"));
toolTip->setDefaultContextHelp(CI18N::get("uittGuildMemberOffline").toUtf8());
break;
}
}

@ -1535,8 +1535,8 @@ void CInterfaceManager::updateFrameEvents()
CCtrlBase *pTooltip= dynamic_cast<CCtrlBase*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:weather_tt"));
if (pTooltip != NULL)
{
ucstring tt = toString("%02d", WeatherManager.getNextWeatherHour()) + CI18N::get("uiMissionTimerHour") +
" - " + CI18N::get("uiHumidity") + " " +
string tt = toString("%02d", WeatherManager.getNextWeatherHour()) + CI18N::get("uiMissionTimerHour").toUtf8() +
" - " + CI18N::get("uiHumidity").toUtf8() + " " +
toString("%d", (uint)(roundWeatherValue(WeatherManager.getNextWeatherValue()) * 100.f)) + "%";
pTooltip->setDefaultContextHelp(tt);
}

@ -2879,7 +2879,7 @@ std::string CLuaIHMRyzom::getDefine(const std::string &def)
// ***************************************************************************
void CLuaIHMRyzom::setContextHelpText(const ucstring &text)
{
CWidgetManager::getInstance()->setContextHelpText(text);
CWidgetManager::getInstance()->setContextHelpText(text.toUtf8());
}
// ***************************************************************************

@ -759,17 +759,17 @@ void CPeopleList::setOnline(uint index, TCharConnectionState online)
case ccs_online:
onlineView->setTexture("w_online.tga");
if (toolTip)
toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOnline"));
toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOnline").toUtf8());
break;
case ccs_online_abroad:
onlineView->setTexture("w_online_abroad.tga");
if (toolTip)
toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOnlineAbroad"));
toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOnlineAbroad").toUtf8());
break;
default:
onlineView->setTexture("w_offline.tga");
if (toolTip)
toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOffline"));
toolTip->setDefaultContextHelp(CI18N::get("uittFriendsOffline").toUtf8());
break;
}
}

@ -73,10 +73,10 @@ public:
return CCtrlPolygon::contains(CVector2f(mouseXInWindow + 0.5f, mouseYInWindow + 0.5f));
}
// tooltip
virtual void getContextHelp(::ucstring &help) const
virtual void getContextHelp(std::string &help) const
{
help = Instance.getDisplayName();
if (std::operator==(help, NLMISC::CI18N::get("uiR2EDNoName") ))
help = Instance.getDisplayName().toUtf8();
if (help == NLMISC::CI18N::get("uiR2EDNoName").toUtf8())
help.clear();
}
bool emptyContextHelp() const { return true; }
@ -122,10 +122,10 @@ public:
return CCtrlQuad::contains(CVector2f(mouseXInWindow + 0.5f, mouseYInWindow + 0.5f));
}
// tooltip
virtual void getContextHelp(ucstring &help) const
virtual void getContextHelp(std::string &help) const
{
help = Instance.getDisplayName();
if (std::operator==(help, NLMISC::CI18N::get("uiR2EDNoName")))
help = Instance.getDisplayName().toUtf8();
if (help == NLMISC::CI18N::get("uiR2EDNoName").toUtf8())
help.clear();
}
bool emptyContextHelp() const { return true; }

@ -40,11 +40,12 @@ namespace R2
{
// *********************************************************************************************************
void CInstanceMapDeco::CCtrlButtonEntity::getContextHelp(ucstring &help) const
void CInstanceMapDeco::CCtrlButtonEntity::getContextHelp(std::string &help) const
{
//H_AUTO(R2_CCtrlButtonEntity_getContextHelp)
help = _Instance.getDisplayName();
if (help == NLMISC::CI18N::get("uiR2EDNoName")) help.clear();
help = _Instance.getDisplayName().toUtf8();
if (help == NLMISC::CI18N::get("uiR2EDNoName").toUtf8())
help.clear();
}
// *********************************************************************************************************

@ -91,7 +91,7 @@ private:
private:
CInstance &_Instance;
protected:
virtual void getContextHelp(ucstring &help) const;
virtual void getContextHelp(std::string &help) const;
bool emptyContextHelp() const { return true; }
bool wantInstantContextHelp() const { return true; }
virtual bool isCapturable() const { return false; }

Loading…
Cancel
Save