Codechange: use setting name instead of index for CmdChange(Company)Setting (#9306)

This is mostly done as there are now constraints on settings.ini you might not
expected. For example, conditional settings always have to come last, as otherwise
they would influence the index.
This commit is contained in:
Patric Stout
2021-05-29 23:27:01 +02:00
committed by GitHub
parent 5799402f7a
commit d70fb74ac6
8 changed files with 87 additions and 135 deletions

View File

@@ -302,6 +302,5 @@ typedef std::initializer_list<std::unique_ptr<const SettingDesc>> SettingTable;
const SettingDesc *GetSettingFromName(const char *name);
bool SetSettingValue(const IntSettingDesc *sd, int32 value, bool force_newgame = false);
bool SetSettingValue(const StringSettingDesc *sd, const std::string value, bool force_newgame = false);
uint GetSettingIndex(const SettingDesc *sd);
#endif /* SETTINGS_INTERNAL_H */