From deca0cc3fa6738ac3d0b1a8b4883a5e08fcb21b3 Mon Sep 17 00:00:00 2001 From: belugas Date: Thu, 22 Mar 2007 03:15:58 +0000 Subject: (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 --- src/settings.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/settings.h') 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 : MakeEnumPropsT 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 { -- cgit v1.2.3-54-g00ecf