Commit Graph
394 Commits
Author SHA1 Message Date
Rubidiumandrubidium42 bcaf3eaec2 Codefix: wrong parameter names and partially missing parameters 2026-02-02 18:18:51 +01:00
Rubidiumandrubidium42 4adf494ebc Codechange: enum-class-ify Commands 2026-01-28 23:32:51 +01:00
Cyprian KlimaszewskiandGitHub 99f04f27de Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-07 11:25:08 +00:00
Peter NelsonandGitHub 4b7a3241bf Codechange: Remove unnecessary 'core' includes. (#14867) 2025-12-07 08:36:58 +00:00
Peter NelsonandPeter Nelson 2675295675 Fix #8062: (Try to) ensure enough room for profit in vehicle group window.
Width of group info panel previously relied entirely on the size of other widgets.
2025-11-29 16:17:23 +00:00
Peter NelsonandPeter Nelson 91a12a3928 Codechange: Precalculate group column rects.
Simplifies drawing group list which no longer needs to calculate horizontal positions for each row.
2025-11-29 16:17:23 +00:00
Peter NelsonandPeter Nelson e15539c430 Codechange: Extract functions to get group name and profit sprite.
Improves readability and allows long if-else conditions to be replaced with early returns.
2025-11-29 16:17:23 +00:00
Peter NelsonandGitHub 66b6d71e32 Codechange: Use std::initializer_list for NWidgetPart data. (#14749)
Avoids using C/C++ arrays.
2025-11-01 22:33:00 +00:00
Peter NelsonandPeter Nelson 42084ca516 Change: Make groups window group list aware of interface scaling. 2025-09-29 22:11:02 +01:00
Peter NelsonandPeter Nelson 3087194d80 Codechange: Use Rects for group window drawing.
Simplifies handling of LTR/RTL coordinates.
2025-09-29 22:11:02 +01:00
Peter NelsonandGitHub 8e2df7809b Codechange: Add distinct type to hold pixel drawing colour. (#14457)
This is used for individual pixels as well as line drawing.
2025-07-20 22:57:55 +01:00
Peter NelsonandGitHub 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 NelsonandPeter 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
Peter NelsonandPeter Nelson 9f190aa534 Codechange: Use group's children list to improve performance of group UI. 2025-05-21 19:50:07 +01:00
Peter NelsonandPeter 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
Peter NelsonandGitHub 3eb89f04b5 Codechange: Use EnumBitSet for QueryStringFlags. (#13792) 2025-03-10 18:59:35 +00:00
Peter NelsonandPeter Nelson a22b150c98 Codechange: Move to GetWidgetString for group window. 2025-03-03 20:54:09 +00:00
Peter NelsonandGitHub 9d7d24465d Codechange: Use parameterised GetString() for group window. (#13693) 2025-03-01 23:42:01 +00:00
Rubidiumandrubidium42 f69968f2bc Codechange: explicitly initialise member variables of Windows 2025-02-27 12:21:06 +01:00
Rubidiumandrubidium42 fd4adc55e3 Codechange: replace INVALID_X with XID::Invalid() for PoolIDs 2025-02-16 20:23:00 +01:00
Peter NelsonandGitHub 20e57a02a2 Codechange: Use GetString() with argument parameters in simple cases. (#13551)
Avoids using global string parameters.
2025-02-14 00:10:56 +00:00
Peter NelsonandGitHub 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
Rubidiumandrubidium42 1e24b41f22 Codechange: strongly type GroupID 2025-02-09 16:52:21 +01:00
Rubidiumandrubidium42 ac54ff368c Codechange: set VLI.index through accessor function 2025-02-08 10:09:02 +01:00
Rubidiumandrubidium42 4e84d032b8 Codechange: read VLI.index through wrapper to get the right type 2025-02-08 10:09:02 +01:00
Peter NelsonandGitHub 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 NelsonandPeter Nelson 28eb5e05c8 Codechange: Use EnumBitSet for NWidContainerFlags. 2025-02-06 19:43:35 +00:00
Rubidiumandrubidium42 5a78bb8fac Codechange: ToWindowNumber describes better what is the intent than Pack 2025-02-02 15:57:18 +01:00
Rubidiumandrubidium42 e36a9ceaf0 Codechange: allow passing extra constructor arguments via AllocateWindowDescFront 2025-02-02 15:57:18 +01:00
Rubidiumandrubidium42 8f72a478f0 Codechange: change 'return existing window' to a template parameter
This change is made to make it possible to pass arbitrary other parameters
to the constructor of the window instances.
2025-02-02 15:57:18 +01:00
Peter NelsonandPeter Nelson d30e8dd1c1 Codechange: Use EnumBitSet for WindowDefaultFlags. 2025-01-30 08:40:42 +00:00
Peter NelsonandPeter Nelson f51627c76f Codechange: Use EnumBitSet for DepotCommand(Flag)s. 2025-01-29 21:46:39 +00:00
Peter NelsonandPeter Nelson 5ef495da78 Codechange: Use EnumBitSet for GroupFlags. 2025-01-29 21:46:39 +00:00
Peter NelsonandGitHub afc0745aa2 Codechange: Specify underlying type for all enums excluding those exposed to scripts. (#13383) 2025-01-28 22:17:34 +00:00
Peter NelsonandPeter Nelson 95df7ea483 Change: Use separate WindowDescs instead of changing static data.
When opening vehicle lists a static WindowDesc is modified to change the class depending on the vehicle type.

Theses makes for inconsistencies and preferred window state, and prevents WindowDesc members being made const.
2025-01-26 16:42:05 +00:00
Rubidiumandrubidium42 b71a5158cf Codechange: use INVALID_VEHICLE where that's more appropriate than e.g. vehicle 0 2025-01-19 17:10:21 +01:00
Peter NelsonandGitHub 95f8fc983b Codechange: Make GroupFlags an enum class. (#13312)
GF_END is 'reserved' in some Windows APIs. Instead of working around it, make GroupFlags an enum class.
2025-01-14 11:33:26 +00:00
Rubidiumandrubidium42 ef87acc1ff Codechange: make STR_NULL the default for all widget construction functions 2025-01-03 23:25:27 +01:00
Rubidiumandrubidium42 3ecd1187ba Codechange: set sprite once for group UI 2025-01-03 14:19:35 +01:00
Rubidiumandrubidium42 b60101853c Codechange: add and use SetString over directly accessing widget_data 2025-01-03 12:14:55 +01:00
Rubidiumandrubidium42 fb06ddafba Codechange: add and use SetSprite over directly accessing widget_data 2025-01-03 11:13:16 +01:00
Rubidiumandrubidium42 9ac1bad480 Codechange: add and use GetString over directly accessing widget_data 2025-01-03 11:11:01 +01:00
Rubidiumandrubidium42 3dd0b93698 Codechange: use SetStringTip instead of accessing widget_data and tool_tip directly 2025-01-03 11:09:49 +01:00
Rubidiumandrubidium42 7c2668d10f Codechange: replace SetDataTip(0x0, with SetTooltip( 2025-01-02 23:28:43 +01:00
Rubidiumandrubidium42 d8d03212b8 Codechange: replace SetDataTip(SPR_ with SetSpriteTip(STR_ 2025-01-02 23:28:43 +01:00
Rubidiumandrubidium42 4bf36e3fa6 Codechange: replace SetDataTip(STR_ with SetStringTip(STR_ 2025-01-02 23:28:43 +01:00
Rubidiumandrubidium42 fd5f6caed4 Codechange: use explicit TileIndex constructor for tile 0 2025-01-01 08:26:54 +01:00
Peter NelsonandPeter Nelson 059a4b22f7 Codechange: Use projection-based std::range::find where possible.
This simplifies matching by class members and avoids wordy lambdas.
2024-11-24 10:36:03 +00:00
Peter NelsonandGitHub e45e8a39c8 Add: Overlay cargo icon in vehicle/depot list when holding shift+ctrl. (#12938) 2024-09-22 10:33:44 +01:00
Jonathan G RennisonandGitHub e477706bf5 Codechange: Add AssignBit function to assign the value of a single bit (#12934)
* Codechange: Add AssignBit function to assign the value of a single bit

* Codechange: Replace various uses of SB with AssignBit

* Codechange: Replace various uses of SB with a constant with SetBit
2024-09-10 08:36:58 -04:00