#include "saveload/saveload.h"
#include "settings_type.h"
Go to the source code of this file.
Data Structures | |
| struct | EnumPropsT< SettingDescTypeLong > |
| struct | EnumPropsT< SettingGuiFlagLong > |
| struct | SettingDescBase |
| struct | SettingDesc |
Typedefs | |
|
typedef TinyEnumT < SettingDescTypeLong > | SettingDescType |
|
typedef TinyEnumT < SettingGuiFlagLong > | SettingGuiFlag |
| typedef bool | OnChange (int32 var) |
| callback prototype on data modification | |
| typedef int32 | OnConvert (const char *value) |
| callback prototype for convertion error | |
| typedef SettingDesc | SettingDescGlobVarList |
Enumerations | |
| enum | SettingDescTypeLong { SDT_BEGIN = 0, SDT_NUMX = 0, SDT_BOOLX = 1, SDT_ONEOFMANY = 2, SDT_MANYOFMANY = 3, SDT_INTLIST = 4, SDT_STRING = 5, SDT_END } |
| Convention/Type of settings. More... | |
| enum | SettingGuiFlagLong { SGF_NONE = 0, SGF_0ISDISABLED = 1 << 0, SGF_NOCOMMA = 1 << 1, SGF_MULTISTRING = 1 << 2, SGF_NETWORK_ONLY = 1 << 3, SGF_CURRENCY = 1 << 4, SGF_NO_NETWORK = 1 << 5, SGF_NEWGAME_ONLY = 1 << 6, SGF_END = 1 << 7 } |
Functions | |
| DECLARE_ENUM_AS_BIT_SET (SettingGuiFlagLong) | |
| const SettingDesc * | GetSettingFromName (const char *name, uint *i) |
| Given a name of setting, return a setting description of it. | |
| bool | SetSettingValue (uint index, int32 value) |
| Top function to save the new value of an element of the Settings struct. | |
| bool | SetSettingValue (uint index, const char *value) |
| Set a setting value with a string. | |
Definition in file settings_internal.h.
| enum SettingDescTypeLong |
Convention/Type of settings.
This is then further specified if necessary with the SLE_ (SLE_VAR/SLE_FILE) enums in saveload.h
SettingDescBase
Definition at line 15 of file settings_internal.h.
| enum SettingGuiFlagLong |
Definition at line 32 of file settings_internal.h.
| const SettingDesc* GetSettingFromName | ( | const char * | name, | |
| uint * | i | |||
| ) |
Given a name of setting, return a setting description of it.
| name | Name of the setting to return a setting description of | |
| i | Pointer to an integer that will contain the index of the setting after the call, if it is successful. |
NULL indicates failure to obtain the description Definition at line 2114 of file settings.cpp.
References SlIsObjectCurrentlyValid().
Referenced by AIGameSettings::GetValue(), IConsoleGetSetting(), SettingEntry::Init(), and AIGameSettings::IsValid().
| bool SetSettingValue | ( | uint | index, | |
| const char * | value | |||
| ) |
Set a setting value with a string.
| index | the settings index. | |
| value | the value to write |
Definition at line 2095 of file settings.cpp.
References GetVariableAddress(), SLF_NETWORK_NO, and ttd_strlcpy().
| bool SetSettingValue | ( | uint | index, | |
| int32 | value | |||
| ) |
Top function to save the new value of an element of the Settings struct.
| index | offset in the SettingDesc array of the Settings struct which identifies the setting member we want to change | |
| object | pointer to a valid settings struct that has its settings change. This only affects setting-members that are not needed to be the same on all clients in a network game. | |
| value | new value of the setting |
Definition at line 2062 of file settings.cpp.
References CMD_CHANGE_SETTING, DoCommandP(), GetVariableAddress(), InvalidateWindow(), ReadValue(), SLF_NETWORK_NO, and Write_ValidateSetting().
1.5.6