Commit Graph

418 Commits

Author SHA1 Message Date
Peter Nelson b4d16d319f Codechange: Replace Alignment enum with struct
Alignment struct contains separate horizontal and vertical alignment members.
2026-06-28 20:43:36 +01:00
Rubidium 5a6469ad6f Codechange: make EventState a scoped enum 2026-06-15 11:20:52 +02:00
Peter Nelson fce33c5015 Codechange: make WarningLevel a scoped enum (#15622) 2026-05-26 17:12:21 +01:00
Rubidium bcda4a72ee Codechange: make WindowClass a scoped enum 2026-05-20 21:39:04 +02:00
Rubidium c59d64c132 Codechange: separate TextColour enumeration and flags 2026-05-18 08:37:42 +02:00
Peter Nelson 7e624beadc Codechange: make Shade a scoped enum (#15571)
Renamed from `ColourShade` to `Shade` for brevity.
2026-05-03 15:07:29 +01:00
Peter Nelson 77403627a8 Codechange: make VehicleType a scoped enum 2026-04-26 07:00:13 +01:00
Rubidium 99c8a637b4 Codechange: make WindowPosition a scoped enum 2026-04-25 17:15:18 +02:00
Rubidium 3b5d46e0bb Codechange: make Colours a scoped enum 2026-04-19 20:53:52 +02:00
Peter Nelson d15f105974 Add: conditional order to test if a train is driving backwards (#15484) 2026-04-16 21:00:49 +01:00
Rubidium 7434052eb6 Codechange: make FontSize a scoped enum 2026-04-12 18:10:34 +02:00
Jonathan G Rennison 935f39ecab Fix: MaxReliability order condition value not being clamped to <= 100 2026-03-31 23:08:08 +02:00
Tyler Trahan fc3b81a313 Codechange: Rename "non-stop" and "go via" order flags for clarity (#15398) 2026-03-24 08:52:50 -04:00
Jonathan G Rennison 71d59aaf3d Change: Show "Delete All" in order window delete button when applicable (#15370) 2026-03-05 17:56:20 -05:00
Rubidium 23dcc9dd07 Codechange: document parameters and return types 2026-02-17 23:11:27 +01:00
Rubidium 4adf494ebc Codechange: enum-class-ify Commands 2026-01-28 23:32:51 +01:00
Cyprian Klimaszewski 97f3e5b70f Codechange: Make TileType enum an enum class. 2026-01-24 08:34:05 +01:00
Cyprian Klimaszewski e1d90d7b69 Codefix: Remove unnecessary client side checks for setting an unbunch order (#15107) 2026-01-13 20:25:31 +00:00
Tyler Trahan 851310108f Fix #14992, 046b0c6: Respect non-stop order setting when adding waypoint orders (#14993) 2025-12-27 13:59:46 -05:00
Cyprian Klimaszewski 99f04f27de Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-07 11:25:08 +00:00
Peter Nelson 9adc4bfc0f Codechange: Make order load/unload flags value types. (#14861)
Order Load and Unload flags have complex logic to ensure that invalid combinations aren't used. In fact, apart from FullLoad and FullLoadAny, all mixed combinations are invalid.

Simplify logic by removing the use of bit values and treat each option as a value.
2025-12-06 18:30:31 +00:00
Peter Nelson 046b0c6267 Codechange: Use enum class and EnumBitSet for various order flags. (#14783) 2025-12-06 12:29:11 +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
Rubidium 7c0f69a8fe Codefix: typos in comments and strings 2025-08-31 10:30:37 +02:00
Jonathan G Rennison 32d93e1c67 Cleanup: Misspellings of "dropdown" in order_gui.cpp 2025-08-29 21:40:35 +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
Peter Nelson 0455627d16 Codechange: Move ownership of Orders to OrderList. (#13948)
Removes the orders pool, and orders are now stored directly in each OrderList.

Iterating orders now no longer needs to traverse a linked-list, all orders in an OrderList are sequential.
2025-05-23 10:36:28 +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 bc778545b3 Fix 0829604b4f: Dragging of selected order was still not possible. (#14259)
Check click_count condition earlier so that drag and drop is activated.
2025-05-13 01:22:58 +01:00
frosch cdafc50c94 Codechange: Replace atoi and atoll with ParseInteger. 2025-04-29 20:14:56 +02:00
Peter Nelson 0829604b4f Fix #13908: Require double click on order to change stop location. (#13913) 2025-03-28 20:23:18 +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
Peter Nelson 3eb89f04b5 Codechange: Use EnumBitSet for QueryStringFlags. (#13792) 2025-03-10 18:59:35 +00:00
Peter Nelson 06b2751b11 Codechange: Move to GetWidgetString for orders window. 2025-03-03 21:19:44 +00:00
Rubidium c540c2bcf7 Codechange: explicitly initialise member variables of Windows 2025-02-27 19:58:31 +01:00
Peter Nelson 7fd0e6c27d Codechange: Use local string parameters for order and timetable windows.
Order display is now composed of concatenated strings instead of a complex 10-parameter format string, which simplifies things and fixes duplicate spaces.
2025-02-23 13:52:13 +00:00
Rubidium fd4adc55e3 Codechange: replace INVALID_X with XID::Invalid() for PoolIDs 2025-02-16 20:23:00 +01:00
Peter Nelson 2d7d085e8e Codechange: Use EncodedString for error messages. (#13569) 2025-02-16 10:04:32 +00:00
Peter Nelson 75387b9e2b Codechange: Use EnumBitSet for StationFacility. 2025-02-13 18:03:13 +00:00
Rubidium 9ab36b594d Codechange: strongly type OrderID and OrderListID 2025-02-09 15:07:29 +01:00
Rubidium ce07ea00b8 Codechange: add and use GetDepotDestinationIndex map accessor 2025-02-09 14:27:51 +01: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
Rubidium e937c4dcfd Codechange: change DestinationID into class with conversion helpers
A DestinationID is either a DepotID or StationID, where the aircraft hangar
being conceptually a depot is actually a StationID. When making those types
stronger, a lot of casts would need to be added, but this shows the intent
much better.
2025-02-06 21:03:24 +01:00
Peter Nelson 28eb5e05c8 Codechange: Use EnumBitSet for NWidContainerFlags. 2025-02-06 19:43:35 +00:00
Peter Nelson 6c4ddb242a Codechange: Use EnumBitSet for EngineMiscFlags. 2025-01-31 18:55:31 +00:00
Peter Nelson d30e8dd1c1 Codechange: Use EnumBitSet for WindowDefaultFlags. 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
Rubidium ef87acc1ff Codechange: make STR_NULL the default for all widget construction functions 2025-01-03 23:25:27 +01:00
Rubidium 7c1ddd74d5 Codefix: use SetToolTip(..) instead of SetStringTip(STR_NULL, ..) 2025-01-03 14:18:59 +01:00