CvLeague::GetResolutionName(ResolutionTypes, int, int, bool)
- Defined in
- CvVotingClasses.cpp, line 4127
- Class
- CvLeague
- Hook name
CivHooks::CvLeague_GetResolutionName
Hooks
static bool BeforeCvLeague_GetResolutionName(CvLeague* self, ResolutionTypes eResolution, int iResolutionID, int iProposerChoice, bool bIncludePrefix, CvString& result);static void AfterCvLeague_GetResolutionName(CvLeague* self, ResolutionTypes eResolution, int iResolutionID, int iProposerChoice, bool bIncludePrefix, CvString& result);static CvString ReplaceCvLeague_GetResolutionName(CvString (*original)(CvLeague*, ResolutionTypes, int, int, bool), CvLeague* self, ResolutionTypes eResolution, int iResolutionID, int iProposerChoice, bool bIncludePrefix);CivRegisterBefore<CivHooks::CvLeague_GetResolutionName>(host, &BeforeCvLeague_GetResolutionName);CivRegisterAfter<CivHooks::CvLeague_GetResolutionName>(host, &AfterCvLeague_GetResolutionName);CivRegisterReplace<CivHooks::CvLeague_GetResolutionName>(host, &ReplaceCvLeague_GetResolutionName);
Code
4127CvString CvLeague::GetResolutionName(ResolutionTypes eResolution, int iResolutionID, int iProposerChoice, bool bIncludePrefix)4128{4129 CvString s = "";41304131 CvResolutionEntry* pInfo = GC.getResolutionInfo(eResolution);4132 CvAssertMsg(pInfo, "Resolution info not found when assembling name text. Please send Anton your save file and version.");4133 if (!pInfo)4134 {4135 CvAssert(false);4136 return "";4137 }41384139 CvString sPrefix = "";4140 // An existing resolution4141 if (iResolutionID != -1)4142 {4143 // Propose Enact4144 if (IsProposed(iResolutionID, /*bRepeal*/false))4145 {4146 sPrefix += Localization::Lookup("TXT_KEY_LEAGUE_OVERVIEW_PREFIX_ENACT").toUTF8();4147 }4148 // Propose Repeal4149 else if (IsProposed(iResolutionID, /*bRepeal*/true))4150 {4151 sPrefix += Localization::Lookup("TXT_KEY_LEAGUE_OVERVIEW_PREFIX_REPEAL").toUTF8();4152 }4153 // Active4154 else if (GetActiveResolution(iResolutionID) != NULL)4155 {4156 }4157 }4158 // A new resolution4159 else4160 {4161 // Inactive4162 }41634164 CvString sSuffix = "";4165 if (iProposerChoice != LeagueHelpers::CHOICE_NONE)4166 {4167 sSuffix += ": ";4168 sSuffix += LeagueHelpers::GetTextForChoice(pInfo->GetProposerDecision(), iProposerChoice);4169 }41704171 if (bIncludePrefix)4172 {4173 s += sPrefix;4174 }4175 s += Localization::Lookup(pInfo->GetDescriptionKey()).toUTF8();4176 s += sSuffix;41774178 return s;4179}
Calls
- CvBaseInfo::GetDescriptionKey() const
- CvGlobals::getResolutionInfo(ResolutionTypes)
- CvLeague::GetActiveResolution(int)
- CvLeague::IsProposed(int, bool, bool)
- CvResolutionEntry::GetProposerDecision() const
CvString::CvStringCvString::CvString- LeagueHelpers::GetTextForChoice(ResolutionDecisionTypes, int)
Localization::LookupLocalization::String::toUTF8std::basic_string::operator+=std::basic_string::operator+=