Commit Graph

19 Commits (acb4f49de02e7f77494c7d6b8e5a7f67f17b504e)

Author SHA1 Message Date
Darkvater fc5ad19258 (svn r7231) -Codechange: rename ini_get_variable to GetVariableAddress for use both in settings.c
and saveload.c
18 years ago
Darkvater c34691d2b0 (svn r6450) -Feature: Make the 'patch' console command available for offline use and for
online use for player-based settings.
18 years ago
rubidium 6bf2aba697 (svn r6186) -Fix [FS#309]: add an override system to the dynamically determined size of steps for numeric patch settings in the 'Configure patches' GUI.
The size of these steps normally about (max - min) / 50, which results in steps of 100 000 years for the start year, end year, network restart year and the year of introduction of coloured newspapers.
18 years ago
rubidium 908d3bcfe6 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct. 18 years ago
Darkvater 397a0a32be (svn r5908) - Codechange (r5903): Move the retrieval of the new value of a patch to console_cmds.c, so there is no need for that function in settings.c 18 years ago
rubidium a6fc0e521d (svn r4944) Codechange: make _patches_newgame available via settings.h and remove instances of extern Patches _patches_newgame in .c files 18 years ago
KUDr 52b6524e05 (svn r4470) -Fix: FS#97 — Possible bug in Win64 versions (by michi_cc)
Doesn't fix any known bug, but the code is now bit cleaner. The proper result of subtraction of two pointers is ptrdiff_t.
18 years ago
Darkvater 40e49f25d6 (svn r3930) - [Patches] Change the GUI-patch options from indeces to string representations. Not only makes this the part more humanly readable, but saves us from rewriting the whole index when a patch is added/removed/changed 19 years ago
Darkvater 2269685c23 (svn r3722) - [4/4] Present the game with a unified structure for the configuration-ini, saveload, console and gui representations of the settings. The last part finishes the transition with the merging of the settings_gui table(s).
- Because patches are (will be in a few commits) saved, you cannot specify the order of the GUI-items in the SettingDesc tables themselves. Doing so would mean messing around with the savegame-version, or doing expensive lookups. So the GUI-tables are now just simple indeces into the original table. No more is needed since that table contains all information
- The only change in functionality is that the stepsize has been automated. It is calculated from the minimum and maximum values such that within 50 clicks you will have gone from one end to the other if scrolling.
- The GUI has kept its flags intact. These are:
  SGF_0ISDISABLED: the variable might have a domain higher than zero, but a special value of nul is used as telling that feature is disabled.
  SGF_NOCOMMA: represent the number without any thousand-seperators
  SGF_MULTISTRING: internally the variable is a number, but its representation is a string based on a simple offset.
  SGF_NETWORK_ONLY: this setting can only be changed during network games
  SGF_CURRENCY: the variable represents money and will be shown in the local currency
- - NOTE! The game is not compilable after this commit (because console hooks have not been updated)
19 years ago
Darkvater 85e0d9c967 (svn r3720) - [2/4] Present the game with a unified structure for the configuration-ini, saveload, console and gui representations of the settings. This second part gets rid of the old SettingDesc structures and updates them with the unified types. These new settings are heavily macro'd, which should make it easy to add/edit entries within sections.
- This unified structure merges the settings in settings.c (concerned with the ini file) and the ones in setting_gui., having to do with the GUI. I tried to give sensible min and maximum values to _patches that were not present in the GUI I hope they work out all right.
- All patch settings miss their callback function which have been temporarily reset to NULL
- Fixed a really small typo in a Doxygen comment in settings.h
- NOTE! When for example _patches are saved to the savegame (as are _gameopt_settings now), you cannot just blindly edit the struct. The same rules apply as to all the other SaveLoad structs. Eg correct CONDVAR's and only adding new entries at the end.
- NOTE! The game is not compilable after this commit.
19 years ago
Darkvater f5b51b1cb9 (svn r3719) - [1/4] Present the game with a unified structure for the configuration-ini, saveload, console and gui representations of the settings. This first part rewrites the configuration section to use the SaveLoad VarType in general.
- This unified structure consists of a SaveLoad type which stores all data relevant about the variable internals such as type, mem/filesize, address, version-control. The SettingDesc type is concerned more about the representation. Things like default value, string-name, minimum/maximum values, gui-behaviour etc.
- The SaveLoad type has received a few flags controlling saving/loading. These are:
  SLF_SAVE_NO: the setting is not saved with the savegame, effectively making this setting player-based. Eg. it will NOT be overwritten when joining a network-game
  SLF_CONFIG_NO: the setting is not saved to the configuration file so you cannot overwrite it ingame.
  SLF_NETWORK_NO: the setting is not synchronised with the local settings when the game is loaded during network-play. Note that when SLF_SAVE_NO is set, SLF_NETWORK_NO is also set (which is logical), at least if the proper macros are used (in [2/4]).
- NOTE! The game is not compilable after this commit.
19 years ago
truelight 576d32b210 (svn r3600) -Fix: suppress error on 64bit targets 19 years ago
Darkvater 3156a052d5 (svn r3547) - [Patches]: do some general cleanup, commentarization before starting actual work. This patch contains no functional changes (I hope). It might break GPMI-builds though when trying to join a trunk/ network game or vice versa. To solve, you can change the order of the first 8 enums in SettingDescType. I think that'll work. 19 years ago
tron 78524dd216 (svn r2831) Fix some potential and real buffer overflows 19 years ago
tron 647cbd6bdd (svn r2701) Insert Id tags into all source files 19 years ago
Darkvater 22a375ba73 (svn r2243) -Fix: Rework of console. Use 'help command|variable' to get help about it. You can assign variables with =, ++, --, or just new value. Console parser is now lenient towards typed spaces, and more robust in general (at least readable). Removed the 'set' command, instead implemented all such variables as 'variables'.
- Some variables are really special and cannot be assigned normally, use their callback procedure for assignment/querying. This commit also obsoletes "[1172804] Console set command cleanup"
19 years ago
dominik 38b8b7848f (svn r1215) Feature: You can now make a custom currency by chosing "Custom..." 20 years ago
dominik cff3c04fad (svn r1157) Enhanced the config file (openttd.cfg) to use another section type. "List sections" as opposed to "variable sections" contain a list of values, separated by a new line. This is now used for the [newgrf] group. You have to edit each line in this section from e.g. "0 = firstset.grf" to only "firstset.grf". 20 years ago
truelight d6a1f3e412 (svn r942) -Merged branch/network back into the trunk 20 years ago