Commit Graph

577 Commits (32b0fb9f6ebe5f607550d4d35ce112b2e1c7442e)

Author SHA1 Message Date
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
glx22 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 3 years ago
rubidium42 ef991b1772 Codechange: [Network] Use std::string in CommandPacket 3 years ago
rubidium42 2e136285e1 Codechange: move from C-string to std::string for DoCommand 3 years ago
Patric Stout ca9a7df752
Codechange: rename str_validate to StrMakeValid(InPlace) (#9304)
This to be more explicit the function changes the value, and not
returns yes/no.
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 86c9ef8134 Codechange: remove SettingDescType in lieu of the actual classes 3 years ago
rubidium42 e666a962b1 Codechange: let OneOfMany and ManyOfMany be their own classes as well 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 024e584904 Cleanup: use (config) formatting for console settings functions 3 years ago
rubidium42 c3cd4a683d Codechange: make formatting of values into strings a method of SettingDesc 3 years ago
rubidium42 91b3d697c5 Codechange: make SettingDesc an instance in the setting table to allow for sub classes 3 years ago
rubidium42 cf6b91f30f Codechange: do not use SettingDescBase directly when not needed 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 425d50372f Codechange: let SettingDesc extend SettingDescBase 3 years ago
rubidium42 8ffb4122df Codechange: just pass the SettingDesc to SetSettingValue and remove distinction between (non)company 3 years ago
rubidium42 0f062b3882 Codechange: clean up C-string support from settings 3 years ago
rubidium42 a032714dc4 Codechange: move script settings to std::string 3 years ago
rubidium42 c73d64adf9 Codechange: move passwords in settings to std::string 3 years ago
rubidium42 f219354f89 Change: further support for std::string in settings 3 years ago
rubidium42 6bca9e090d Codechange: add SetDParamStr that accepts std::string& 3 years ago
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.
3 years ago
Peter Nelson 4791ff2862 Fix: Recalculate padding and minimum sizes when GUI or Font zoom is changed. 3 years ago
rubidium42 31c87ba908 Fix: truncating strings in settings could leave invalid Utf8 characters 3 years ago
rubidium42 0e449f20dc Codechange: writing and string validation to its own functions 3 years ago
rubidium42 b54d8a49fb Feature: allow non-ASCII currency separators 3 years ago
PeterN 31c5b8fe0f
Fix: Invalidate cached vehicle colourmaps when changing liveries setting. (#9006) 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
Matt Kimber bcb3313e13
Feature: allow setting maximum zoom level at which sprites are drawn (#8604) 3 years ago
Michael Lutz 00c66e7096 Codechange: Allow early-load settings that are not misc settings. 3 years ago
Michael Lutz 6755ff63e1 Add: [OSX] Native font rendering without using FreeType. 3 years ago
Michael Lutz dd138fc460 Codechange: Stringify config file paths. 4 years ago
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.
4 years ago
Charles Pigott cfa1b1e006 Fix: Compile warnings when asserts are disabled 4 years ago
Michael Lutz a49fdb7ebb Codechange: Store base set related texts in std::strings. 4 years ago
Michael Lutz 715aa67a9c Codechange: Use std::string in INI file parsing. 4 years ago
Johannes E. Krause 107283748a Feature: SLF_HEX to print hexadecimal numbers in the config file 4 years ago
Johannes E. Krause f389d66e36 Fix: Loading SDT_INTLIST similar to loading SDT_NUMX 4 years ago
Johannes E. Krause 76eab18f02 Fix: Saving SDT_INTLIST handle unsigned values properly 4 years ago
glx d8a1be48cd Codechange: Replace vehicle related FOR_ALL with range-based for loops 5 years ago
glx ddabfed1cd Codechange: Replace station related FOR_ALL with range-based for loops 5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
JMcKiern 04f659e768 Fix: Some typos found using codespell 5 years ago
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.
5 years ago
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.
5 years ago
peter1138 b6733edd17 Feature: Add coverage area display for existing stations. 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Michael Lutz e804173595 Codechange: If something is a vector of strings, use a vector of strings instead of an AutoFreeSmallVector. 5 years ago
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 5 years ago
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 5 years ago
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.
5 years ago
Charles Pigott fe448a2616 Remove: OPF 5 years ago
PeterN bcfc9620b0 Change: Use default value for invalid multi-string settings instead of clamping to min or max value. (#7361) 5 years ago
Peter Nelson 8b1b3fd0f9 Feature: Non-rectangular sparse station catchment area. 5 years ago
Gabda 37bb2c9308 Codechange: Make the style of MakeVoid calls uniform (#7192) 5 years ago
Peter Nelson 9de12521ec Codechange: Convert saveload numbers to enum values.
(This was mostly achieved with a few in-place regexes)
5 years ago
Peter Nelson 0355f887d9 Fix #6438: Properly invalidate AI Settings window when max no competitor setting is changed. 5 years ago
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.
5 years ago
Peter Nelson 4daaec1a94 Change: Invalidate ship path caches if pathfinder choice or forbid-90-degree turns are changed. 6 years ago
glx c540d72445 Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined macro _WIN32 6 years ago
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 6 years ago
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 7 years ago
peter1138 73ea8cdb21 (svn r27816) -Fix [FS#6421]: Do not search directories when opening ini files as we already have their full path. 7 years ago
alberth b8414c2884 (svn r27285) -Codechange: Use LG_ORIGINAL instead of a magic 0 to indicate the original landscape generator. 9 years ago
frosch c639fb0d8e (svn r27163) -Fix [FS#6204]: Toolbars were not invalidated when changing max-vehicles settings. (adf88) 9 years ago
frosch 310258f283 (svn r27151) -Add: Allow changing max heightlevel in scenario editor. 10 years ago
peter1138 1088ad48fc (svn r27004) -Codechange: Make GUI size apply to (sprite-font) text as well. 10 years ago
peter1138 253c91b17d (svn r26990) -Feature: Add option to choose normal, double or quad-size interface. 10 years ago
alberth c1e7c32f07 (svn r26611) -Feature: Save and load grfid and md5sum of newgrfs in config file (frosch) 10 years ago
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 10 years ago
rubidium 8960939b22 (svn r26499) -Codechange: replace strndup with stredup 10 years ago
rubidium 24fdd0b7bb (svn r26494) -Codechange: replace some further usages of s(n)printf with seprintf 10 years ago
rubidium b4914b91d9 (svn r26493) -Codechange: use strecat to concatenate script settings instead of manually accounting for the amount of characters that has been written 10 years ago
rubidium 5b82822c12 (svn r26486) -Codechange: replace a number of snprintfs with seprintf 10 years ago
frosch ef4c2ce031 (svn r26485) -Codechange: Replace ttd_strlcpy and ttd_strlcat with strecpy and strecat. 10 years ago
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 10 years ago
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. 11 years ago
fonsinchen 3d0a0e8e48 (svn r25358) -Codechange: save and load link graph jobs and the schedule 11 years ago
frosch 23ba42b66c (svn r25291) -Add: WindowDesc ability to load and store information in a config file. 11 years ago
rubidium ef8d491d8f (svn r24996) -Change: Apply default service interval changes to vehicles without custom interval (peter1138) 12 years ago
rubidium 99a08e1e8c (svn r24968) -Fix [FS#5379]: company window was not updated when shared were enabled/disabled 12 years ago
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 12 years ago
planetmaker 89a2ba2a6d (svn r24899) -Fix [FS#5434]: Also the station build window needs redrawing when the station spread changes (based on patch by juanjo) 12 years ago
planetmaker f8e0b22974 (svn r24894) -Fix [FS#5434]: Invalidate station selection window when station spread changes (based on patch by juanjo) 12 years ago
frosch 0efd29b71b (svn r24860) -Codechange: Add SettingDesc::GetType(). 12 years ago
frosch 21b43b63f5 (svn r24843) -Codechange: Move news display options into the general settings framework. (based on patch by eagle_rainbow) 12 years ago
michi_cc c75962e04c (svn r24833) -Codechange: Replace magic numbers for invalidating vehicle-related windows with an enum. 12 years ago
frosch d1ab0f03bc (svn r24790) -Remove: Classic difficulty profiles. 12 years ago
frosch 22dc45738d (svn r24787) -Fix: Unify checks for editability of settings. 12 years ago
frosch a499435351 (svn r24786) -Codechange: Add SettingsProfile enum for difficulty profiles and highscore tables. 12 years ago
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. 12 years ago
frosch c11d80148f (svn r24247) -Fix: If loading of int-list settings fails, use the default. 12 years ago
frosch 599f89e641 (svn r24193) -Fix (r24191): Also update comments accordingly. 12 years ago
frosch ec73ad1145 (svn r24192) -Fix [FS#5153-ish]: Also use default value when reading an invalid integer setting value. 12 years ago
michi_cc 3f267db3a6 (svn r24146) -Fix [FS#5153]: Use default value when reading an invalid setting value. (Eddi) 12 years ago
michi_cc 6c8a16f36e (svn r24145) -Cleanup: Switch coding style. 12 years ago
truebrain f239a61406 (svn r23609) -Add: save/load all GameScript related material 13 years ago
truebrain 561b25d031 (svn r23601) -Fix: fix the conflict in window number 13 years ago
rubidium 0ca25fb3af (svn r23480) -Fix [FS#4594]: replace OS error messages with internal error messages when that's possible 13 years ago
rubidium 58423b26d1 (svn r23474) -Codechange: move the declaration error related functions to error.h 13 years ago
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. 13 years ago
michi_cc d3b7b89493 (svn r23415) -Feature: Infrastructure maintenance costs. 13 years ago
truebrain a8b22e5292 (svn r23386) -Fix: debug script related events to 'script' (removes 'ai') 13 years ago
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 13 years ago
truebrain 34d7f01ccc (svn r23364) -Codechange: refactor AIConfig, moving it mostly to Scriptconfig 13 years ago
peter1138 15d0a22aac (svn r23315) -Codechange: Only encode sprites for zoom levels that will be used. 13 years ago
peter1138 4e97261315 (svn r23314) -Add: Add settings to restrict viewport zoom levels. 13 years ago
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) 13 years ago
planetmaker 9309ef58a0 (svn r23211) -Fix: Invalidate build vehicle window when changing the setting for wagon speed limits 13 years ago
rubidium bd64bf6372 (svn r23193) -Codechange: don't cast away const unneededly 13 years ago
yexo a256bd71e4 (svn r23169) -Feature: [NoAI] AICONFIG_AI_DEVELOPER flags to hide AI settings unless gui.ai_developer_tools is enabled (Zuu) 13 years ago
rubidium 05300a00b1 (svn r22824) -Codechange: pass sub directory to ini loading 13 years ago
frosch c544dca519 (svn r22618) -Fix [FS#4653]: When changing difficulty settings over the network, do not just reopen the difficulty window if any game options window is opened; instead invalidate them properly. 13 years ago
rubidium dc74518b96 (svn r22577) -Fix: MSVC64 compile warning 13 years ago
frosch 615e435677 (svn r22522) -Fix (r22489): (size_t)(uint32)(-1) != (size_t)-1 13 years ago
rubidium 197fcab295 (svn r22489) -Fix [FS#4623]: don't cast pointers to unsigned long or vice versa 13 years ago
smatz b5e132924e (svn r22298) -Change: allow enabling 'freeform edges' setting when there is only station label above one of northern tiles 13 years ago
smatz a8862eb77f (svn r22297) -Fix [FS#4580]: the 'freeform edges' setting could be enabled when there were buoys on the northern border (adf88) 13 years ago
rubidium f90044d343 (svn r22202) -Codechange: make MusicFileSettings a proper citizen of the client settings 14 years ago
rubidium e48967541a (svn r22198) -Codechange: make some constants name more explicit 14 years ago
alberth 31386c42a7 (svn r22145) -Codechange: Do explicit test for non-bool values. 14 years ago
yexo b51c62f5af (svn r22074) -Cleanup (r22073): there was already a setting-callback that did what is needed 14 years ago
yexo f1377a228f (svn r22073) -Fix: immediately update the train weight when you change the multiplier for train cargo weight 14 years ago
terkhen 8196b03074 (svn r22059) -Fix (r21179): Make the send chat message window follow the position of the status bar. 14 years ago
frosch 915e339d0f (svn r21975) -Add: console command to reset the engine pool. It removes the traces of engines which are no longer associated to a NewGRF, and can be used to e.g. 'fix' scenarios which were screwed up by the author. You can only use it when there are no vehicles in the game though. 14 years ago
terkhen 91dcc9e016 (svn r21973) -Fix: Redraw the town authority window after modifying town authority settings. 14 years ago
rubidium 7eba2bf4d3 (svn r21890) -Cleanup: remove some unneeded includes 14 years ago
terkhen b5468e7a80 (svn r21860) -Codechange: Rename road vehicle subtype functions to match the train names. 14 years ago
frosch 6e4dd56158 (svn r21814) -Fix/Add: Check GRF version from action 8, and disallow usage of GRFs with versions above 7. 14 years ago
terkhen 5268d03abd (svn r21715) -Fix: Use the correct land colour in the owner legend. 14 years ago
rubidium ad15cd37a6 (svn r21698) -Fix: incorrectly named global variable 14 years ago
yexo 3ca65ab7b3 (svn r21695) -Codechange: add helper function to get the currently applicable GameSettings object 14 years ago
yexo a25d6c64dd (svn r21694) -Fix: changing AI settings ingame was impossible when the difficulty level was other than custom 14 years ago
terkhen fc42e98226 (svn r21523) -Fix: Some windows were not updated correctly after a train acceleration model change. 14 years ago
alberth 997551c599 (svn r21467) -Doc: Add a few doxygen comments to config file settings code. 14 years ago
rubidium b6c2216749 (svn r21358) -Codechange: make some network function names conform to coding style 14 years ago
alberth 3e27739287 (svn r21284) -Codechange: Rename CheckSavegameVersion() to IsSavegameVersionBefore(). 14 years ago
rubidium 16c90ed48b (svn r21244) -Fix [FS#4240] (r21179): the news message always stayed in the middle; let it follow the setting of the statusbar instead 14 years ago
rubidium a9da53c106 (svn r21179) -Fix [FS#4201] (r69): if the main toolbar's location is configurable, why isn't the statusbar's location configurable? 14 years ago
rubidium aea8274dba (svn r21155) -Fix [FS#4222] (r14959): default service interval for ships/aircraft got switched 14 years ago
planetmaker 5565ae1ac0 (svn r21116) -Add [FS#3012]: Reduce the chances to accidentially break savegames with NewGRFs 14 years ago