CvPreGame::SyncGameOptionsWithEnumList()
- Defined in
- CvPreGame.cpp, line 903
- Hook name
CivHooks::CvPreGame_SyncGameOptionsWithEnumList
Hooks
static bool BeforeCvPreGame_SyncGameOptionsWithEnumList();static void AfterCvPreGame_SyncGameOptionsWithEnumList();static void ReplaceCvPreGame_SyncGameOptionsWithEnumList(void (*original)());CivRegisterBefore<CivHooks::CvPreGame_SyncGameOptionsWithEnumList>(host, &BeforeCvPreGame_SyncGameOptionsWithEnumList);CivRegisterAfter<CivHooks::CvPreGame_SyncGameOptionsWithEnumList>(host, &AfterCvPreGame_SyncGameOptionsWithEnumList);CivRegisterReplace<CivHooks::CvPreGame_SyncGameOptionsWithEnumList>(host, &ReplaceCvPreGame_SyncGameOptionsWithEnumList);
Code
900//! This method sync's up an enum-based array of game options w/ the actual901//! game options structure. This should be called every time new options902//! are set.903void SyncGameOptionsWithEnumList()904{905 const char* str;906 for(int i = 0; i < NUM_GAMEOPTION_TYPES; i++)907 {908 int value = 0;909 str = ConvertGameOptionTypeToString((GameOptionTypes)i);910 if(str)911 {912 GetGameOption(str, value);913 }914 s_EnumBasedGameOptions[i] = value;915 bool v = static_cast<bool>(value);916 switch(i)917 {918 case GAMEOPTION_QUICK_COMBAT:919 s_quickCombat = v; // set directly, to avoid infinite recursion.920 break;921 default:922 break;923 }924 }925}
Calls
- ConvertGameOptionTypeToString(GameOptionTypes)
- CvPreGame::GetGameOption(const char *, int &)
FAutoVariable::operator=