settings_internal.h
Go to the documentation of this file.00001
00002
00005 #ifndef SETTINGS_INTERNAL_H
00006 #define SETTINGS_INTERNAL_H
00007
00008 #include "saveload.h"
00009 #include "settings_type.h"
00010
00015 enum SettingDescTypeLong {
00016
00017 SDT_BEGIN = 0,
00018 SDT_NUMX = 0,
00019 SDT_BOOLX = 1,
00020 SDT_ONEOFMANY = 2,
00021 SDT_MANYOFMANY = 3,
00022 SDT_INTLIST = 4,
00023 SDT_STRING = 5,
00024 SDT_END,
00025
00026 };
00027
00028 template <> struct EnumPropsT<SettingDescTypeLong> : MakeEnumPropsT<SettingDescTypeLong, byte, SDT_BEGIN, SDT_END, SDT_END> {};
00029 typedef TinyEnumT<SettingDescTypeLong> SettingDescType;
00030
00031
00032 enum SettingGuiFlagLong {
00033
00034
00035 SGF_NONE = 0,
00036 SGF_0ISDISABLED = 1 << 0,
00037 SGF_NOCOMMA = 1 << 1,
00038 SGF_MULTISTRING = 1 << 2,
00039 SGF_NETWORK_ONLY = 1 << 3,
00040 SGF_CURRENCY = 1 << 4,
00041 SGF_NO_NETWORK = 1 << 5,
00042 SGF_END = 1 << 6,
00043
00044 };
00045
00046 DECLARE_ENUM_AS_BIT_SET(SettingGuiFlagLong);
00047 template <> struct EnumPropsT<SettingGuiFlagLong> : MakeEnumPropsT<SettingGuiFlagLong, byte, SGF_NONE, SGF_END, SGF_END> {};
00048 typedef TinyEnumT<SettingGuiFlagLong> SettingGuiFlag;
00049
00050
00051 typedef int32 OnChange(int32 var);
00052 typedef int32 OnConvert(const char *value);
00053
00054 struct SettingDescBase {
00055 const char *name;
00056 const void *def;
00057 SettingDescType cmd;
00058 SettingGuiFlag flags;
00059 int32 min, max;
00060 int32 interval;
00061 const char *many;
00062 StringID str;
00063 OnChange *proc;
00064 OnConvert *proc_cnvt;
00065 };
00066
00067 struct SettingDesc {
00068 SettingDescBase desc;
00069 SaveLoad save;
00070 };
00071
00072
00073
00074
00075
00076
00077
00078
00079 typedef SettingDesc SettingDescGlobVarList;
00080
00081 enum IniGroupType {
00082 IGT_VARIABLES = 0,
00083 IGT_LIST = 1,
00084 };
00085
00086 const SettingDesc *GetPatchFromName(const char *name, uint *i);
00087 bool SetPatchValue(uint index, const Patches *object, int32 value);
00088
00089 #endif