Add settings callback field to re-order setting options in GUI

This commit is contained in:
Jonathan G Rennison
2017-08-20 01:39:49 +01:00
parent 46050820c5
commit a3d1585826
10 changed files with 46 additions and 26 deletions

View File

@@ -89,6 +89,7 @@ enum SettingType {
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
/** Properties of config file settings. */
struct SettingDescBase {
@@ -113,6 +114,7 @@ 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 NULL save/load from PATS chunk as normal
const char *xref; ///< Name of SettingDesc to use instead of the contents of this one, useful for loading legacy savegames, if NULL save/load as normal
OnGuiOrder *orderproc; ///< Callback procedure for GUI re-ordering
bool IsEditable(bool do_command = false) const;
SettingType GetType() const;