Commit Graph

182 Commits (991b7a958e8b4fd2dd4e54e7384d62c932ffa16b)

Author SHA1 Message Date
Jonathan G Rennison 4042480806 Merge branch 'jgrpp' into jgrpp-beta
# Conflicts:
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/settings_internal.h
#	src/table/company_settings.ini
#	src/table/currency_settings.ini
#	src/table/gameopt_settings.ini
#	src/table/misc_settings.ini
#	src/table/settings.h.preamble
#	src/table/settings.ini
#	src/table/win32_settings.ini
#	src/table/window_settings.ini
3 years ago
Jonathan G Rennison 65c20edde7 Settings: Merge orderproc into guiproc 3 years ago
Jonathan G Rennison 47156122fa Settings: Add a guiproc callback for general settings GUI operations 3 years ago
Jonathan G Rennison fd605e3cf3 Merge branch 'master' into jgrpp-beta
# Conflicts:
#	.github/workflows/commit-checker.yml
#	src/company_cmd.cpp
#	src/console_cmds.cpp
#	src/crashlog.cpp
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/indonesian.txt
#	src/lang/japanese.txt
#	src/lang/korean.txt
#	src/lang/swedish.txt
#	src/linkgraph/linkgraphjob.cpp
#	src/linkgraph/mcf.cpp
#	src/network/core/tcp.cpp
#	src/network/core/tcp.h
#	src/network/core/tcp_game.h
#	src/network/core/udp.h
#	src/network/network.cpp
#	src/network/network_admin.cpp
#	src/network/network_admin.h
#	src/network/network_chat_gui.cpp
#	src/network/network_client.cpp
#	src/network/network_client.h
#	src/network/network_func.h
#	src/network/network_internal.h
#	src/network/network_server.cpp
#	src/network/network_server.h
#	src/newgrf.cpp
#	src/newgrf_station.cpp
#	src/order_gui.cpp
#	src/rail_cmd.cpp
#	src/saveload/saveload.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/settings_internal.h
#	src/settings_type.h
#	src/station_cmd.cpp
#	src/stdafx.h
#	src/table/currency_settings.ini
#	src/table/misc_settings.ini
#	src/table/settings.h.preamble
#	src/table/settings.ini
#	src/terraform_cmd.cpp
#	src/timetable_gui.cpp
#	src/train_cmd.cpp
#	src/tree_cmd.cpp
#	src/water_cmd.cpp
3 years ago
Jonathan G Rennison afd66c1631 Show linear scaling value in settings window for cargo scaling settings 3 years ago
Rubidium ede3f79475 Codechange: use the name string in SaveLoad for the name of the Setting as well 3 years ago
Rubidium 01139d3368 Codechange: access the name of a setting via an accessor function 3 years ago
Patric Stout 8f5d0ecde3
Codechange: split settings.ini over several files (#9421)
This reduced the load on compilers, as currently for example MacOS
doesn't like the huge settings-tables.

Additionally, nobody can find settings, as the list is massive and
unordered. By splitting it, it becomes a little bit more sensible.
3 years ago
Rubidium 7e7a4aad72 Codechange: split off the settings saveload code from the main settings handling logic 3 years ago
rubidium42 98e653dacc Fix #9386: compilers failing to compile with LTO by using variants instead of new + unique_ptr
With std::variant all memory can be figured out at compile time, so the compiler needs to keep track of fewer elements. It also saves out a unique_ptr and its memory management, over a slight impact for resolving a setting.
3 years ago
rubidium42 f35e6c1c7f Codechange: use C-style strings instread of std::string in the SettingDesc constructor
This as using std::string causes much more variables to be tracked, potentially causing problemes for certain compilers in certain situations
3 years ago
rubidium42 bf500c39c9 Codechange: make the name of SettingDesc a std::string 3 years ago
rubidium42 ca9c50607e Codechange: use StrStartsWith/StrEndsWith when finding settings 3 years ago
Patric Stout 648ee88a02 Codechange: merge guiflags and flags in settings .ini files
It was rather confusing which one was for what, especially as some
SaveLoad flags were settings-only. Clean up this mess a bit by
having only Setting flags.
3 years ago
Patric Stout feb2ddbefa
Codechange: rename SettingGuiFlag to SettingFlag (#9332)
It is a lovely organicly grown enum, where it started off with
GUI-only flags, and after that a few flags got added that can be
considered GUI-only (the GUI disables/enables based on them), to
only have flags added that has nothing to do with the GUI.

So be less confusing, and rename them to what they do.

Additionally, I took this opportunity to rename 0ISDISABLED to
reflect what it really does.
3 years ago
Patric Stout 0c96884700
Codechange: add a wrapper function to find all settings based on prefix (#9312) 3 years ago
Patric Stout d70fb74ac6
Codechange: use setting name instead of index for CmdChange(Company)Setting (#9306)
This is mostly done as there are now constraints on settings.ini you might not
expected. For example, conditional settings always have to come last, as otherwise
they would influence the index.
3 years ago
rubidium42 08308d808c Codechange: use separate pre and post callbacks for int settings 3 years ago
rubidium42 e2f5d9e561 Codechange: use separate pre and post callbacks for string settings 3 years ago
rubidium42 ea9715d970 Codechange: split Write_ValidateSetting to get separate functions for making ints valid and writing ints 3 years ago
rubidium42 208952f2ba Codechange: split Write_ValidateSetting to get separate functions for making strings valid and writing strings 3 years ago
rubidium42 8372c679e3 Codechange: add helper functions to read an int setting value 3 years ago
rubidium42 ac99a38175 Cleanup: remove and/or fix some confusing comments
The comments for SettingDescType; it is a byte, so not 4 bytes and since it is not a flag there are about 250 other possibilities left instead of 9.
SettingGuiFlag is uint16 so has 2 bytes allocated.
SettingDescGlobVarList and related comments imply that global vars cannot be used elsewhere, but they are used for settings just fine. Even then the type is not used anywhere else but the definition of the table.
3 years ago
rubidium42 86c9ef8134 Codechange: remove SettingDescType in lieu of the actual classes 3 years ago
rubidium42 3bb6ce8827 Codechange: use initializer_lists for the settings tables
Not using vectors as those require copying from the initializer list and that
makes unique_ptrs to the actual SettingDesc objects later impossible.
3 years ago
rubidium42 8ffb4122df Codechange: just pass the SettingDesc to SetSettingValue and remove distinction between (non)company 3 years ago
rubidium42 e666a962b1 Codechange: let OneOfMany and ManyOfMany be their own classes as well 3 years ago
rubidium42 425d50372f Codechange: let SettingDesc extend SettingDescBase 3 years ago
rubidium42 860003458f Codechange: make BoolSettingDesc its own sub class 3 years ago
rubidium42 72ec81325b Cleanup: remove unneeded temporary variables and casts 3 years ago
rubidium42 0d6597a9e6 Codechange: move bits of SettingDesc down to the appropriate sub classes
And by doing so remove the hack where ints were put into pointers so "def" could either be an int or a string
3 years ago
rubidium42 f6723b53da Codechange: make parsing of IniItems overridable functions of SettingDesc 3 years ago
rubidium42 1f8ff0e4f9 Codechange: make Write_ValidateSetting a function of StringSettingDesc 3 years ago
rubidium42 be28c95b30 Codechange: make Write_ValidateSetting a function of IntSettingDesc 3 years ago
rubidium42 c3cd4a683d Codechange: make formatting of values into strings a method of SettingDesc 3 years ago
rubidium42 d8125fa46e Codechange: make sub classes of SettingDesc for the different types of settings 3 years ago
rubidium42 91b3d697c5 Codechange: make SettingDesc an instance in the setting table to allow for sub classes 3 years ago
rubidium42 0f062b3882 Codechange: clean up C-string support from settings 3 years ago
Jonathan G Rennison f39b6f4ba3 Merge branch 'master' into jgrpp
# Conflicts:
#	src/cheat_gui.cpp
#	src/genworld_gui.cpp
#	src/landscape.cpp
#	src/lang/english.txt
#	src/saveload/afterload.cpp
#	src/screenshot.cpp
#	src/settings_gui.cpp
#	src/settings_internal.h
#	src/settings_type.h
#	src/table/settings.ini
#	src/tile_type.h
#	src/widgets/genworld_widget.h
3 years ago
Patric Stout cafe4eed6e Feature: setting to indicate snow coverage for arctic climate (replaces snow line height)
Setting the snow coverage (in % of the map) makes a lot more sense
to the human, while still allowing the niche player to set (by
finding the correct %) a snow line height they like. This makes for
easier defaults, as it decoupled terrain height from amount of snow.

Maps can never be 100% snow, as we do not have sprites for coastal
tiles.

Internally, this calculates the best snow line height to approach
this coverage as close as possible.
3 years ago
Jonathan G Rennison e95216b59d Merge branch 'master' into jgrpp
# Conflicts:
#	src/company_cmd.cpp
#	src/core/geometry_func.cpp
#	src/date.cpp
#	src/genworld_gui.cpp
#	src/gfx.cpp
#	src/object_gui.cpp
#	src/openttd.cpp
#	src/settings_type.h
#	src/video/allegro_v.cpp
#	src/video/dedicated_v.cpp
#	src/video/null_v.cpp
#	src/video/sdl2_v.cpp
#	src/video/sdl_v.cpp
#	src/video/win32_v.cpp
3 years ago
Michael Lutz 00c66e7096 Codechange: Allow early-load settings that are not misc settings. 3 years ago
Jonathan G Rennison f8d6e781ba Merge branch 'master' into jgrpp
# Conflicts:
#	projects/openttd_vs140.vcxproj.filters
#	projects/openttd_vs141.vcxproj.filters
#	projects/openttd_vs142.vcxproj.filters
#	src/base_consist.h
#	src/company_base.h
#	src/newgrf_config.cpp
#	src/newgrf_config.h
#	src/openttd.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/saveload/station_sl.cpp
#	src/settings.cpp
#	src/signs_base.h
#	src/string.cpp
#	src/string_func.h
#	src/table/misc_settings.ini
#	src/table/settings.h.preamble
#	src/town_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_cmd.cpp
#	src/video/cocoa/cocoa_v.mm
#	src/video/null_v.cpp
4 years ago
Michael Lutz a49fdb7ebb Codechange: Store base set related texts in std::strings. 4 years ago
Jonathan G Rennison 8176da3f62 Saveload: Add value conversion support to settings xref 5 years ago
Jonathan G Rennison cbdd9f84d8 Merge branch 'master' into jgrpp
# Conflicts:
#	src/console_gui.cpp
#	src/lang/korean.txt
#	src/video/sdl2_v.cpp
#	src/video/sdl2_v.h
#	src/window.cpp
#	src/window_gui.h
5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Jonathan G Rennison 36eb4165b8 Merge branch 'master' into jgrpp
# Conflicts:
#	src/bridge_map.h
#	src/crashlog.cpp
#	src/industry.h
#	src/linkgraph/linkgraph_type.h
#	src/order_type.h
#	src/saveload/afterload.cpp
#	src/settings.cpp
#	src/settings_type.h
#	src/smallmap_gui.cpp
#	src/spritecache.cpp
#	src/stdafx.h
#	src/table/settings.h.preamble
#	src/train.h
#	src/vehicle.cpp
#	src/viewport.cpp
#	src/viewport_func.h
#	src/widgets/station_widget.h
#	src/zoom_func.h
#	src/zoom_type.h
5 years ago
Jonathan G Rennison 79e49cf4a9 Setting: Add setting flag: no new game (in game use only) 5 years ago
Jonathan G Rennison 8b1ee39ace Setting: Add support for enum type settings 5 years ago
Charles Pigott 644f4c3547 Codechange: Set size of SettingGuiFlag & SettingDescType enums, and use them properly 5 years ago
Jonathan G Rennison 674732cd68 Merge: Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Jonathan G Rennison 0d2be99827 Merge branch 'save_ext' into jgrpp
# Conflicts:
#	src/settings_internal.h
#	src/table/company_settings.ini
#	src/table/settings.h.preamble
#	src/table/settings.ini
7 years ago
Jonathan G Rennison a3d1585826 Add settings callback field to re-order setting options in GUI 7 years ago
Jonathan G Rennison 6fcb156989 Add generic mechanism to cross-ref settings at load time.
This is useful for loading settings from legacy/special versions,
where the corresponding setting is somewhere else and/or a PATX setting,
with duplicating all the info.

(cherry picked from commit b5c453b21e)
7 years ago
Jonathan G Rennison 842728bd17 Settings GUI: Add support for DECIMAL1 settings. 8 years ago
Jonathan G Rennison b5c453b21e Add generic mechanism to cross-ref settings at load time.
This is useful for loading settings from legacy/special versions,
where the corresponding setting is somewhere else and/or a PATX setting,
with duplicating all the info.
Use this to load SpringPP settings which have a corresponding setting.
9 years ago
Jonathan G Rennison c57ffc64bc Settings update: add PATX chunk to store additional settings
in an unordered format which is tolerant of extra, missing or reordered
settings.
9 years ago
planetmaker f00d9976f9 (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 12 years ago
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 12 years ago
frosch 2670b05fb5 (svn r24862) -Add: Settings type filter to adv. settings GUI. 12 years ago
frosch c4c3d00578 (svn r24862) -Add: Settings type filter to adv. settings GUI. 12 years ago
frosch af74f3bb2d (svn r24860) -Codechange: Add SettingDesc::GetType(). 12 years ago
frosch 0efd29b71b (svn r24860) -Codechange: Add SettingDesc::GetType(). 12 years ago
frosch 6516c85c82 (svn r24787) -Fix: Unify checks for editability of settings. 12 years ago
frosch 22dc45738d (svn r24787) -Fix: Unify checks for editability of settings. 12 years ago
frosch b4c70a51da (svn r24671) -Feature [FS#5355]: Add basic/advanced/expert filters to adv. settings GUI. (Eagle_rainbow) 12 years ago
frosch 69a62452be (svn r24671) -Feature [FS#5355]: Add basic/advanced/expert filters to adv. settings GUI. (Eagle_rainbow) 12 years ago
alberth cc6b16a4c1 (svn r24234) -Add: Add help-string infrastructure to the ini files 12 years ago
alberth 1d58838a97 (svn r24234) -Add: Add help-string infrastructure to the ini files 12 years ago
alberth ce210ac66d (svn r24233) -Codechange: Rename 'val_str' to 'str_val' to better match with 'strval' in the ini files. 12 years ago
alberth 34a11d4b8d (svn r24233) -Codechange: Rename 'val_str' to 'str_val' to better match with 'strval' in the ini files. 12 years ago
alberth f6ccaa01c0 (svn r24210) -Feature: Split the renew-months setting text in two string values (one before life time and one after). 12 years ago
alberth 88224d001d (svn r24210) -Feature: Split the renew-months setting text in two string values (one before life time and one after). 12 years ago
alberth 0c80091daa (svn r24209) -Cleanup: Remove now unused SGF_NOCOMMA value. 12 years ago
alberth 8c585e5ad6 (svn r24209) -Cleanup: Remove now unused SGF_NOCOMMA value. 12 years ago
rubidium 0cfe86cead (svn r23735) -Codechange: remove ~50 includes from headers that weren't needed 13 years ago
rubidium e40eb8177a (svn r23735) -Codechange: remove ~50 includes from headers that weren't needed 13 years ago
frosch c1b1513815 (svn r22626) -Fix [FS#4622]: Also initialise _old_vds with newgame settings; TTD savegames do not contain these settings. 13 years ago
frosch d29def43b0 (svn r22626) -Fix [FS#4622]: Also initialise _old_vds with newgame settings; TTD savegames do not contain these settings. 13 years ago
frosch ea311e7904 (svn r22522) -Fix (r22489): (size_t)(uint32)(-1) != (size_t)-1 13 years ago
frosch 615e435677 (svn r22522) -Fix (r22489): (size_t)(uint32)(-1) != (size_t)-1 13 years ago
alberth a7e7e76f7f (svn r22210) -Add: Add a variable for the value strings in the settings tables. 13 years ago
alberth 9fe65f93fe (svn r22210) -Add: Add a variable for the value strings in the settings tables. 13 years ago
alberth 0b0127b13d (svn r21593) -Codechange: endif comment correcttions. 14 years ago
alberth f65a9a5515 (svn r21593) -Codechange: endif comment correcttions. 14 years ago
alberth f2a59e197c (svn r21467) -Doc: Add a few doxygen comments to config file settings code. 14 years ago
alberth 997551c599 (svn r21467) -Doc: Add a few doxygen comments to config file settings code. 14 years ago
frosch c18839704b (svn r20286) -Codechange: Unify end of doxygen comments. 14 years ago
frosch 4bd32799f1 (svn r20286) -Codechange: Unify end of doxygen comments. 14 years ago
frosch 5b86c79fce (svn r20283) -Codechange: Unify start of doygen comments. 14 years ago
frosch ed4f806f1d (svn r20283) -Codechange: Unify start of doygen comments. 14 years ago
rubidium 779722505f (svn r19865) -Fix [FS#3830]: crash when changing locale settings from console due to strcpy-ing a string into a pointer 14 years ago
rubidium dd743bcea1 (svn r19865) -Fix [FS#3830]: crash when changing locale settings from console due to strcpy-ing a string into a pointer 14 years ago
smatz d2e99657fa (svn r19507) -Codechange: remove semicolon after DECLARE_POSTFIX_INCREMENT and DECLARE_ENUM_AS_BIT_SET 14 years ago
smatz 53aaabe6e9 (svn r19507) -Codechange: remove semicolon after DECLARE_POSTFIX_INCREMENT and DECLARE_ENUM_AS_BIT_SET 14 years ago
yexo 504cf35de0 (svn r18943) -Feature [FS#2885]: make it possible to change newgame settings from within a game via the console (use setting_newgame instead of setting) 15 years ago
yexo d75b9f1642 (svn r18943) -Feature [FS#2885]: make it possible to change newgame settings from within a game via the console (use setting_newgame instead of setting) 15 years ago
rubidium 9467b7c6d6 (svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header 15 years ago
rubidium 82fc28f77f (svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header 15 years ago