CvGame::BuildCannotPerformActionHelpText(CvString *, const char *, const char *, const char *, int) const
- Defined in
- CvGame.cpp, line 10998
- Class
- CvGame
- Hook name
CivHooks::CvGame_BuildCannotPerformActionHelpText
Hooks
static bool BeforeCvGame_BuildCannotPerformActionHelpText(const CvGame* self, CvString* toolTipSink, const char* strTextKey, const char* strExtraKey1, const char* strExtraKey2, int iValue);static void AfterCvGame_BuildCannotPerformActionHelpText(const CvGame* self, CvString* toolTipSink, const char* strTextKey, const char* strExtraKey1, const char* strExtraKey2, int iValue);static void ReplaceCvGame_BuildCannotPerformActionHelpText(void (*original)(const CvGame*, CvString*, const char*, const char*, const char*, int), const CvGame* self, CvString* toolTipSink, const char* strTextKey, const char* strExtraKey1, const char* strExtraKey2, int iValue);CivRegisterBefore<CivHooks::CvGame_BuildCannotPerformActionHelpText>(host, &BeforeCvGame_BuildCannotPerformActionHelpText);CivRegisterAfter<CivHooks::CvGame_BuildCannotPerformActionHelpText>(host, &AfterCvGame_BuildCannotPerformActionHelpText);CivRegisterReplace<CivHooks::CvGame_BuildCannotPerformActionHelpText>(host, &ReplaceCvGame_BuildCannotPerformActionHelpText);
Code
10997/// Shortcut for generating production mod tool tip help10998void CvGame::BuildCannotPerformActionHelpText(CvString* toolTipSink, const char* strTextKey, const char* strExtraKey1, const char* strExtraKey2, int iValue) const10999{11000 if(toolTipSink != NULL)11001 {11002 Localization::String localizedText = Localization::Lookup(strTextKey);1100311004 if(iValue != -666)11005 localizedText << iValue;1100611007 if(strExtraKey1)11008 {11009 std::string extraKey1(strExtraKey1);11010 if(!extraKey1.empty())11011 localizedText << strExtraKey1;11012 }1101311014 if(strExtraKey2)11015 {11016 std::string extraKey2(strExtraKey2);11017 if(!extraKey2.empty())11018 localizedText << strExtraKey2;11019 }1102011021 const char* const localized = localizedText.toUTF8();11022 if(localized)11023 (*toolTipSink) += localized;11024 }11025}
Calls
Localization::LookupLocalization::String::toUTF8operator<<operator<<std::basic_string::basic_stringstd::basic_string::emptystd::basic_string::operator+=