Commit Graph
349 Commits
Author SHA1 Message Date
Rubidiumandrubidium42 7c0f69a8fe Codefix: typos in comments and strings 2025-08-31 10:30:37 +02:00
Peter NelsonandGitHub cb12a59eed Fix #14495: Dangling references in Industry Production graph window. (#14496) 2025-08-05 20:14:55 +01:00
Tyler TrahanandGitHub 8c58fb1efd Fix: Missing button beeps (#14470) 2025-08-05 13:57:45 -04:00
Peter NelsonandGitHub 5b1c6772da Fix 557fb0bd78, bd57aee3a9: Remove separate x-axis label for industry/town production graph. (#14497)
This is no longer necessary (and is wrong) as it's now part of the horizontal scale selector.
2025-08-03 20:04:17 +01:00
Peter NelsonandGitHub bd57aee3a9 Add: Town cargo history graphs. (#14461) 2025-08-02 23:19:43 +01:00
Peter NelsonandPeter Nelson 557fb0bd78 Change: Add support for different horizontal graph scales. 2025-07-30 01:13:05 +01:00
Peter NelsonandPeter Nelson d09dfd843c Codechange: Extend industry cargo history to 24 years.
Monthly data is stored for the current 24 months.
Quarterly data is stored for a further 2-6 years.
Yearly data is stored for a further 6-24 years.
2025-07-30 01:13:05 +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 NelsonandPeter Nelson 56942a15c7 Add: Industry accepted and waiting history graphs.
Records amount of cargo accepted, and a rolling average of the waiting amount.

Average waiting samples the waiting amount once per day for each industry, spread out over an economy day.
2025-07-20 14:03:54 +01:00
Peter NelsonandPeter Nelson 5eeda026a4 Codechange: Allow unused graph ranges to be masked. 2025-07-20 14:03:54 +01:00
Richard WheelerandGitHub 7db135099a Fix: Scale graph gridlines and axes with GUI scale (#12131) 2025-07-10 00:05:48 +01:00
Peter NelsonandPeter Nelson 290144c5c9 Fix #14396: Industry production graph showed zero instead of N/A.
Record the number of valid history records per industry so that the graph avoids showing values which are not present as zero.
2025-07-09 23:02:58 +01:00
Peter NelsonandPeter Nelson 9b55ad5b8d Codechange: Generic type and container for history statistics. 2025-07-09 23:02:58 +01:00
Peter NelsonandGitHub 5766ba51d7 Codefix: Clean up incorrect indentation for multi-line comments. (#14383) 2025-06-20 19:01:44 +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 2f725d1e85 Add: Hover on graph legend to highlight line. 2025-06-07 15:50:25 +01:00
Peter NelsonandPeter Nelson ea0b3983a5 Codechange: Deduplicate common parts of graph windows with cargo legends.
This unifies handling on the cargo selected to avoid having to rewrite it for every cargo graph window.
2025-06-02 17:40:39 +01:00
Peter NelsonandPeter Nelson 43d57a6b7e Codefix 5c45738613: Rename CompanyGraphWindow to BaseCompanyGraphWindow.
This makes it clearer that it isn't a final graph window.
2025-06-02 17:40:39 +01:00
Peter NelsonandPeter Nelson c233e5ee2c Codechange: Tweak layouts of graph windows to reduce spacers. 2025-05-28 18:40:33 +01:00
Peter NelsonandPeter Nelson 5c45738613 Codechange: Improve inheritance of graph windows.
BaseGraphWindow contains parts that are only relevant to company-series data -- these are moved to a separate class.
2025-05-28 18:40:33 +01:00
froschandfrosch 0d5b3ebd7f Codechange: Declare all IntervalTimers const, which can be const. 2025-05-06 18:29:41 +02:00
froschandfrosch 8571af9833 Codechange: Turn ZoomLevel into enum class. 2025-05-03 23:21:09 +02:00
Peter NelsonandGitHub 8b14faaa40 Codechange: Add version of DrawStringMultiLine that performs clipping test. (#14189)
Normally DrawStringMultiLine does not perform any clipping, as the return value may be needed if it the text is not drawn.

In some specific cases the height is already known, so it is possible to test for clipping, which can cut down on layouting time for text which won't be visible.
2025-05-02 22:59:55 +01:00
Peter NelsonandGitHub 5008568dfc Codechange: Rename CenterBounds to CentreBounds and move to geometry header. (#14002) 2025-04-14 23:55:40 +01:00
John TaylorandGitHub 069edc1a4b Fix #13954: Plotting graphs with limited data to the right. (#13956) 2025-04-14 16:57:07 +02:00
7c1649d524 Fix #13955: Make graphs respect RTL (#13957)
Co-authored-by: John Taylor <gitea@johntaylor.hu>
Co-authored-by: frosch <frosch@openttd.org>
2025-04-03 21:17:34 +02:00
John TaylorandGitHub 2f36e3e3a1 Fix #13075, #13893: Reversed all x-axis labels for company related and industry production graphs in wallclock mode. (#13894) 2025-04-02 19:04:49 +02:00
Loïc GuillouxandGitHub e55f54ce08 Fix #13843, 015c081c: Don't discard GetString() result (#13844) 2025-03-18 17:15:40 +00:00
Peter NelsonandPeter Nelson 015c081cea Codechange: Move to GetWidgetString for graph window. 2025-03-03 20:54:09 +00:00
Peter NelsonandGitHub 1bd841b896 Codechange: Use parameterised GetString() for graph windows. (#13683) 2025-03-01 17:22:18 +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
Rubidiumandrubidium42 ab8177ea77 Codechange: strongly type CompanyID 2025-02-16 14:02:18 +01:00
Rubidiumandrubidium42 1ffc950e22 Codechange: use prefix operator++ for CompanyID iterations 2025-02-16 14:02:18 +01:00
Rubidiumandrubidium42 ec492cb267 Codechange: make CompanyMask a BaseBitSet implementation 2025-02-09 19:24:51 +01:00
Peter NelsonandPeter Nelson 28eb5e05c8 Codechange: Use EnumBitSet for NWidContainerFlags. 2025-02-06 19:43:35 +00:00
Peter NelsonandPeter Nelson 56b1e9df1f Codechange: Use EnumBitSet for FrameFlags. 2025-01-30 08:40:42 +00:00
Peter NelsonandPeter Nelson d30e8dd1c1 Codechange: Use EnumBitSet for WindowDefaultFlags. 2025-01-30 08:40:42 +00:00
Rubidiumandrubidium42 e894a5880c Codechange: rename CargoID to CargoType and amend related variables/comments 2025-01-26 18:07:10 +01:00
Rubidiumandrubidium42 6d9f30c343 Codefix: prevent matrix overflows on high resolution monitors 2025-01-04 12:18:37 +01:00
Rubidiumandrubidium42 ef87acc1ff Codechange: make STR_NULL the default for all widget construction functions 2025-01-03 23:25:27 +01:00
Rubidiumandrubidium42 c972a9ae1f Codechange: remove (unused) tooltip from function to set matrix dimensions 2025-01-03 15:05:10 +01:00
Rubidiumandrubidium42 7c1ddd74d5 Codefix: use SetToolTip(..) instead of SetStringTip(STR_NULL, ..) 2025-01-03 14:18:59 +01:00
Rubidiumandrubidium42 3196e0709d Codechange: replace internal SetDataTips with appropriate variants 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 ee3ea57a85 Codechange: replace SetDataTip(RWV_ with SetResizeWidgetTypeTip(RWV_ 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 fedfacf472 Codechange: always do StringID + offset, instead of offset + StringID 2025-01-02 17:09:31 +01:00
Peter NelsonandGitHub 8dfab2a607 Fix #13225: Cargo payment graph key toggled wrong data sets. (#13226)
Cargo payment graph should now be filtered only by CargoID instead of sorted position.
2025-01-01 20:34:55 +00:00
Peter NelsonandGitHub 98e980c478 Codechange: WWT_TEXT, WWT_LABEL and WWT_EMPTY don't use colour. (#13218)
Set colour for these widget types to INVALID_COLOUR to avoid giving the impression that the colour has a purpose.

A runtime exception is added to catch this the existing widget unit test.
2025-01-01 15:38:19 +00:00