Commit Graph

643 Commits

Author SHA1 Message Date
Peter Nelson d68e5159e1
Feature: Allow base sounds set to be changed mid-game. (#12399) 2024-04-01 17:54:42 +01:00
Peter Nelson d683ec0183
Codechange: Move dropdown and slider out of widgets directory. (#12403)
Also shuffle headers to place widget includes near end.

This leaves the widgets directory solely for defining Widget IDs.
2024-03-31 19:37:16 +01:00
Peter Nelson 8d312b305b
Codechange: Replace currency macros with functions. (#12396) 2024-03-29 14:49:48 +00:00
Rubidium d09b5aaeba Codechange: use int32_t instead of uint16_t for scroll bar position/size/capacity 2024-03-24 08:30:38 +01:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Rubidium 86cb184eb4 Codechange: use std::source_location over __FILE__ and __LINE__ for WindowDesc 2024-03-10 10:14:20 +01:00
Peter Nelson 912d7bd80e Codechange: Give ColourShade values names instead of numbers. 2024-02-25 12:38:07 +00:00
Peter Nelson ae3390fe48 Codechange: Add ColourShade enum. 2024-02-25 12:38:07 +00:00
Peter Nelson 0463d4c198 Codechange: Remove direct access to _colour_gradient.
Access is now through GetColourGradient, which ensures parameters are in range.
2024-02-25 12:38:07 +00:00
Rubidium 4c117dd2d8 Revert #11993: new number format system does not and cannot work for CJK languages
There are too many intricacies that I am unaware of that are popping up after
asking whether things are right or not.
I do not want to keep playing whack-a-mole, so just revert the whole thing.

This reverts:
15be383b93
360fe8b0b6
1aa9a5c0ab
59f56941e5
7e2eefb91f
b741b2ba6f
609d0071d5
9f8fd80112
a253205b93
819c6c756e
2024-02-22 20:40:12 +01:00
Rubidium 15be383b93 Fix a253205: remove (now) unused currency separator 2024-02-18 16:56:52 +01:00
Patric Stout 839f2e025c
Fix: visually also disable vsync when not using HW acceleration (#12066) 2024-02-12 03:19:08 +01:00
Patric Stout 849fd5ae03
Change: [Script] replace easy/medium/hard values with default value (#11959) 2024-02-03 09:15:03 +00:00
Tyler Trahan 41f2eed425
Feature: Settings to scale cargo production of towns and industries (#10606) 2024-01-30 15:11:46 -05:00
merni-ns 5a88027a19
Feature: Infinite money mode (#11902) 2024-01-30 18:01:02 +00:00
frosch 022b9e92d2 Codechange: Move settings string formatting into IntSettingDesc members. 2024-01-28 14:44:24 +01:00
Peter Nelson fef0bfcfd3
Fix: TextfileWindow called virtual methods before constructor completed. (#11889)
SetStringParameters() was called during widget tree init in the constructor.

Calls within a constructor cannot call the derived classes methods. This would result in invalid data being passed to the string system, which could then crash.
2024-01-27 14:45:37 +00:00
Tyler Trahan 21581b6ab3
Feature: Setting for minutes per calendar year (#11428) 2024-01-23 18:33:54 -05:00
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