Peter Nelson
8275bbfb87
Codechange: Pass Viewport by reference.
...
This means we do not have to care what type of pointer is used.
2025-04-09 22:03:23 +01:00
Rubidium
2b9c94f55a
Fix: don't show owner of non-existent road
2025-03-16 05:42:29 +01:00
Peter Nelson
91d22f7617
Codechange: Use EnumBitSet for VehStates. ( #13755 )
...
Renamed from VehStatus because pluralising that is weird.
2025-03-08 18:24:21 +00:00
Peter Nelson
09806d6f9b
Codechange: Move to GetWidgetString for smallmap window.
2025-03-03 21:23:13 +00:00
Peter Nelson
b92172e3d2
Codechange: Use parameterised GetString() for smallmap window. ( #13684 )
2025-03-01 18:24:14 +00:00
Rubidium
b376e2655a
Codechange: explicitly initialise member variables of Windows
2025-02-27 20:06:06 +01:00
Rubidium
5cee804f98
Codechange: remove ZeroedMemoryAllocator from NWidgetBase
2025-02-22 14:38:33 +01:00
Rubidium
fd4adc55e3
Codechange: replace INVALID_X with XID::Invalid() for PoolIDs
2025-02-16 20:23:00 +01:00
Rubidium
ab8177ea77
Codechange: strongly type CompanyID
2025-02-16 14:02:18 +01:00
Rubidium
5401ab1f7b
Codechange: use ReferenceThroughBaseContainer for containers that are index by CompanyID
2025-02-16 14:02:18 +01:00
Rubidium
37c215f1fd
Fix #13513 , ec492cb267: std::numeric_limits<CompanyMask> not working causes no vehicles to exist
...
std::numeric_limits<T>::max() returns 0 instead of an error when the type is unknown.
Solve it by implementing and using Set() and All() in BaseBitSet in same way as std::bitset.
2025-02-09 22:50:55 +01:00
Rubidium
ec492cb267
Codechange: make CompanyMask a BaseBitSet implementation
2025-02-09 19:24:51 +01:00
Peter Nelson
28eb5e05c8
Codechange: Use EnumBitSet for NWidContainerFlags.
2025-02-06 19:43:35 +00:00
Peter Nelson
59354576d4
Codechange: Use EnumBitSet for LandscapeTypes and remove LandscapeID. ( #13436 )
2025-02-01 23:09:18 +00:00
Rubidium
ac6f3542a8
Codefix: narrowing conversion warning for MSVC x86
2025-02-01 17:54:14 +01:00
Rubidium
4ca1fe6c32
Codechange: replace MAX_UVALUE with std::numeric_limits::max
2025-02-01 01:29:02 +01:00
Peter Nelson
d30e8dd1c1
Codechange: Use EnumBitSet for WindowDefaultFlags.
2025-01-30 08:40:42 +00:00
Peter Nelson
afc0745aa2
Codechange: Specify underlying type for all enums excluding those exposed to scripts. ( #13383 )
2025-01-28 22:17:34 +00:00
Peter Nelson
fb6781015a
Codechange: Use std::endian instead of TTD_ENDIAN defines.
2025-01-28 19:37:34 +00:00
Peter Nelson
4397aa3909
Codechange: Make StationType an enum class. ( #13339 )
2025-01-19 20:53:08 +00:00
Loïc Guilloux
46f181c8a6
Fix #13299 : Merge IT_INVALID and INVALID_INDUSTRYTYPE ( #13300 )
...
* Fix #13299 : Merge IT_INVALID and INVALID_INDUSTRYTYPE
* Codefix: Use NUM_INDUSTRYTILES where it's intended
2025-01-10 01:17:11 +01:00
Rubidium
ef87acc1ff
Codechange: make STR_NULL the default for all widget construction functions
2025-01-03 23:25:27 +01:00
Rubidium
7c1ddd74d5
Codefix: use SetToolTip(..) instead of SetStringTip(STR_NULL, ..)
2025-01-03 14:18:59 +01:00
Rubidium
176eabf9b2
Codefix: replace 0 with STR_NULL
2025-01-03 08:44:53 +01:00
Rubidium
d8d03212b8
Codechange: replace SetDataTip(SPR_ with SetSpriteTip(STR_
2025-01-02 23:28:43 +01:00
Rubidium
4bf36e3fa6
Codechange: replace SetDataTip(STR_ with SetStringTip(STR_
2025-01-02 23:28:43 +01:00
Peter Nelson
74087e6a2e
Codechange: Use _TOOLTIP suffix for other tooltip StringIDs.
2025-01-01 02:28:08 +00:00
Peter Nelson
2ff18a4f05
Fix: String parameter not set when determining width of smallmap contour labels. ( #13145 )
2024-12-04 12:18:17 +00:00
Rubidium
4a6ac52d8c
Cleanup: remove some unused #defines
2024-10-14 21:37:00 +02:00
Edmond Chui
2dc0a33eb7
Fix #12840 , ff3be45: "Show industry names" blank panel not initialized properly
2024-07-04 22:51:06 +02:00
Edmond Chui
ff3be45c23
Add: Toggle for showing industry names in small map
2024-06-25 20:43:28 +02:00
Steve Goldman
c53ed9fad6
Codechange: Creating enum for 'scrollwheel_scrolling' setting
2024-06-24 21:56:26 +02:00
Peter Nelson
55314513ce
Codechange: Pass NWidgetParts as span instead of begin/end pointers. ( #12779 )
2024-06-12 23:08:35 +01:00
Peter Nelson
4cf6d1dd79
Codechange: Pass WindowDesc by reference instead of pointer. ( #12771 )
...
WindowDesc as passed to Windows is not optional so don't allow to it to be nullptr.
2024-06-11 08:58:03 +01:00
Rubidium
97a34bf06e
Codechange: use C++ containers for the colour schemes
2024-04-28 16:04:54 +02:00
Peter Nelson
d43ff8dc49
Change: Ability to set aspect ratio of a widget.
...
This allows setting the shape of a widget without dealing with absolute pixel sizes.
2024-04-19 22:11:16 +01:00
Rubidium
4f2412a272
Codechange: range based for loops instead of C-style for loops
2024-04-11 07:05:04 +02:00
Peter Nelson
9854553e10
Codechange: ZOOM_LVL_SHIFT/BASE are not actually ZOOM_LVLs.
...
Rename to ZOOM_BASE_SHIFT and ZOOM_BASE respectively, and derive from ZOOM_LVL instead of numeric value.
2024-04-04 22:27:03 +01:00
Peter Nelson
d683ec0183
Codechange: Move dropdown and slider out of widgets directory. ( #12403 )
...
Also shuffle headers to place widget includes near end.
This leaves the widgets directory solely for defining Widget IDs.
2024-03-31 19:37:16 +01:00
Patric Stout
a3cfd23cf9
Codechange: rename byte to uint8_t ( #12308 )
2024-03-16 23:59:32 +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
912d7bd80e
Codechange: Give ColourShade values names instead of numbers.
2024-02-25 12:38:07 +00:00
Peter Nelson
ae3390fe48
Codechange: Add ColourShade enum.
2024-02-25 12:38:07 +00:00
Peter Nelson
0463d4c198
Codechange: Remove direct access to _colour_gradient.
...
Access is now through GetColourGradient, which ensures parameters are in range.
2024-02-25 12:38:07 +00:00
frosch
b1718478c8
Codechange: Replace old non-standard attributes with C++17/20 standard attributes.
2024-02-02 22:29:28 +01:00
Rubidium
aa5ba5bd7f
Codechange: allow certain enumeration to be added
...
Otherwise C++20 doesn't like it.
2024-01-16 23:30:23 +01: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
7124b4eef1
Codechange: Use std::unique_ptr for all NWidgets.
2023-12-31 15:33:56 +00:00
Peter Nelson
9a3934ae23
Codechange: Use vector/unique_ptr inside widget containers.
...
This replaces a C-style double-linked-list which required all widgets
to have next/prev pointers, and removes the need for manual pointer management.
2023-12-31 15:33:56 +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