diff options
author | Rubidium <rubidium@openttd.org> | 2021-07-08 19:20:41 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-07-09 22:53:30 +0200 |
commit | 01139d33686945db4ccb77b62acadf2caab3b93e (patch) | |
tree | 62ed03494a78910043ef1e4275a3dd3816e31996 /src/settings_internal.h | |
parent | 94881f5a34340c0398599e09d27c0c9a205294b4 (diff) | |
download | openttd-01139d33686945db4ccb77b62acadf2caab3b93e.tar.xz |
Codechange: access the name of a setting via an accessor function
Diffstat (limited to 'src/settings_internal.h')
-rw-r--r-- | src/settings_internal.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/settings_internal.h b/src/settings_internal.h index a9083ce40..f48245af4 100644 --- a/src/settings_internal.h +++ b/src/settings_internal.h @@ -74,7 +74,9 @@ struct SettingDesc { name(name), flags(flags), startup(startup), save(save) {} virtual ~SettingDesc() {} +private: std::string name; ///< Name of the setting. Used in configuration file and for console. +public: SettingFlag flags; ///< Handles how a setting would show up in the GUI (text/currency, etc.). bool startup; ///< Setting has to be loaded directly at startup?. SaveLoad save; ///< Internal structure (going to savegame, parts to config). @@ -83,6 +85,15 @@ struct SettingDesc { SettingType GetType() const; /** + * Get the name of this setting. + * @return The name of the setting. + */ + constexpr const std::string &GetName() const + { + return this->name; + } + + /** * Check whether this setting is an integer type setting. * @return True when the underlying type is an integer. */ |