Commit Graph

615 Commits (341d022024bd7c3598e1dce811e7b788c07c989d)

Author SHA1 Message Date
Tyler Trahan 1e56bd1e5a
Change: Reorganize Settings menu items (#11683) 6 months ago
EmperorJake 6522351a1f Feature: Setting to disable the loading speed penalty for trains longer than the station 6 months ago
Rubidium e3f49ee7a0 Codechange: coding style fixes 6 months ago
Peter Nelson a0dfb76e34 Codechange: Replace mishmash of types for widget index with WidgetID.
Indices were stored as int, but often passed around as uint/uint8_t and casts.

Now they should all use WidgetID.
6 months ago
Tyler Trahan 2bada59193 Feature: Mode to display timetable in seconds 7 months ago
Peter Nelson 54d45a6047 Codechange: Don't keep autosave_interval in std::chrono::minutes.
This variable is saved as a setting which requires the variable type to be known, but std::chrono::minutes may vary depending on system type.

Instead, keep as uint32_t and convert to std::chrono::minutes only when setting the timer.
7 months ago
Loïc Guilloux 2a22063d77
Change: Remember the active game option window tab (#11547) 7 months ago
Peter Nelson 58c252b81a Cleanup: Remove unnecessary pressed button offset code. 7 months ago
Peter Nelson 1084ab4b66 Add: Website button to Game Options window for basesets.
This links to the optional "url" item in the baseset's [metadata] section.
7 months ago
Peter Nelson 9a92e02fa7
Change: Add tooltips for text file buttons, and shorten Website / Readme buttons. (#11534) 7 months ago
Peter Nelson 49532914dd Change: Use CRTP-mixins to compose dropdown list items.
This allows list items to built from component parts as required, and additional
functionality is added:

* Icons and text can be positioned at the start or end of the space (templated.)
* Font size of text can be changed (templated.)
* Palette of sprites can be set (runtime.)
7 months ago
rubidium42 27082f9efa Codechange: pass std::string references to OpenBrowser 7 months ago
Peter Nelson c18a1494b7
Codechange: Remove FONT_HEIGHT_... macros. (#11481)
These make it look like we're dealing with a constant, but actually each is a call to `GetCharacterHeight(...)`.
7 months ago
Peter Nelson c80fa7d752
Codechange: Simplify setting minimum width for game options dropdown lists. (#11474)
Height isn't necessary as drop down controls already have sufficient height, so we can use GetDropDownListDimension() to get the width.
7 months ago
Peter Nelson 293a26f248
Change: Use sparse padding and SETTING_BUTTON sizes for custom currency window. (#11472) 7 months ago
Peter Nelson 17ceed0241
Change: Use sparse padding for Game Options window. (#11463) 7 months ago
Peter Nelson bd2ddb07ca
Change: Move baseset missing/corrupted files label to list item. (#11455)
This allows any baseset error to be displayed in the drop down list so it is more easily visible, and avoids wasted space in the layout.
8 months ago
Peter Nelson 18fb8e153f Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
This is to allow unit-tests to produce more useful output.
8 months ago
frosch e81313e93e Feature: Base graphics can offer parameters for additional settings. 8 months ago
frosch 0b7ecf6102 Codechange: use the shortname as unique id to identify the base graphics in openttd.cfg. 8 months ago
frosch 97df27e41f Codechange: Store base graphics settings in a separate section in openttd.cfg. 8 months ago
Bernhard Reutner-Fischer ac42dea7b2 Codechange: Remove unused parameter for Height()
DropDownListItem::Height does not need to take an argument so remove it

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
8 months ago
Peter Nelson fd6f1e844a
Codechange: Avoid emplace_back(new()) into a unique_ptr. (#11384)
This could theoretically leave an unmanaged pointer in certain circumstances, and directly using
make_unique shows intent.
8 months ago
Peter Nelson f379b31e28 Add: data parameter in Window::Close method.
This allows passing data when closing a window, e.g. to indicate how it was closed.
9 months ago
Peter Nelson 49dae08a3b Codechange: Add missing override specifiers. 9 months ago
frosch f40816503f Codechange: Add enum items for dynmically created setting dropdowns. 9 months ago
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 9 months ago
Rubidium 8ab0936491 Codechange: use parameter pack/folding instead of va_arg macros for widget states 9 months ago
Tyler Trahan 77173a6a10 Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes 10 months ago
Patric Stout 337b7b0c63
Fix 8c9ecde9: actually remove autosave_interval from setting window (#11260) 10 months ago
Peter Nelson e8015e497d Codechange: Use begin/end of nwidget parts of begin/length.
This simplifies processing nwidget parts as, unlike the remaining length, the pointer to the end of the list never changes. This is the same principle as we use(d) for tracking end instead of length for C-style strings.

And this removes 160~ instances of the lengthof() macro.
10 months ago
mrmbernardi a5c8365aa4
Feature: Setting to disallow level crossings with competitors (#10755) 10 months ago
Tyler Trahan c7b51a8c3a
Codechange: Use proper date types in various places (#11177) 11 months ago
Henry Wilson a9c65a69d0 Feature: Add config option to set default company secondary colour for new games
This does duplicate translation strings for the colours
11 months ago
MasonGulu 0be27778af
Add: alternative setting for right-click close window option to exclude pinned windows (#10204) 11 months 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
11 months ago
Patric Stout 4f4810dc28 Fix: store autosave settings under the new names 11 months ago
glx22 46b504a700 Fix: ini_key issues reported by the script 12 months ago
merni-ns 161cc04b8a Fix #11087: Disable base graphics/sound dropdown outside main menu 12 months ago
PeterN d140acf34e
Fix: Setting tree lines drawn incorrectly for RTL languages. (#11070) 1 year ago
Peter Nelson 40a9b080aa Fix: Ensure settings page label is orange. 1 year ago
Peter Nelson 9dd9b8ec74 Fix #11054: Prevent translation of currency codes.
Most languages stick with the 3-letter latin currency codes in the name
string, however some translations are... clever... and use the currency
symbol instead. Whilst this may look nice, it can cause issues with fonts
as some scripts have a specific limited set of fonts which do not include
these symbols.

Instead, hard code the currency code list and add it when drawing the
currency name.
1 year ago
PeterN d42a78f3e8
Codechange: Make DropDownListStringItem preformat and remove other implementations. (#11063)
Having to choose between DropDownListStringItem, DropDownListCharStringItem, and DropDownListParamStringItem depending on whether to draw a StringID, a raw string, or a StringID with extra parameters was needlessly complex.

Instead, allow passing a StringID or raw string to DropDownListStringItem. This will preformat the StringID into a raw string, and can therefore accept parameters via the normal SetDParam mechanism.

This also means that strings no longer need to be formatted on every draw.
1 year ago
Rubidium 74924c8186 Codechange: includes must be before 'safeguards.h' 1 year ago
Rubidium 7c37dcb8e3 Fix: do not use {STRING} when {STRING1} or {STRING2} is needed 1 year ago
Patric Stout 772729cc7d
Fix: when syncing width of GUI items, take padding into account (#10915) 1 year ago
Peter Nelson 2511649938 Codechange: Use window parent association for dropdowns.
This replaces the separate window class and number properties, and
allows the window system to close dropdowns automatically.
1 year ago
Patric Stout 199e41c762
Codechange: use default dtor instead of empty (#10826) 1 year ago
Patric Stout 7634553d22 Feature: opt-in survey when exiting a game
On first start-up, the game will ask if you want to participate
in our automated survey. You have to opt-in, and can easily opt-out
(via the Options) at any time.

When opt-in, whenever you exit a game, a JSON blob will be send
to the survey server hosted by OpenTTD. This JSON blob contains
information that gives a global picture of the game just played:
- What settings were used
- How many humans vs AIs
- How long the game has been played
- Basic information about the OS / CPU

All this information is kept very generic, so there is no
chance we send private information to our survey server.
Nothing in the JSON blob could identify you as a person; it
mostly tells about the game played. At any time you can see
what the JSON blob includes, by pressing the "Preview Survey
Results" button in-game.
1 year ago
PeterN da7f431812
Cleanup: widget pos_x/y are already int. (#10809)
Remove old casts left over from when pos_x/y were unsigned.
1 year ago