Commit Graph

509 Commits

Author SHA1 Message Date
rubidium42
024e584904 Cleanup: use (config) formatting for console settings functions 2021-05-27 18:49:43 +02:00
rubidium42
c3cd4a683d Codechange: make formatting of values into strings a method of SettingDesc 2021-05-27 18:49:43 +02:00
rubidium42
91b3d697c5 Codechange: make SettingDesc an instance in the setting table to allow for sub classes 2021-05-27 18:49:43 +02:00
rubidium42
cf6b91f30f Codechange: do not use SettingDescBase directly when not needed 2021-05-27 18:49:43 +02:00
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.
2021-05-27 18:49:43 +02:00
rubidium42
425d50372f Codechange: let SettingDesc extend SettingDescBase 2021-05-27 18:49:43 +02:00
rubidium42
8ffb4122df Codechange: just pass the SettingDesc to SetSettingValue and remove distinction between (non)company 2021-05-27 18:49:43 +02:00
rubidium42
0f062b3882 Codechange: clean up C-string support from settings 2021-05-13 23:13:17 +02:00
rubidium42
a032714dc4 Codechange: move script settings to std::string 2021-05-13 23:13:17 +02:00
rubidium42
c73d64adf9 Codechange: move passwords in settings to std::string 2021-05-13 23:13:17 +02:00
rubidium42
f219354f89 Change: further support for std::string in settings 2021-05-13 23:13:17 +02:00
rubidium42
6bca9e090d Codechange: add SetDParamStr that accepts std::string& 2021-05-06 21:45:36 +02:00
rubidium42
e7581fd42d Change: [Network] Update server's NetworkServerGameInfo only when needed
Split the updating in a "static" version that only needs to be called when a new map is loaded or some settings are changed, and a "dynamic" version that updates everything that changes regularly such as the current game date or the number of spectators.
2021-05-05 21:01:23 +02:00
Peter Nelson
4791ff2862 Fix: Recalculate padding and minimum sizes when GUI or Font zoom is changed. 2021-04-30 17:08:15 +01:00
rubidium42
31c87ba908 Fix: truncating strings in settings could leave invalid Utf8 characters 2021-04-27 19:41:51 +02:00
rubidium42
0e449f20dc Codechange: writing and string validation to its own functions 2021-04-27 19:41:51 +02:00
rubidium42
b54d8a49fb Feature: allow non-ASCII currency separators 2021-04-27 19:41:51 +02:00
PeterN
31c5b8fe0f
Fix: Invalidate cached vehicle colourmaps when changing liveries setting. (#9006) 2021-04-11 14:30:13 +02:00
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.
2021-03-26 12:22:32 +01:00
Matt Kimber
bcb3313e13
Feature: allow setting maximum zoom level at which sprites are drawn (#8604) 2021-03-13 10:00:53 +01:00
Michael Lutz
00c66e7096 Codechange: Allow early-load settings that are not misc settings. 2021-02-17 21:01:21 +01:00
Michael Lutz
6755ff63e1 Add: [OSX] Native font rendering without using FreeType. 2021-02-14 11:48:58 +01:00
Michael Lutz
dd138fc460 Codechange: Stringify config file paths. 2020-12-27 13:19:25 +01:00
Patric Stout
c66bd18a10
Add: save openttd.cfg immediately on changing a setting (#8358)
Formally it was only done on exit. This means that if it crashes
changes in settings were not stored. This is often rather
frustrating. Additionally, targets (like emscripten) where people
are unlike to use "Exit Game", will never see their configuration
stored.

The drawback is that on every setting change there is some minor
I/O of writing the ini file to disk again.
2020-12-13 16:28:06 +01:00
Charles Pigott
cfa1b1e006 Fix: Compile warnings when asserts are disabled 2020-12-06 19:27:39 +00:00
Michael Lutz
a49fdb7ebb Codechange: Store base set related texts in std::strings. 2020-05-21 20:02:34 +02:00
Michael Lutz
715aa67a9c Codechange: Use std::string in INI file parsing. 2020-05-21 20:02:34 +02:00
Johannes E. Krause
107283748a Feature: SLF_HEX to print hexadecimal numbers in the config file 2020-02-06 21:00:30 +00:00
Johannes E. Krause
f389d66e36 Fix: Loading SDT_INTLIST similar to loading SDT_NUMX 2020-02-06 21:00:30 +00:00
Johannes E. Krause
76eab18f02 Fix: Saving SDT_INTLIST handle unsigned values properly 2020-02-06 21:00:30 +00:00
glx
d8a1be48cd Codechange: Replace vehicle related FOR_ALL with range-based for loops 2019-12-21 20:13:03 +01:00
glx
ddabfed1cd Codechange: Replace station related FOR_ALL with range-based for loops 2019-12-21 20:13:03 +01:00
S. D. Cloudt
13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
JMcKiern
04f659e768 Fix: Some typos found using codespell 2019-09-29 21:27:32 +01:00
Michael Lutz
2675762ae9 Add: [Win32] GDI engine for font glyph rendering as a replacement for including FreeType.
Building with FreeType is still possible and will take precedence over the GDI renderer, but
the project files don't include FreeType anymore by default. Combining GDI rendering with ICU
text layout is untested.
2019-05-14 11:21:36 +01:00
Michael Lutz
a8b6e9f23c Codechange: Refactor the Freetype font cache into a generic part that does not depend on Freetype and into one that does.
This makes it easier to add other TrueType font rendering engines.
2019-05-14 11:21:36 +01:00
peter1138
b6733edd17 Feature: Add coverage area display for existing stations. 2019-04-25 09:14:01 +02:00
Henry Wilson
7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Michael Lutz
e804173595 Codechange: If something is a vector of strings, use a vector of strings instead of an AutoFreeSmallVector. 2019-04-09 22:45:15 +02:00
Henry Wilson
ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 2019-03-26 20:15:57 +00:00
Henry Wilson
a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 2019-03-26 20:15:57 +00:00
Patric Stout
e3c639a09f Remove: ENABLE_NETWORK switch
This switch has been a pain for years. Often disabling broke
compilation, as no developer compiles OpenTTD without, neither do
any of our official binaries.

Additionaly, it has grown so hugely in our codebase, that it
clearly shows that the current solution was a poor one. 350+
instances of "#ifdef ENABLE_NETWORK" were in the code, of which
only ~30 in the networking code itself. The rest were all around
the code to do the right thing, from GUI to NewGRF.

A more proper solution would be to stub all the functions, and
make sure the rest of the code can simply assume network is
available. This was also partially done, and most variables were
correct if networking was disabled. Despite that, often the #ifdefs
were still used.

With the recent removal of DOS, there is also no platform anymore
which we support where networking isn't working out-of-the-box.

All in all, it is time to remove the ENABLE_NETWORK switch. No
replacement is planned, but if you feel we really need this option,
we welcome any Pull Request which implements this in a way that
doesn't crawl through the code like this diff shows we used to.
2019-03-20 19:24:55 +01:00
Charles Pigott
fe448a2616 Remove: OPF 2019-03-16 22:30:11 +00:00
PeterN
bcfc9620b0 Change: Use default value for invalid multi-string settings instead of clamping to min or max value. (#7361) 2019-03-16 16:52:07 +00:00
Peter Nelson
8b1b3fd0f9 Feature: Non-rectangular sparse station catchment area. 2019-03-09 16:33:47 +00:00
Gabda
37bb2c9308 Codechange: Make the style of MakeVoid calls uniform (#7192) 2019-02-08 23:05:25 +00:00
Peter Nelson
9de12521ec Codechange: Convert saveload numbers to enum values.
(This was mostly achieved with a few in-place regexes)
2019-02-02 21:39:06 +00:00
Peter Nelson
0355f887d9 Fix #6438: Properly invalidate AI Settings window when max no competitor setting is changed. 2019-02-01 15:20:52 +00:00
PeterN
23960d0f2c Feature: Group liveries, and livery window usability enhancements. (#7108)
* Change: Replace checkbox in livery selection window with Default option in drop down selection.

This reduces clutter in the UI and allows for primary/secondary colours to independently follow the default scheme if desired.

* Feature: Add vehicle group liveries.
2019-01-31 14:57:44 +01:00
Peter Nelson
4daaec1a94 Change: Invalidate ship path caches if pathfinder choice or forbid-90-degree turns are changed. 2019-01-19 23:11:17 +00:00
glx
c540d72445 Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined macro _WIN32 2018-12-27 18:09:16 +01:00
Charles Pigott
f5b1115039 Doc: Lots and lots of doxymentation fixes 2018-10-31 12:35:54 +01:00
frosch
b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 2017-08-13 18:38:42 +00:00
peter1138
73ea8cdb21 (svn r27816) -Fix [FS#6421]: Do not search directories when opening ini files as we already have their full path. 2017-03-20 19:30:49 +00:00
alberth
b8414c2884 (svn r27285) -Codechange: Use LG_ORIGINAL instead of a magic 0 to indicate the original landscape generator. 2015-05-16 12:01:19 +00:00
frosch
c639fb0d8e (svn r27163) -Fix [FS#6204]: Toolbars were not invalidated when changing max-vehicles settings. (adf88) 2015-02-22 15:26:27 +00:00
frosch
310258f283 (svn r27151) -Add: Allow changing max heightlevel in scenario editor. 2015-02-14 21:55:30 +00:00
peter1138
1088ad48fc (svn r27004) -Codechange: Make GUI size apply to (sprite-font) text as well. 2014-10-12 20:43:25 +00:00
peter1138
253c91b17d (svn r26990) -Feature: Add option to choose normal, double or quad-size interface. 2014-10-11 13:22:37 +00:00
alberth
c1e7c32f07 (svn r26611) -Feature: Save and load grfid and md5sum of newgrfs in config file (frosch) 2014-05-24 19:12:48 +00:00
rubidium
9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 2014-04-25 15:40:32 +00:00
rubidium
8960939b22 (svn r26499) -Codechange: replace strndup with stredup 2014-04-24 18:37:39 +00:00
rubidium
24fdd0b7bb (svn r26494) -Codechange: replace some further usages of s(n)printf with seprintf 2014-04-24 17:40:43 +00:00
rubidium
b4914b91d9 (svn r26493) -Codechange: use strecat to concatenate script settings instead of manually accounting for the amount of characters that has been written 2014-04-24 04:41:54 +00:00
rubidium
5b82822c12 (svn r26486) -Codechange: replace a number of snprintfs with seprintf 2014-04-23 21:12:09 +00:00
frosch
ef4c2ce031 (svn r26485) -Codechange: Replace ttd_strlcpy and ttd_strlcat with strecpy and strecat. 2014-04-23 20:44:42 +00:00
rubidium
0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
frosch
41b7a04a68 (svn r26317) -Fix [FS#5897]: Check whether NewGRF change vehicle capacity when they are not supposed to, and truncate cargo appropiately if they are allowed to. 2014-02-07 23:48:56 +00:00
fonsinchen
3d0a0e8e48 (svn r25358) -Codechange: save and load link graph jobs and the schedule 2013-06-09 13:02:05 +00:00
frosch
23ba42b66c (svn r25291) -Add: WindowDesc ability to load and store information in a config file. 2013-05-26 19:27:22 +00:00
rubidium
ef8d491d8f (svn r24996) -Change: Apply default service interval changes to vehicles without custom interval (peter1138) 2013-02-14 17:08:56 +00:00
rubidium
99a08e1e8c (svn r24968) -Fix [FS#5379]: company window was not updated when shared were enabled/disabled 2013-02-04 20:29:38 +00:00
planetmaker
c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 2013-01-08 22:46:42 +00:00
planetmaker
89a2ba2a6d (svn r24899) -Fix [FS#5434]: Also the station build window needs redrawing when the station spread changes (based on patch by juanjo) 2013-01-08 22:38:59 +00:00
planetmaker
f8e0b22974 (svn r24894) -Fix [FS#5434]: Invalidate station selection window when station spread changes (based on patch by juanjo) 2013-01-08 17:44:39 +00:00
frosch
0efd29b71b (svn r24860) -Codechange: Add SettingDesc::GetType(). 2012-12-26 17:43:35 +00:00
frosch
21b43b63f5 (svn r24843) -Codechange: Move news display options into the general settings framework. (based on patch by eagle_rainbow) 2012-12-23 21:07:12 +00:00
michi_cc
c75962e04c (svn r24833) -Codechange: Replace magic numbers for invalidating vehicle-related windows with an enum. 2012-12-20 19:44:02 +00:00
frosch
d1ab0f03bc (svn r24790) -Remove: Classic difficulty profiles. 2012-12-05 19:36:41 +00:00
frosch
22dc45738d (svn r24787) -Fix: Unify checks for editability of settings. 2012-12-05 19:35:09 +00:00
frosch
a499435351 (svn r24786) -Codechange: Add SettingsProfile enum for difficulty profiles and highscore tables. 2012-12-05 19:34:45 +00:00
frosch
c6ed8c01b3 (svn r24250) -Fix [FS#5154]: Do not immediately display error messages from parsing the cfg file, but schedule them for displaying after the GUI is prepared for it. 2012-05-14 21:04:49 +00:00
frosch
c11d80148f (svn r24247) -Fix: If loading of int-list settings fails, use the default. 2012-05-14 20:53:39 +00:00
frosch
599f89e641 (svn r24193) -Fix (r24191): Also update comments accordingly. 2012-05-01 15:34:45 +00:00
frosch
ec73ad1145 (svn r24192) -Fix [FS#5153-ish]: Also use default value when reading an invalid integer setting value. 2012-05-01 15:33:42 +00:00
michi_cc
3f267db3a6 (svn r24146) -Fix [FS#5153]: Use default value when reading an invalid setting value. (Eddi) 2012-04-17 19:45:04 +00:00
michi_cc
6c8a16f36e (svn r24145) -Cleanup: Switch coding style. 2012-04-17 19:44:59 +00:00
truebrain
f239a61406 (svn r23609) -Add: save/load all GameScript related material 2011-12-19 20:56:34 +00:00
truebrain
561b25d031 (svn r23601) -Fix: fix the conflict in window number 2011-12-19 20:50:21 +00:00
rubidium
0ca25fb3af (svn r23480) -Fix [FS#4594]: replace OS error messages with internal error messages when that's possible 2011-12-10 16:05:26 +00:00
rubidium
58423b26d1 (svn r23474) -Codechange: move the declaration error related functions to error.h 2011-12-10 13:54:10 +00:00
frosch
34f9c4d00f (svn r23427) -Fix: Do not load screen resolution and other basic stuff after bootstrap is finished. It was already loaded before, and might got changed already. 2011-12-04 13:21:51 +00:00
michi_cc
d3b7b89493 (svn r23415) -Feature: Infrastructure maintenance costs. 2011-12-03 23:40:46 +00:00
truebrain
a8b22e5292 (svn r23386) -Fix: debug script related events to 'script' (removes 'ai') 2011-12-01 12:04:10 +00:00
truebrain
cc12942d70 (svn r23384) -Remove: no longer allow a binary to be without AI support; the parts some compilers failed at, are integrated in other parts of the code now too 2011-12-01 12:03:34 +00:00
truebrain
34d7f01ccc (svn r23364) -Codechange: refactor AIConfig, moving it mostly to Scriptconfig 2011-11-29 23:26:35 +00:00
peter1138
15d0a22aac (svn r23315) -Codechange: Only encode sprites for zoom levels that will be used. 2011-11-24 12:26:44 +00:00
peter1138
4e97261315 (svn r23314) -Add: Add settings to restrict viewport zoom levels. 2011-11-24 12:20:14 +00:00
rubidium
834eac49fd (svn r23224) -Codechange: first load the config file partially so we can push scanning AIs to later in the process (when the GUI is showing the progress bar) 2011-11-14 21:42:54 +00:00
planetmaker
9309ef58a0 (svn r23211) -Fix: Invalidate build vehicle window when changing the setting for wagon speed limits 2011-11-14 10:42:47 +00:00