frosch
17dfc1a49a
Codechange: Replace SF_GUI_NEGATIVE_IS_SPECIAL with a settings value callback.
8 months ago
frosch
9e9a8ca7f6
Codechange: Add callbacks to IntSettingDesc to support dynamic strings for title, help and values.
8 months ago
frosch
022b9e92d2
Codechange: Move settings string formatting into IntSettingDesc members.
8 months ago
Patric Stout
fd073a2810
Remove: replace custom span with std::span
9 months ago
Peter Nelson
ab535c0a86
Codechange: Add base() method to StrongType to allow access to the base type without casting. ( #11445 )
...
This removes the ability to explicitly cast to the base type, but the requirement
to use .base() means the conversion is still explicit.
11 months ago
frosch
b6c8f301be
Codechange: Silence warnings about intentionally unused parameters.
1 year ago
Patric Stout
37e2f99c09
Change: store crash logs in JSON format ( #11232 )
1 year ago
Patric Stout
299570b2c1
Codechange: make TimerGameCalendar Date and Year types strongly typed ( #10761 )
1 year ago
Rubidium
eaae0bb5e7
Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
...
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
1 year ago
Patric Stout
ece50d5a1d
Codechange: use BoolSettingDesc to parse settings in conversion code
1 year ago
Rubidium
f4b0ac2bd4
Codechange: use std::string for formatting settings
1 year ago
Patric Stout
199e41c762
Codechange: use default dtor instead of empty ( #10826 )
1 year ago
Rubidium
ed7685910d
Codechange: pass large objects by reference instead of value
...
Especially when they get passed on directly to the next function or via a
constructor into an instance variable
2 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
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
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
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
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
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
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.
4 years ago
Michael Lutz
00c66e7096
Codechange: Allow early-load settings that are not misc settings.
4 years ago
Michael Lutz
a49fdb7ebb
Codechange: Store base set related texts in std::strings.
4 years ago
S. D. Cloudt
13cc8a0cee
Cleanup: Removed SVN headers
5 years ago