Commit Graph

114 Commits

Author SHA1 Message Date
Peter Nelson de4e00c93f
Codechange: Pass by reference to UpdateWidgetSize. (#12457)
These parameters are always provided and not optional.
2024-04-09 08:34:45 +01:00
Rubidium 86cb184eb4 Codechange: use std::source_location over __FILE__ and __LINE__ for WindowDesc 2024-03-10 10:14:20 +01:00
Peter Nelson 14b31c8fed
Add: Show cargo icons on subsidy list window. (#12079) 2024-02-13 07:41:24 +00:00
Tyler Trahan fd9e72a7e7
Feature: Use real-time "wallclock" timekeeping units (#11341) 2024-01-23 11:36:09 -05:00
Tyler Trahan 735abfe111
Codechange: Split dates and timers into Economy and Calendar time (#10700) 2024-01-22 09:04:34 -05:00
Peter Nelson 7737aa6640 Codechange: Make all NWidgetPart arrays constexpr.
This ensures that the arrays are not created at runtime and prevents using non-constexpr values.
2024-01-16 21:57:05 +00:00
Peter Nelson a0dfb76e34 Codechange: Replace mishmash of types for widget index with WidgetID.
Indices were stored as int, but often passed around as uint/uint8_t and casts.

Now they should all use WidgetID.
2023-12-30 00:23:57 +00:00
Peter Nelson 33ff64ef74
Codechange: Simplify ConvertDateToYMD by returning YearMonthDay instead of outputting to a pointer. (#11637) 2023-12-28 21:34:08 +00:00
Peter Nelson c18a1494b7
Codechange: Remove FONT_HEIGHT_... macros. (#11481)
These make it look like we're dealing with a constant, but actually each is a call to `GetCharacterHeight(...)`.
2023-11-21 19:04:24 +00:00
Peter Nelson 18fb8e153f Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
This is to allow unit-tests to produce more useful output.
2023-11-02 22:25:01 +00:00
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Peter Nelson e8015e497d Codechange: Use begin/end of nwidget parts of begin/length.
This simplifies processing nwidget parts as, unlike the remaining length, the pointer to the end of the list never changes. This is the same principle as we use(d) for tracking end instead of length for C-style strings.

And this removes 160~ instances of the lengthof() macro.
2023-09-04 10:20:45 +01:00
Tyler Trahan 6501f84b4a
Codechange: Move calendar date functions inside TimerGameCalendar (#10753) 2023-05-04 13:14:12 +00:00
Patric Stout 7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 2023-04-24 15:56:01 +00:00
PeterN 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
Peter Nelson 890b2666d3 Change: Use scaled WidgetDimensions. 2022-11-12 18:28:39 +00:00
Peter Nelson b6ed595176 Codechange: Prefer suggested widget padding. 2022-11-12 18:28:39 +00:00
Peter Nelson 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
Tyler Trahan d09210e1c6 Feature: Configurable subsidy duration 2021-06-10 23:26:16 +02:00
TechGeekNZ 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
glx 0b489f9924 Codechange: Replace FOR_ALL_SUBSIDIES with range-based for loops 2019-12-21 20:13:03 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
peter1138 317f69c152 Codechange: Use override specifier in Window-derived classes. 2019-03-24 16:10:04 +01:00
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
frosch 4e4e635916 (svn r25294) -Feature: Add another button to window title bars to resize the window to its default size. 2013-05-26 19:30:07 +00:00
frosch 8157a8afd8 (svn r25290) -Add: Assign string names to notable windows. 2013-05-26 19:25:01 +00:00
frosch 56e4a8c4d6 (svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction. 2013-05-26 19:23:42 +00:00
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 2013-01-08 22:46:42 +00:00
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 2012-01-03 21:32:51 +00:00
truebrain e2726ca3f1 (svn r23547) -Codechange: document and rename widgets to be consistent and understandable 2011-12-16 18:21:13 +00:00
truebrain 98d3f11d45 (svn r23529) -Codechange: make all widget enum values unique and make them include the files they need to compile 2011-12-16 16:23:50 +00:00
truebrain 2aa774e831 (svn r23528) -Codechange: move widget enums to widgets/NNN_type.h 2011-12-15 22:22:55 +00:00
frosch ec9540a12a (svn r22241) -Codechange: Add additional to-be-used parameter to OnInvalidateData(). 2011-03-13 21:31:29 +00:00
alberth f5c6fd1a25 (svn r21331) -Codechange: Make drawing the widgets default behaviour in OnPaint(). 2010-11-26 15:22:18 +00:00
glx 4231154bb4 (svn r21309) -Fix: second parameter of SetupSubsidyDecodeParam() is a bool, so use a bool when calling the function 2010-11-24 01:08:49 +00:00
frosch 9e538acc03 (svn r20461) -Codechange: Replace WWT_HSCROLLBAR, WWT_SCROLLBAR and WWT_SCROLL2BAR with NWID_HSCROLLBAR and NWID_VSCROLLBAR. 2010-08-12 09:16:43 +00:00
frosch 71ca58c2bb (svn r20453) -Codechange: Remove direct accesses to Window::hscroll, vscroll and vscroll2.
Note: All windows get individual members with the same names, which are initialised via Window::GetScrollbar(). This caching is not required at all, but simplifies conversion.
2010-08-12 08:37:01 +00:00
frosch 10339c60c0 (svn r20452) -Codechange: Remove NWidgetCore::FindScrollbar() and associate scrollbar explicitly using a NWidgetPart via SetScrollbar(). 2010-08-12 06:44:45 +00:00
alberth 4203e641f8 (svn r20223) -Codechange: Replace scrolled row calculations by a call to GetScrolledRowFromWidget(). 2010-07-26 13:08:48 +00:00
frosch 88019e64e1 (svn r18966) -Codechange: Remove Window::OnDoubleClick() in favour of a parameter for OnClick(). 2010-01-30 18:34:48 +00:00
rubidium 82fc28f77f (svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header 2010-01-15 16:41:15 +00:00
rubidium 87466a4ed0 (svn r18717) -Codechange: use TileArea in industry instead of three separate variables. Also make use of TileArea functions for determining the 'width' and 'height' of an industry. 2010-01-04 18:21:07 +00:00
alberth 91872aca48 (svn r18588) -Feature [FS#2943]: Add shading and unshading of windows. 2009-12-21 16:24:29 +00:00
alberth 5a083f183e (svn r18580) -Codechange: Use widget information only for setting scrollbar capacity. 2009-12-20 20:08:39 +00:00
rubidium 293dfd7c3e (svn r18322) -Codechange: remove the WDP duplication; no need to tell the same twice. 2009-11-28 14:42:35 +00:00
rubidium 14300d309c (svn r18277) -Codechange: remove unneeded widget indices for close, resize and sticky boxes and for window captions 2009-11-24 18:05:55 +00:00
rubidium 69b6d9309a (svn r18274) -Codechange: remove the unused WDF flags 2009-11-24 17:28:29 +00:00
alberth 450e40b997 (svn r18230) -Codechange: Allow fill stepsize to be set from Window::UpdateWidgetSize(). 2009-11-22 18:28:14 +00:00
rubidium 5f2ddfbc5a (svn r18152) -Codechange: remove the 'minimum window size' from the WindowDesc; it's determined from the (nested) widgets 2009-11-17 19:16:48 +00:00
rubidium 626de6b128 (svn r18126) -Codechange: remove duplicate (since r18119) scrollbar capacity/matrix initialisation 2009-11-16 20:34:57 +00:00