~ubuntu-branches/debian/squeeze/openttd/squeeze

« back to all changes in this revision

Viewing changes to src/settings_internal.h

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Matthijs Kooijman, Jordi Mallach
  • Date: 2009-04-15 18:22:10 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090415182210-22ktb8kdbp2tf3bm
[ Matthijs Kooijman ]
* New upstream release.
* Remove Debian specific desktop file, upstream provides one now. 
* Add debian/watch file.

[ Jordi Mallach ]
* Bump Standards-Version to 3.8.1, with no changes required.
* Move to debhelper compat 7. Bump Build-Depends accordingly.
* Use dh_prep.
* Add "set -e" to config script.
* Remove a few extra doc files that get installed by upstream Makefile.
* Add more complete copyright information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: settings_internal.h 11834 2008-01-13 14:37:30Z rubidium $ */
 
1
/* $Id: settings_internal.h 15410 2009-02-08 12:25:13Z rubidium $ */
2
2
 
3
3
/** @file settings_internal.h Functions and types used internally for the settings configurations. */
4
4
 
5
5
#ifndef SETTINGS_INTERNAL_H
6
6
#define SETTINGS_INTERNAL_H
7
7
 
8
 
#include "saveload.h"
 
8
#include "saveload/saveload.h"
9
9
#include "settings_type.h"
10
10
 
11
11
/** Convention/Type of settings. This is then further specified if necessary
39
39
        SGF_NETWORK_ONLY = 1 << 3, ///< this setting only applies to network games
40
40
        SGF_CURRENCY     = 1 << 4, ///< the number represents money, so when reading value multiply by exchange rate
41
41
        SGF_NO_NETWORK   = 1 << 5, ///< this setting does not apply to network games; it may not be changed during the game
42
 
        SGF_END          = 1 << 6,
43
 
        /* 3 more possible flags */
 
42
        SGF_NEWGAME_ONLY = 1 << 6, ///< this setting cannot be changed in inside a game
 
43
        SGF_END          = 1 << 7,
44
44
};
45
45
 
46
46
DECLARE_ENUM_AS_BIT_SET(SettingGuiFlagLong);
48
48
typedef TinyEnumT<SettingGuiFlagLong> SettingGuiFlag;
49
49
 
50
50
 
51
 
typedef int32 OnChange(int32 var);          ///< callback prototype on data modification
 
51
typedef bool OnChange(int32 var);           ///< callback prototype on data modification
52
52
typedef int32 OnConvert(const char *value); ///< callback prototype for convertion error
53
53
 
54
54
struct SettingDescBase {
57
57
        SettingDescType cmd;    ///< various flags for the variable
58
58
        SettingGuiFlag flags;   ///< handles how a setting would show up in the GUI (text/currency, etc.)
59
59
        int32 min, max;         ///< minimum and maximum values
60
 
        int32 interval;         ///< the interval to use between settings in the 'patches' window. If interval is '0' the interval is dynamically determined
 
60
        int32 interval;         ///< the interval to use between settings in the 'settings' window. If interval is '0' the interval is dynamically determined
61
61
        const char *many;       ///< ONE/MANY_OF_MANY: string of possible values for this type
62
62
        StringID str;           ///< (translated) string with descriptive text; gui and console
63
63
        OnChange *proc;         ///< callback procedure for when the value is changed
78
78
 * offset in a certain struct */
79
79
typedef SettingDesc SettingDescGlobVarList;
80
80
 
81
 
enum IniGroupType {
82
 
        IGT_VARIABLES = 0, ///< values of the form "landscape = hilly"
83
 
        IGT_LIST      = 1, ///< a list of values, seperated by \n and terminated by the next group block
84
 
};
85
 
 
86
 
const SettingDesc *GetPatchFromName(const char *name, uint *i);
87
 
bool SetPatchValue(uint index, const Patches *object, int32 value);
 
81
const SettingDesc *GetSettingFromName(const char *name, uint *i);
 
82
bool SetSettingValue(uint index, int32 value);
 
83
bool SetSettingValue(uint index, const char *value);
88
84
 
89
85
#endif /* SETTINGS_H */