Commit Graph
268 Commits
Author SHA1 Message Date
Peter NelsonandPeterN 941dbadf9e Codechange: Add and use GetScrolledItemFromWidget to get a list item.
This function returns an iterator, either to the selected item or the
container's end.

This makes handling the result more robust as indices are not used.
2023-05-12 21:45:32 +01:00
Peter NelsonandMichael Lutz 0513a6ccb0 Change: Use separate names for default stations/roadstops. 2023-05-09 23:03:14 +02:00
PeterNandGitHub 882f06bf14 Fix: Support more than 256 stations/waypoints/roadstops per class. (#10793)
It was already possible to define more than 256 per class, but not possible
to use them as the index used in GUI and passed through commands was limited
to a byte.
2023-05-08 18:09:33 +00:00
Peter NelsonandPeterN d2034d9c38 Codechange: Scrollbar methods now accept size_t.
This clears up a lot of casts from size_t to int.
2023-05-07 20:25:44 +01:00
Peter NelsonandPeterN 0880616851 Codechange: Remove various STRING strings. 2023-05-05 07:07:54 +01:00
Tyler TrahanandGitHub ba3de0383a Codechange: Pass more std::string to StringFilter::AddLine() (#10743) 2023-04-30 10:23:05 +02:00
Patric StoutandGitHub 7aa2b9ab0a Codechange: move all date-related variables inside the timer (#10706) 2023-04-24 15:56:01 +00:00
Patric StoutandPatric Stout 3ebc7ad16e Codechange: migrate all game-time-related timers to the new framework 2023-04-15 13:58:55 +02:00
PeterNandGitHub f1144de509 Feature: Separate rail/road and sea/air velocity units, and add knots. (#10594)
This is achieved by packing vehicle type along with the velocity so that
the string system can decode and pick the appropriate unit.
2023-04-08 12:26:13 -04:00
Jonathan G Rennisonandrubidium42 4c1406a4b5 Add: NewGRF road stops 2023-02-26 21:28:30 +01:00
Rubidiumandrubidium42 f001e84e5e Codechange: use RAII to automatically restore _cur_dpi after use 2023-01-28 20:33:02 +01:00
Peter NelsonandPeterN ed60c88b0a Change: Use power-of-2 scaling for some dimensions in GUI.
These are related to drawing sprites that are normally drawn on the
landscape, and should therefore still follow power-of-2 scaling to fit
correctly.
2022-11-12 18:28:39 +00:00
Peter NelsonandPeterN 890b2666d3 Change: Use scaled WidgetDimensions. 2022-11-12 18:28:39 +00:00
Peter NelsonandPeterN 1f1378c129 Change: Align picker previews to button centre. 2022-11-12 18:28:39 +00:00
Peter NelsonandPeterN ab55d3e1fa Change: Rearrange layouts of station/depot picker windows. 2022-11-12 18:28:39 +00:00
Tyler TrahanandMichael Lutz db98cedb7e Fix #9883: Show cost/income float over end tile of rail or road construction 2022-10-16 14:15:31 +02:00
Peter NelsonandPeterN af6c4d50ce Change: Tidy up coverage area label widget layout.
Label is now centered properly and uses standard spacing.
2022-10-03 22:14:18 +01:00
Peter NelsonandPeterN 8626090b24 Codechange: Draw station acceptance text in its own widget. 2022-10-03 22:14:18 +01:00
Michael Lutz 8d54f76539 Fix #9837, 46bd2f1c: Road build with wrong half-tile ends. 2022-03-20 12:56:03 +01:00
Michael Lutz 8503854655 Codechange: Pass unpacked command arguments to command callbacks (except Script). 2021-12-16 22:28:32 +01:00
Michael Lutz 46bd2f1ced Codechange: Un-bitstuff remaining transport infrastructure commands. 2021-12-16 22:28:32 +01:00
Michael Lutz 6fe445e6c0 Codechange: Un-bitstuff station/depot/waypoint commands. 2021-12-16 22:28:32 +01:00
Michael Lutz eab18f06a4 Codechange: Pass additional data as byte stream to command callbacks. 2021-12-16 22:28:32 +01:00
Michael Lutz 0f64ee5ce1 Codechange: Template DoCommandP to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
2021-12-16 22:28:32 +01:00
Michael Lutz e740c24eb7 Codechange: Template DoCommand to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
2021-12-16 22:28:32 +01:00
Michael Lutz 996b16de70 Codechange: Use lambdas instead of CommandContainer to manage station picker commands. 2021-12-16 22:28:32 +01:00
Michael Lutz 4fc055d6e9 Codechange: Align parameter order of command callbacks to command handlers. 2021-12-16 22:28:32 +01:00
Michael Lutz a38bbefe1b Codechange: Untangle command code, flags and error string for DoCommand*. 2021-12-16 22:28:32 +01:00
Michael Lutz 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 2021-12-16 22:28:32 +01:00
Michael Lutz b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 2021-12-16 22:28:32 +01:00
glx22andLoïc Guilloux 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 2021-05-29 21:08:25 +02:00
glx22andLoïc Guilloux 994bf19aef Fix f6d5c01: Delay deletion when closing windows 2021-05-29 21:08:25 +02:00
glx22andLoïc Guilloux 38c97e1492 Codechange: Replace TILE_AREA_LOOP with range-based for loops 2021-05-13 00:13:54 +02:00
Peter NelsonandPeterN de81afdf4b Cleanup: Replace FOR_ALL_SORTED_ROADTYPES macro with range iterator. 2021-04-28 23:54:31 +01:00
froschandGitHub d9b4413bc9 Codechange: rename sound ids to make more sense. (#8701) 2021-02-20 19:01:04 +01:00
Patric StoutandGitHub 7ba0fa4bf0 Fix af22a4f2: scenario editor doesn't have build station/depot/etc (#8529) 2021-01-08 19:48:39 +01:00
Patric StoutandPatric Stout af22a4f2cd Add: show in the tooltip of disabled toolbar buttons why they are disabled 2021-01-08 16:43:51 +01:00
Patric StoutandPatric Stout 85a49a0d36 Change: always allow to click on the toolbar icons for road/rail/dock/airport
This change allows a user to see what is available and what will become
available before it is available, instead of only disabling the button
with no further explanation. It also always allows building roads and
canals, even if no vehicles are available for road / water.

For rail/road/tram, a dropdown with available types is shown. If
none are available, it reads "None". If the type is not yet available,
it is greyed out.

For dock/airport, this always open the toolbar, but building airports,
docks, and depots buttons are disabled till vehicles are available
for those.

Road is the only exception, with the primary road always being
available. Here too, stations and depots are disabled till vehicles
become available. It does mean you can now always build roads to
for example help towns grow.
2021-01-08 16:43:51 +01:00
Łukasz HryniukandGitHub 3effad0bea Fix: Properly invalidate mouse-over station coverage highlight (#8263) 2020-07-27 17:37:47 +01:00
YexoandGitHub 587d8e716b Fix #8155: Roadtype speed limit in toolbar dropdown in scenario editor was doubled 2020-05-19 20:01:09 +02:00
stormconeandGitHub 2514f43909 Fix #8055, c02ef3e: Crash when roadtype availability changed with the road toolbar open (#8058) 2020-04-05 18:34:36 +01:00
glxandNiels Martin Hansen 0b5e0522b6 Fix #8043, c02ef3e4: Incorrect handling of global road/tram hotkeys 2020-03-30 08:17:40 +02:00
S. D. CloudtandCharles Pigott 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
stormconeandCharles Pigott 1e5029563c Fix #7635: Game crash on exit scenario editor. 2019-10-08 00:21:18 +01:00
JMcKiernandCharles Pigott 04f659e768 Fix: Some typos found using codespell 2019-09-29 21:27:32 +01:00
glx22andCharles Pigott b3fd787959 Fix #7188: check the validity of command callback for scripts (#7701) 2019-09-07 17:37:01 +01:00
peter1138andMichael Lutz c02ef3e456 Feature: Add NotRoadTypes (NRT) 2019-05-01 21:36:27 +02:00
PeterNandGitHub 14dc8dd619 Fix 81d335b: Don't check state of widget not present in scenario editor. (#7551) 2019-04-29 19:09:11 +01:00
peter1138andNiels Martin Hansen 81f0f97406 Feature: Add existing station coverage area display when placing new station parts. 2019-04-25 09:14:01 +02:00
Henry WilsonandMichael Lutz 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00