Commit Graph

536 Commits

Author SHA1 Message Date
Peter Nelson 914c6a3421 Fix #14917: Crash when opening house picker with no houses available. (#14920) 2025-12-21 02:03:50 +05:00
Tyler Trahan 2ea9f058f5 Feature: House placer mode to replace existing houses (#14469) 2025-12-08 23:19:02 +05:00
Cyprian Klimaszewski add6521abd Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-08 22:26:18 +05:00
Peter Nelson 38849484ca Fix ed67aedabf: Saved default houses had incorrect class and index information. (#14812)
Saved default houses would not appear properly in the 'Saved' tab after restarting the game.
2025-12-08 21:11:07 +05:00
Peter Nelson c2d92433c6 Codechange: Use std::initializer_list for NWidgetPart data. (#14749)
Avoids using C/C++ arrays.
2025-12-08 20:20:01 +05:00
Peter Nelson 7baa01b394 Codechange: Use EnumBitSet for TownFlags. (#14651) 2025-12-08 16:39:00 +05:00
dP b5ad57d342 Refactor town hotkeys 2025-09-28 19:25:59 +05:00
dP 8404c2a7cc Merge remote-tracking branch 'upstream/master' 2025-09-28 02:33:49 +05:00
Rubidium 7c0f69a8fe Codefix: typos in comments and strings 2025-08-31 10:30:37 +02:00
Tyler Trahan 8c58fb1efd Fix: Missing button beeps (#14470) 2025-08-05 13:57:45 -04:00
Peter Nelson bd57aee3a9 Add: Town cargo history graphs. (#14461) 2025-08-02 23:19:43 +01:00
Peter Nelson 614a01907a Codechange: Make functions for click and confirm beeps. (#14484)
Avoids repetition.
2025-07-27 21:54:32 +01:00
Peter Nelson 921d83c324 Codechange: Unify structures with sprite sub-tile bounds and simplify bounding boxes. (#14424)
Lots of different structs contain variations on sub-tile bounds with different naming. Unify into a single struct that can be inherited and passed directly to AddSortableSpriteToDraw.

At the same time, offsets now work more logically: sub-tile bounds now specify the bounding box, and an offset can be applied to the sprite.
2025-07-22 00:02:00 +01:00
Tyler Trahan 753905ae2d Fix #14377: Make house picker window remember house protection state when closed (#14406) 2025-07-09 14:18:19 +00:00
dP 0fe7c3635c Fix compilation errors after the merge 2025-06-27 18:03:03 +05:00
Peter Nelson d5ebd20110 Fix 319caef58f: Buildings with non-zero subtile offsets broken in house picker. (#14390)
Partially reverts 319caef58f. Conversion of subtile position was originally correct.
2025-06-25 17:33:15 +00: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
Colin Caine 5f8e04457e Codechange: Use default OnHotkey handler for focusing editboxes (#14358) 2025-06-16 22:25:54 +02:00
dP f0f93c68ca Merge remote-tracking branch 'upstream/master' 2025-06-14 17:01:17 +05:00
Peter Nelson ecafbf884e Add: Allow separate expansion of town buildings and roads in scenario editor. (#14341) 2025-06-07 13:56:43 +00: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
dP df3a6e321f Merge remote-tracking branch 'upstream/master' 2025-05-14 18:41:13 +05:00
Peter Nelson c8a336f760 Codechange: Move GetNthSetBit() to BaseBitSet.
This now returns the correct type, or std::nullopt instead of -1.
2025-05-14 07:22:12 +01:00
frosch c6fa5022cb Add: [NewGRF] All callbacks returning D0xx strings, have now the option to return any string id via register 0x100. 2025-05-09 12:39:11 +02:00
frosch 6faa667644 Codechange: Remove global GetRegister(), instead return 100+ registers directly from GetXxxCallback(). 2025-05-06 22:24:41 +02:00
frosch 0d5b3ebd7f Codechange: Declare all IntervalTimers const, which can be const. 2025-05-06 18:29:41 +02:00
Peter Nelson 3e608b5fe4 Fix: Zoom-scroll extra viewports only if the mouse cursor is over the viewport. (#14209) 2025-05-04 14:16:05 +01:00
frosch 8571af9833 Codechange: Turn ZoomLevel into enum class. 2025-05-03 23:21:09 +02:00
Iris-Persephone 2f020abe74 Add: "Many random towns" button in scenario editor now prompts for the number of towns, with defaults based on new game settings (#14158) 2025-05-02 22:54:21 +01:00
Peter Nelson 2c4897c2cd Codechange: Use EnumBitSet for HouseZones. (#14137) 2025-04-28 20:27:43 +01:00
frosch b7e7f08f78 Codechange: Simplify usage of GRFFileProps by adding some common helper methods. 2025-04-28 13:44:46 +02:00
frosch f62f728187 Codechange: Move usage of ResolverObjects to newgrf_xxx.cpp (#14116) 2025-04-26 20:53:50 +02:00
Peter Nelson 41ed5f9822 Fix c7d6934816: Town view caption lost "(City)" flag. (#14082) 2025-04-23 08:14:08 +01:00
Peter Nelson 2b92d76e9d Fix e49150f9ca: House picker crashes if selection is not available. (#14030)
This occurs because the extra invalidation in OnInit() also happens on construction, and too early.

Solution is to validate all instead of just position when invalidating in OnInit().
2025-04-19 15:04:18 +01:00
frosch cde350dc01 Codechange: Replace macros GENERAL_SPRITE_COLOUR and COMPANY_SPRITE_COLOUR with functions GetColourPalette and GetCompanyPalette. 2025-04-18 23:41:37 +02:00
frosch 04246c530f Codechange: Use fmt::format instead of stringstream with iomanip flags. (#13964) 2025-04-08 20:57:50 +00:00
Peter Nelson 319caef58f Fix #13912: Multitile buildings break apart in house picker. (#13914)
As this is drawing sprites, use sprite-based scaling instead of interface-based scaling.
2025-03-28 20:30:52 +00:00
Peter Nelson e49150f9ca Fix #13910: Invalidate content of house picker window if language is changed. (#13911) 2025-03-28 19:57:43 +00:00
Peter Nelson 3eb89f04b5 Codechange: Use EnumBitSet for QueryStringFlags. (#13792) 2025-03-10 18:59:35 +00:00
Rubidium 2000cea235 Codechange: initialise instance members 2025-03-09 20:41:03 +01:00
Rubidium a23dda7ffe Codechange: use const auto & instead of making a copy 2025-03-08 21:33:17 +01:00
Peter Nelson b55af05626 Codechange: Pass encoded script strings as EncodedString.
This removes the ambiguity of having std::strings that may or may not be encoded.
2025-03-04 21:40:39 +00:00
Peter Nelson c7d6934816 Codechange: Move to GetWidgetString for town windows. 2025-03-03 22:34:22 +00:00
Peter Nelson c81d9b43ea Codechange: Use parameterised GetString() for town windows. (#13679) 2025-03-01 13:20:05 +00:00
Rubidium fd8c33d051 Codechange: explicitly initialise member variables of Windows 2025-02-27 21:19:28 +01:00
Peter Nelson 2f8be54567 Fix cb23bc5e2a: Cargo types not initialised for house picker produced display. (#13624)
Instead of using a CargoArray and passing to BuildCargoAcceptanceString, use the simpler CargoTypes with {CARGO_LIST}.
2025-02-19 19:01:03 +00:00
Peter Nelson 8f14894024 Add: NewGRF Badges. 2025-02-16 22:24:25 +00:00
Peter Nelson 2d7d085e8e Codechange: Use EncodedString for error messages. (#13569) 2025-02-16 10:04:32 +00:00
Peter Nelson cb23bc5e2a Add: Show cargo types produced by building in house picker. (#13561) 2025-02-15 15:06:58 +00:00