(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
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user