summaryrefslogtreecommitdiff
path: root/src/settings.h
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-03-22 03:15:58 +0000
committerbelugas <belugas@openttd.org>2007-03-22 03:15:58 +0000
commitdeca0cc3fa6738ac3d0b1a8b4883a5e08fcb21b3 (patch)
tree4b4dbae2b0307b19253b8081d28cac23adc3c3cd /src/settings.h
parente2801aa32046721d2da66c3bed7d6389be82b069 (diff)
downloadopenttd-deca0cc3fa6738ac3d0b1a8b4883a5e08fcb21b3.tar.xz
(svn r9398) -Feature: Allow for a conversion callback system while reading configuration file, in case of wrong value.
This is the basic step, no patch setting is actually using it, so far
Diffstat (limited to 'src/settings.h')
-rw-r--r--src/settings.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/settings.h b/src/settings.h
index 3a7523e18..142f4136a 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -44,7 +44,8 @@ template <> struct EnumPropsT<SettingGuiFlagLong> : MakeEnumPropsT<SettingGuiFla
typedef TinyEnumT<SettingGuiFlagLong> SettingGuiFlag;
-typedef int32 OnChange(int32 var);
+typedef int32 OnChange(int32 var); ///< callback prototype on data modification
+typedef int32 OnConvert(const char *value); ///< callback prototype for convertion error
struct SettingDescBase {
const char *name; ///< name of the setting. Used in configuration file and for console
@@ -56,6 +57,7 @@ struct SettingDescBase {
const char *many; ///< ONE/MANY_OF_MANY: string of possible values for this type
StringID str; ///< (translated) string with descriptive text; gui and console
OnChange *proc; ///< callback procedure for when the value is changed
+ OnConvert *proc_cnvt; ///< callback procedure when loading value mechanism fails
};
struct SettingDesc {