summaryrefslogtreecommitdiff
path: root/src/settings_internal.h
diff options
context:
space:
mode:
authorrubidium42 <rubidium@openttd.org>2021-05-22 20:52:24 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-05-27 18:49:43 +0200
commit1f8ff0e4f9895538a98f2a22b2f6b6e62310aae9 (patch)
treebb153f443726184fe787b404a37d2bbc22bfcda4 /src/settings_internal.h
parentbe28c95b30eb433de5e7b9831657af551ef236f9 (diff)
downloadopenttd-1f8ff0e4f9895538a98f2a22b2f6b6e62310aae9.tar.xz
Codechange: make Write_ValidateSetting a function of StringSettingDesc
Diffstat (limited to 'src/settings_internal.h')
-rw-r--r--src/settings_internal.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/settings_internal.h b/src/settings_internal.h
index 7b37ac267..33910e066 100644
--- a/src/settings_internal.h
+++ b/src/settings_internal.h
@@ -111,7 +111,9 @@ struct SettingDesc {
bool IsEditable(bool do_command = false) const;
SettingType GetType() const;
bool IsIntSetting() const;
+ bool IsStringSetting() const;
const struct IntSettingDesc *AsIntSetting() const;
+ const struct StringSettingDesc *AsStringSetting() const;
/**
* Format the value of the setting associated with this object.
@@ -144,6 +146,9 @@ struct StringSettingDesc : SettingDesc {
SettingDesc(save, name, def, cmd, flags, 0, max_length, 0, nullptr, 0, 0, 0, proc, nullptr, SC_NONE, startup) {}
virtual ~StringSettingDesc() {}
+ void ChangeValue(const void *object, const char *newval) const;
+ void Write_ValidateSetting(const void *object, const char *str) const;
+
void FormatValue(char *buf, const char *last, const void *object) const override;
const std::string &Read(const void *object) const;
};