1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 17:02:37 +01:00
Commit Graph

620 Commits

Author SHA1 Message Date
Peter Nelson
f1e831233a Codefix: Mark destructors override. (#14925)
Remove some empty destructors.
2025-12-19 18:14:29 +00:00
Cyprian Klimaszewski
99f04f27de Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-07 11:25:08 +00:00
Peter Nelson
069833963c Codechange: Replace drop down list's default bools with DropDownOptions. (#14837)
Improves maintainability and avoids positional ambiguity.
2025-11-29 16:17:44 +00:00
Peter Nelson
66b6d71e32 Codechange: Use std::initializer_list for NWidgetPart data. (#14749)
Avoids using C/C++ arrays.
2025-11-01 22:33:00 +00:00
Peter Nelson
ff674829f5 Codechange: Replace Rect CentreTo with CentreToHeight. (#14675)
So far all callers only need to centre vertically, so not having to provide the existing width simplifies calls.
2025-09-28 13:09:36 +00:00
Peter Nelson
81530e2574 Change: Support interface scaling in network client list buttons. 2025-09-28 11:00:07 +01:00
Peter Nelson
cb1c2409e6 Codechange: Rework network client list buttons.
Instead of calculating and storing which buttons to display for each
line and then further calculating what each line should be when
displaying it, store everything on one pass.

This simplifies/deduplicates logic.
2025-09-28 11:00:07 +01:00
Peter Nelson
6ad7c1c40a Fix d85f4b3ebf: Incorrect row height in network server list. (#14653) 2025-09-23 23:15:21 +01:00
Rubidium
7c0f69a8fe Codefix: typos in comments and strings 2025-08-31 10:30:37 +02:00
Peter Nelson
e4cf6ca0ba Fix: Mis-sized widgets due to missing widget fill. (#14370)
In most places where we calculate and set widget resize step we neglect
to set widget fill step to match. Initial widget sizing uses fill step
instead of resize step, which means the initial size may not be a
multiple of the resize step as intended. In particular this will cause
WWT_MATRIX to be misrendered.

Whether or not this matters depends on the widget type being resized and
the window layout, however for consistency always set fill step to the
same as resize step when calculating.
2025-06-17 17:40:11 +01:00
Peter Nelson
984d864c72 Codechange: Add OnClick handler for dropdown items.
This allows each dropdown item to indicate if something different should happen depending on where in the item was clicked.
2025-05-25 09:13:05 +01:00
frosch
2926179d02 Fix: Restore the behaviour when entering numbers in query windows: clamp integers out of range to the maximum valid value. 2025-05-20 12:57:30 +02:00
Peter Nelson
d9247fa1a0 Change: Remove extra close buttons from some windows. (#14124)
All windows have an X button to close it, so remove the redundant close buttons.
2025-05-12 14:54:44 +01:00
frosch
d00196cd65 Change: Rearrange buttons in the intro screen, remove unnecessary ones. 2025-05-07 18:41:48 +02:00
frosch
0d5b3ebd7f Codechange: Declare all IntervalTimers const, which can be const. 2025-05-06 18:29:41 +02:00
Peter Nelson
ac76212b80 Fix: Closing the Game Options window closes all textfile windows.
Record the parent window that opens a textfile window so only child windows are closed instead of all.
2025-05-04 19:36:46 +01:00
Rubidium
7805c1c189 Codechange: use std::string_view for ini_key 2025-05-01 23:24:43 +02:00
Rubidium
ef71ce0a9d Codechange: return std::string_view for Textbuf::GetText() 2025-04-29 22:15:49 +02:00
frosch
cdafc50c94 Codechange: Replace atoi and atoll with ParseInteger. 2025-04-29 20:14:56 +02:00
Peter Nelson
b87ce9c845 Change: Draw info headers as shade of window colour instead of pixel colour. (#14123)
Use the normal or lightest colour gradient to pick a suitable colour, instead of an arbitrary pixel colour.

(Except for the NewGRF window's info panel, this happens to be the same colour.)
2025-04-26 22:38:24 +01:00
Peter Nelson
87b5b0ffa3 Fix 2b80812922: Map size column in server list may be too wide. (#14094)
Incorrect change from SetDParamMaxValue to GetParamMaxValue.
2025-04-24 21:05:31 +01:00
Peter Nelson
7846f0f4ee Fix a4dc7249ee: Changing language or interface scale could hang. (#14087)
A bit of hysteresis caused by OnResize calling ReInit calling OnResize calling ReInit calling OnResize calling ReInit ...
2025-04-24 00:29:54 +01:00
Rubidium
4e14f0ac3f Codechange: pass network tokens as std::string_view or with move semantics where appropriate 2025-04-20 22:43:24 +02:00
Peter Nelson
5008568dfc Codechange: Rename CenterBounds to CentreBounds and move to geometry header. (#14002) 2025-04-14 23:55:40 +01:00
Peter Nelson
9feaa6b7bc Codechange: Use vector/unique_ptr to manage network game information. (#13902)
Replaces linked list with manual memory management.
2025-03-27 18:48:41 +00:00
Peter Nelson
2909a14374 Codechange: Include table/strings.h in files that use StringIDs.
Be consistent with how and where the file is incldued.
2025-03-21 12:53:40 +00:00
Rubidium
ec647975ad Cleanup: remove ancient FIXME comments 2025-03-16 05:42:29 +01:00
Rubidium
754311a779 Codechange: use std::move when appropriate 2025-03-13 13:00:24 +01:00
Peter Nelson
3eb89f04b5 Codechange: Use EnumBitSet for QueryStringFlags. (#13792) 2025-03-10 18:59:35 +00:00
Peter Nelson
ab0d6e8b95 Codechange: Drop default widget strings for network windows. 2025-03-04 08:23:28 +00:00
Peter Nelson
4e485cd083 Fix: Network relay question used string parameters unconventionally. (#13734) 2025-03-04 00:25:15 +00:00
Peter Nelson
e9609e4558 Codechange: Use GetWidgetString for network windows. (#13699) 2025-03-02 18:51:54 +00:00
Rubidium
c540c2bcf7 Codechange: explicitly initialise member variables of Windows 2025-02-27 19:58:31 +01:00
Peter Nelson
2b80812922 Codechange: Use parameterised GetString() in network-related windows. (#13635) 2025-02-22 13:16:47 +00:00
Rubidium
fd4adc55e3 Codechange: replace INVALID_X with XID::Invalid() for PoolIDs 2025-02-16 20:23:00 +01:00
Rubidium
ab8177ea77 Codechange: strongly type CompanyID 2025-02-16 14:02:18 +01:00
Peter Nelson
984da2455b Codechange: Use EncodedString for Query window. (#13528)
This removes the need to separately capture and store global parameters.
2025-02-11 17:30:16 +00:00
Peter Nelson
2cb9f55183 Codechange: Store EncodedString for tooltip text.
This replaces capturing and storing string parameters.
2025-02-10 22:49:14 +00:00
Peter Nelson
c3643e3ee0 Codechange: Pass raw string to editable query window. (#13481)
This avoids separating string id and parameters. EncodedString is not needed as it is the raw text that is editable.
2025-02-07 17:03:53 +00:00
Peter Nelson
28eb5e05c8 Codechange: Use EnumBitSet for NWidContainerFlags. 2025-02-06 19:43:35 +00:00
Peter Nelson
59354576d4 Codechange: Use EnumBitSet for LandscapeTypes and remove LandscapeID. (#13436) 2025-02-01 23:09:18 +00:00
Peter Nelson
5664b1e2f6 Codechange: Use std::vector for GRFConfig lists. (#10835)
This replaces the C-style custom managed linked-list and allows use of iterators etc.
2025-01-31 17:09:09 +00:00
Peter Nelson
56b1e9df1f Codechange: Use EnumBitSet for FrameFlags. 2025-01-30 08:40:42 +00:00
Peter Nelson
d30e8dd1c1 Codechange: Use EnumBitSet for WindowDefaultFlags. 2025-01-30 08:40:42 +00:00
Peter Nelson
efb05396a7 Codechange: Use EnumBitSet for WindowFlags. 2025-01-30 08:40:42 +00:00
Peter Nelson
afc0745aa2 Codechange: Specify underlying type for all enums excluding those exposed to scripts. (#13383) 2025-01-28 22:17:34 +00:00
Peter Nelson
f6ab2b69c6 Codechange: Define GRFConfigList alias and pass by reference. (#13358)
This adds the distinction between a single GRFConfig and a GRFConfig list, and simplifies how GRFConfig lists are passed to various functions.
2025-01-22 22:30:32 +00:00
Rubidium
4b2051a1c1 Codechange: use Textbuf::GetText() to access the buffer / hide Textbuf::buf 2025-01-19 23:01:35 +01:00
Peter Nelson
84e049e23c Codechange: Use ranges to get select server list position. (#13316)
Replaces a raw loop that uses array indexes.
2025-01-14 19:16:46 +00:00
Peter Nelson
b653f875b0 Codechange: Space between template and < (#13278)
Make it all consistent so it matches CODINGSTYLE.
2025-01-04 17:56:14 +00:00