Settings: Merge orderproc into guiproc

This commit is contained in:
Jonathan G Rennison
2021-09-29 20:10:38 +01:00
parent db11c1d927
commit 65c20edde7
11 changed files with 71 additions and 64 deletions

View File

@@ -91,16 +91,17 @@ enum SettingType {
enum SettingOnGuiCtrlType {
SOGCT_DESCRIPTION_TEXT, ///< Description text callback
SOGCT_MULTISTRING_ORDER, ///< SGF_MULTISTRING reordering callback
};
struct SettingOnGuiCtrlData {
SettingOnGuiCtrlType type;
StringID text;
int val;
};
typedef bool OnChange(int32 var); ///< callback prototype on data modification
typedef size_t OnConvert(const char *value); ///< callback prototype for conversion error
typedef int OnGuiOrder(uint nth); ///< callback prototype for GUI ordering
typedef bool OnGuiCtrl(SettingOnGuiCtrlData &data); ///< callback prototype for GUI operations
typedef int64 OnXrefValueConvert(int64 val); ///< callback prototype for xref value conversion
@@ -144,7 +145,6 @@ struct SettingDesc {
SaveLoad save; ///< Internal structure (going to savegame, parts to config)
const char *patx_name; ///< Name to save/load setting from in PATX chunk, if nullptr save/load from PATS chunk as normal
SettingsXref xref; ///< Details of SettingDesc to use instead of the contents of this one, useful for loading legacy savegames, if target field nullptr save/load as normal
OnGuiOrder *orderproc; ///< Callback procedure for GUI re-ordering
bool IsEditable(bool do_command = false) const;
SettingType GetType() const;