Commit Graph

625 Commits

Author SHA1 Message Date
Tyler Trahan fd9e72a7e7
Feature: Use real-time "wallclock" timekeeping units (#11341) 2024-01-23 11:36:09 -05:00
Patric Stout d3b2a576de
Feature: Plugin framework for Social Integration with Steam, Discord, GOG, etc (#11628) 2024-01-22 19:22:45 +00:00
Peter Nelson 7faa3848de
Change: Mark whole screen dirty when toggling font AA. (#11825) 2024-01-17 23:04:07 +00:00
Michael Lutz fd59393899
Fix #11791, e1f5be62: Run missing-glyph detection after toggling sprite font. (#11812) 2024-01-17 00:00:26 +01:00
Peter Nelson 7737aa6640 Codechange: Make all NWidgetPart arrays constexpr.
This ensures that the arrays are not created at runtime and prevents using non-constexpr values.
2024-01-16 21:57:05 +00:00
Jonathan G Rennison 94e74a45c2
Fix: Viewport virt coords not updated when sprite font toggled (#11784) 2024-01-15 19:16:04 +01:00
Peter Nelson 53fa54f8e9
Fix e1f5be62: Clear font cache when toggling sprite font. (#11780)
This is necessary for the sprite font height and ascender to be updated correctly.
2024-01-15 00:21:11 +00:00
Michael Lutz e1f5be6244 Add: GUI options to select sprite font and AA mode for all fonts. 2024-01-14 22:50:56 +01:00
Peter Nelson e3bb6497f7 Codechange: Don't assume game options widget is a dropdown list. 2024-01-14 11:41:11 +00:00
Peter Nelson 8ca867ef63 Codechange: Replace game options' style-breaking if-condition with switch. 2024-01-14 11:41:11 +00:00
Tyler Trahan 1e56bd1e5a
Change: Reorganize Settings menu items (#11683) 2024-01-07 08:44:50 -05:00
EmperorJake 6522351a1f Feature: Setting to disable the loading speed penalty for trains longer than the station 2024-01-04 16:59:11 +01:00
Rubidium e3f49ee7a0 Codechange: coding style fixes 2024-01-04 16:23:54 +01:00
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.
2023-12-30 00:23:57 +00:00
Tyler Trahan 2bada59193 Feature: Mode to display timetable in seconds 2023-12-11 07:12:45 -05:00
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.
2023-12-09 08:13:03 +00:00
Loïc Guilloux 2a22063d77
Change: Remember the active game option window tab (#11547) 2023-12-06 14:44:38 +00:00
Peter Nelson 58c252b81a Cleanup: Remove unnecessary pressed button offset code. 2023-12-05 21:12:35 +00:00
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.
2023-12-03 18:52:33 +00:00
Peter Nelson 9a92e02fa7
Change: Add tooltips for text file buttons, and shorten Website / Readme buttons. (#11534) 2023-12-03 16:54:57 +00:00
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.)
2023-12-02 15:23:05 +00:00
rubidium42 27082f9efa Codechange: pass std::string references to OpenBrowser 2023-11-29 02:02:30 +01:00
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(...)`.
2023-11-21 19:04:24 +00:00
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.
2023-11-20 00:44:06 +00:00
Peter Nelson 293a26f248
Change: Use sparse padding and SETTING_BUTTON sizes for custom currency window. (#11472) 2023-11-19 21:12:55 +00:00
Peter Nelson 17ceed0241
Change: Use sparse padding for Game Options window. (#11463) 2023-11-16 17:06:38 +00:00
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.
2023-11-10 12:25:56 +00:00
Peter Nelson 18fb8e153f Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
This is to allow unit-tests to produce more useful output.
2023-11-02 22:25:01 +00:00
frosch e81313e93e Feature: Base graphics can offer parameters for additional settings. 2023-10-31 01:41:50 +01:00
frosch 0b7ecf6102 Codechange: use the shortname as unique id to identify the base graphics in openttd.cfg. 2023-10-31 01:41:50 +01:00
frosch 97df27e41f Codechange: Store base graphics settings in a separate section in openttd.cfg. 2023-10-31 01:41:50 +01:00
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>
2023-10-21 18:53:35 +02:00
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.
2023-10-20 18:40:48 +01:00
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.
2023-10-13 20:47:28 +01:00
Peter Nelson 49dae08a3b Codechange: Add missing override specifiers. 2023-09-25 21:27:45 +01:00
frosch f40816503f Codechange: Add enum items for dynmically created setting dropdowns. 2023-09-20 22:35:32 +02:00
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Rubidium 8ab0936491 Codechange: use parameter pack/folding instead of va_arg macros for widget states 2023-09-16 23:09:53 +02:00
Tyler Trahan 77173a6a10 Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes 2023-09-10 08:40:25 -04:00
Patric Stout 337b7b0c63
Fix 8c9ecde9: actually remove autosave_interval from setting window (#11260) 2023-09-04 11:18:47 +00:00
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.
2023-09-04 10:20:45 +01:00
mrmbernardi a5c8365aa4
Feature: Setting to disallow level crossings with competitors (#10755) 2023-09-02 12:46:24 +02:00
Tyler Trahan c7b51a8c3a
Codechange: Use proper date types in various places (#11177) 2023-08-11 13:32:42 +00:00
Henry Wilson a9c65a69d0 Feature: Add config option to set default company secondary colour for new games
This does duplicate translation strings for the colours
2023-07-26 16:22:30 +02:00
MasonGulu 0be27778af
Add: alternative setting for right-click close window option to exclude pinned windows (#10204) 2023-07-19 23:24:22 +02:00
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
2023-07-19 19:30:14 +02:00
Patric Stout 4f4810dc28 Fix: store autosave settings under the new names 2023-07-19 13:17:50 +02:00
glx22 46b504a700 Fix: ini_key issues reported by the script 2023-07-14 14:32:46 +02:00
merni-ns 161cc04b8a Fix #11087: Disable base graphics/sound dropdown outside main menu 2023-07-01 19:03:45 +02:00
PeterN d140acf34e
Fix: Setting tree lines drawn incorrectly for RTL languages. (#11070) 2023-06-25 19:32:53 +01:00