Commit Graph
346 Commits
Author SHA1 Message Date
Peter NelsonandPeterN a92755de81 Codechange: Use iterator erase pattern. 2023-05-13 19:18:01 +01:00
Peter NelsonandPeterN 4a64064c57 Codechange: Make NEW_STATION an actual item in join station list.
Add NEW_STATION to the nearby station list to indicate that a new
station should be built. This removes special-casing for a non-existant
list item and keeps the list count and scrollbar count the same.
2023-05-13 19:18:01 +01:00
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 NelsonandPeterN e6740046ee Codechange: Use range-for iteration. 2023-05-11 07:58:55 +01:00
Rubidiumandrubidium42 68ff3fd062 Change: include fmt.h C++ headers in stdafx.h
This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
2023-05-08 16:49:23 +02: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
Rubidiumandrubidium42 4a5a9f57c4 Fix: conversion to smaller type warnings 2023-05-06 21:26:13 +02:00
Peter NelsonandPeterN 0acc57583b Fix: Force cargo abbreviation to small font in station list. 2023-04-30 11:47:53 +01:00
Rubidiumandrubidium42 c829930440 Codechange: replace strnatcmp with C++ string capable version 2023-04-29 12:07:45 +02:00
PeterNandGitHub e97bf271dc Codechange: Make SpriteType, CargoSortType, SourceType and ScriptType enum classes. (#10663)
This avoids a (soft) namespace conflict between the four ST_* enums.
2023-04-16 20:00:55 +01:00
Michael Lutz aab580e0ac Codechange: [Linkgraph] Drop node/edge wrappers from LinkGraph. 2023-02-26 21:41:24 +01:00
Rubidiumandrubidium42 fe2bcd2a58 Codechange: migrate size related functions to Map structure 2023-01-21 17:11:40 +01:00
Peter NelsonandPeterN 920e588334 Change: Use standard dimensions instead of custom widths. 2022-11-12 18:28:39 +00:00
Peter NelsonandPeterN 9666e46739 Feature: Variable GUI scale.
GUI scale is now variable from 100% to 500%, and no longer restricted to
powers-of-2.
2022-11-12 18:28:39 +00: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 b6ed595176 Codechange: Prefer suggested widget padding. 2022-11-12 18:28:39 +00:00
Peter NelsonandPeterN 6f95e04005 Change: Use Rect helpers for widget drawing.
This replaces repetitive and sometimes unwieldy use of constants.
2022-11-12 18:28:39 +00:00
Peter NelsonandPeterN eb4ba1991b Change: Use CenterBounds function in more places.
CenterBounds may have a 1 pixel difference so the result is not exactly
the same.
2022-11-12 18:28:39 +00:00
Peter NelsonandMichael Lutz dc1b84aa1e Cleanup: Text widgets are capable of drawing text without assistance.
Remove custom text drawing of some widgets in favour of standard text
widgets.
2022-10-16 14:24:51 +02:00
Peter NelsonandMichael Lutz 0e3400894f Cleanup: Remove redundant WWT_PANEL SetDataTips.
WWT_PANEL defaults to 0x0 data and no tooltip, so no need to declare
the same in the widget tree.
2022-10-16 14:24:51 +02:00
Michael Lutz 6fe445e6c0 Codechange: Un-bitstuff station/depot/waypoint commands. 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 996b16de70 Codechange: Use lambdas instead of CommandContainer to manage station picker commands. 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
glx22andLoïc Guilloux a543a4b7bb Codechange: Remove FOR_EACH_SET_CARGO_ID 2021-07-09 21:36:09 +02:00
glx22andLoïc Guilloux 89ab8b79a5 Codechange: Remove FOR_EACH_SET_BIT 2021-07-09 21:36:09 +02:00
glx22andLoïc Guilloux 5844027eb8 Codechange: Remove FOR_ALL_SORTED_STANDARD_CARGOSPECS 2021-07-09 21:36:09 +02:00
rubidium42andrubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02: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 d8e06e590a Codechange: Make GetCurrentRect() conform to usual Rect bounds, and reuse it.
Similar code is already repeated in other locations.
2021-05-08 09:53:55 +01:00
PeterNandGitHub 9fa38f5d0f Codechange: Scale rating minigraphs on station window list. (#9075)
Minigraphs did not adjust size to accomodate large text, either by font size or font zoom, leading to cropped labels.
Minigraphs and spacing are now scaled by font zoom, as this seems to behave better than gui zoom in this instance.
2021-04-22 16:42:40 +01:00
Peter NelsonandMichael Lutz 2a0365b3d9 Cleanup: Remove unnecessary parameter of GetScrolledRowFromWidget()
Line height defaults to the resize height of the relevant widget, which is
set in all cases. Therefore it is not necessary to specify this value every time.

Additionally fixes scrolled padding for the framerate window.
2021-04-21 23:12:10 +02:00
froschandfrosch 5bfcd742b8 Change: Relocate rename and location buttons in all windows. 2021-01-11 22:15:58 +01:00
Charles PigottandGitHub 9b800a96ed Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
Bernard TeoandPatric Stout 981c540201 Change: Place "Group by" above "Sort by" in station window for consistency 2020-12-21 23:15:53 +01:00
TechGeekNZandCharles Pigott a10013dd00 Codechange: Spell 'Viewport' consistently
Some places in the codebase misspell 'Viewport' as 'ViewPort' or 'view_port'.
This patch makes everything consistent.
2020-07-27 17:31:29 +01:00
dPandCharles Pigott 7bd52970a1 Codechange: Refactor FindStationsAroundTiles to avoid code duplication 2020-05-13 08:43:01 +01:00
Jonathan G RennisonandCharles Pigott d35f35a968 Codechange: Use cached town, station, industry names for list window sorting
This is to avoid needing to expensively regenerate name strings on
every comparison when sorting by name in the town/station/industry
list windows.
2020-01-12 19:37:43 +00:00
glxandNiels Martin Hansen ddabfed1cd Codechange: Replace station related FOR_ALL with range-based for loops 2019-12-21 20:13:03 +01:00
S. D. CloudtandCharles Pigott 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
kiwitreeandPeterN 28b23a6643 Fix: Crash on waypoint selection window 2019-04-30 20:20:14 +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
peter1138andNiels Martin Hansen b6733edd17 Feature: Add coverage area display for existing stations. 2019-04-25 09:14:01 +02:00
glxandPeterN 2db88953e7 Codechange: use std::sort() in GUIList 2019-04-13 12:49:18 +01:00
Henry WilsonandMichael Lutz 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
glx22andGitHub 66dd7c3879 Fix: MSVC warnings (#7423) 2019-03-28 00:09:33 +01:00