settings_internal.h File Reference

Functions and types used internally for the settings configurations. More...

#include "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 int32 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_END = 1 << 6
}
enum  IniGroupType { IGT_VARIABLES = 0, IGT_LIST = 1 }

Functions

 DECLARE_ENUM_AS_BIT_SET (SettingGuiFlagLong)
const SettingDesc * GetPatchFromName (const char *name, uint *i)
bool SetPatchValue (uint index, const Patches *object, int32 value)
 Top function to save the new value of an element of the Patches struct.


Detailed Description

Functions and types used internally for the settings configurations.

Definition in file settings_internal.h.


Enumeration Type Documentation

Enumerator:
IGT_VARIABLES  values of the form "landscape = hilly"
IGT_LIST  a list of values, seperated by
and terminated by the next group block

Definition at line 81 of file settings_internal.h.

Convention/Type of settings.

This is then further specified if necessary with the SLE_ (SLE_VAR/SLE_FILE) enums in saveload.h

See also:
VarTypes

SettingDescBase

Enumerator:
SDT_NUMX  any number-type
SDT_BOOLX  a boolean number
SDT_ONEOFMANY  bitmasked number where only ONE bit may be set
SDT_MANYOFMANY  bitmasked number where MULTIPLE bits may be set
SDT_INTLIST  list of integers seperated by a comma ','
SDT_STRING  string with a pre-allocated buffer

Definition at line 15 of file settings_internal.h.

Enumerator:
SGF_0ISDISABLED  a value of zero means the feature is disabled
SGF_NOCOMMA  number without any thousand seperators (no formatting)
SGF_MULTISTRING  the value represents a limited number of string-options (internally integer)
SGF_NETWORK_ONLY  this setting only applies to network games
SGF_CURRENCY  the number represents money, so when reading value multiply by exchange rate
SGF_NO_NETWORK  this setting does not apply to network games; it may not be changed during the game

Definition at line 32 of file settings_internal.h.


Function Documentation

bool SetPatchValue ( uint  index,
const Patches *  object,
int32  value 
)

Top function to save the new value of an element of the Patches struct.

Parameters:
index offset in the SettingDesc array of the Patches struct which identifies the patch member we want to change
object pointer to a valid patches struct that has its settings change. This only affects patch-members that are not needed to be the same on all clients in a network game.
value new value of the patch

Definition at line 1910 of file settings.cpp.

References _networking, _patches_newgame, CMD_CHANGE_PATCH_SETTING, DoCommandP(), GetVariableAddress(), ReadValue(), SLF_NETWORK_NO, and Write_ValidateSetting().

Referenced by PatchesSelectionWndProc().


Generated on Mon Sep 22 20:34:25 2008 for openttd by  doxygen 1.5.6