Peter Nelson
9f190aa534
Codechange: Use group's children list to improve performance of group UI.
2025-05-21 19:50:07 +01:00
Peter Nelson
2909a14374
Codechange: Include table/strings.h in files that use StringIDs.
...
Be consistent with how and where the file is incldued.
2025-03-21 12:53:40 +00:00
Peter Nelson
3eb89f04b5
Codechange: Use EnumBitSet for QueryStringFlags. ( #13792 )
2025-03-10 18:59:35 +00:00
Peter Nelson
a22b150c98
Codechange: Move to GetWidgetString for group window.
2025-03-03 20:54:09 +00:00
Peter Nelson
9d7d24465d
Codechange: Use parameterised GetString() for group window. ( #13693 )
2025-03-01 23:42:01 +00:00
Rubidium
f69968f2bc
Codechange: explicitly initialise member variables of Windows
2025-02-27 12:21:06 +01:00
Rubidium
fd4adc55e3
Codechange: replace INVALID_X with XID::Invalid() for PoolIDs
2025-02-16 20:23:00 +01:00
Peter Nelson
20e57a02a2
Codechange: Use GetString() with argument parameters in simple cases. ( #13551 )
...
Avoids using global string parameters.
2025-02-14 00:10:56 +00:00
Peter Nelson
984da2455b
Codechange: Use EncodedString for Query window. ( #13528 )
...
This removes the need to separately capture and store global parameters.
2025-02-11 17:30:16 +00:00
Rubidium
1e24b41f22
Codechange: strongly type GroupID
2025-02-09 16:52:21 +01:00
Rubidium
ac54ff368c
Codechange: set VLI.index through accessor function
2025-02-08 10:09:02 +01:00
Rubidium
4e84d032b8
Codechange: read VLI.index through wrapper to get the right type
2025-02-08 10:09:02 +01:00
Peter Nelson
c3643e3ee0
Codechange: Pass raw string to editable query window. ( #13481 )
...
This avoids separating string id and parameters. EncodedString is not needed as it is the raw text that is editable.
2025-02-07 17:03:53 +00:00
Peter Nelson
28eb5e05c8
Codechange: Use EnumBitSet for NWidContainerFlags.
2025-02-06 19:43:35 +00:00
Rubidium
5a78bb8fac
Codechange: ToWindowNumber describes better what is the intent than Pack
2025-02-02 15:57:18 +01:00
Rubidium
e36a9ceaf0
Codechange: allow passing extra constructor arguments via AllocateWindowDescFront
2025-02-02 15:57:18 +01:00
Rubidium
8f72a478f0
Codechange: change 'return existing window' to a template parameter
...
This change is made to make it possible to pass arbitrary other parameters
to the constructor of the window instances.
2025-02-02 15:57:18 +01:00
Peter Nelson
d30e8dd1c1
Codechange: Use EnumBitSet for WindowDefaultFlags.
2025-01-30 08:40:42 +00:00
Peter Nelson
f51627c76f
Codechange: Use EnumBitSet for DepotCommand(Flag)s.
2025-01-29 21:46:39 +00:00
Peter Nelson
5ef495da78
Codechange: Use EnumBitSet for GroupFlags.
2025-01-29 21:46:39 +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
95df7ea483
Change: Use separate WindowDescs instead of changing static data.
...
When opening vehicle lists a static WindowDesc is modified to change the class depending on the vehicle type.
Theses makes for inconsistencies and preferred window state, and prevents WindowDesc members being made const.
2025-01-26 16:42:05 +00:00
Rubidium
b71a5158cf
Codechange: use INVALID_VEHICLE where that's more appropriate than e.g. vehicle 0
2025-01-19 17:10:21 +01:00
Peter Nelson
95f8fc983b
Codechange: Make GroupFlags an enum class. ( #13312 )
...
GF_END is 'reserved' in some Windows APIs. Instead of working around it, make GroupFlags an enum class.
2025-01-14 11:33:26 +00:00
Rubidium
ef87acc1ff
Codechange: make STR_NULL the default for all widget construction functions
2025-01-03 23:25:27 +01:00
Rubidium
3ecd1187ba
Codechange: set sprite once for group UI
2025-01-03 14:19:35 +01:00
Rubidium
b60101853c
Codechange: add and use SetString over directly accessing widget_data
2025-01-03 12:14:55 +01:00
Rubidium
fb06ddafba
Codechange: add and use SetSprite over directly accessing widget_data
2025-01-03 11:13:16 +01:00
Rubidium
9ac1bad480
Codechange: add and use GetString over directly accessing widget_data
2025-01-03 11:11:01 +01:00
Rubidium
3dd0b93698
Codechange: use SetStringTip instead of accessing widget_data and tool_tip directly
2025-01-03 11:09:49 +01:00
Rubidium
7c2668d10f
Codechange: replace SetDataTip(0x0, with SetTooltip(
2025-01-02 23:28:43 +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
Rubidium
fd5f6caed4
Codechange: use explicit TileIndex constructor for tile 0
2025-01-01 08:26:54 +01:00
Peter Nelson
059a4b22f7
Codechange: Use projection-based std::range::find where possible.
...
This simplifies matching by class members and avoids wordy lambdas.
2024-11-24 10:36:03 +00:00
Peter Nelson
e45e8a39c8
Add: Overlay cargo icon in vehicle/depot list when holding shift+ctrl. ( #12938 )
2024-09-22 10:33:44 +01:00
Jonathan G Rennison
e477706bf5
Codechange: Add AssignBit function to assign the value of a single bit ( #12934 )
...
* Codechange: Add AssignBit function to assign the value of a single bit
* Codechange: Replace various uses of SB with AssignBit
* Codechange: Replace various uses of SB with a constant with SetBit
2024-09-10 08:36:58 -04:00
Rubidium
14200212b7
Codechange: use std::optional<std::string> over char * for text query results
2024-06-29 16:33:16 +02:00
Peter Nelson
7116f143d5
Codefix: Hole in vehicle list window if dimensions are not as expected. ( #12803 )
...
The layouts for these windows assume that push buttons and dropdowns are the same height.
2024-06-23 08:14:06 +01: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
Peter Nelson
9c19cf06e4
Change: [UI] Use SetMinimalTextLines to set label height correctly. ( #12734 )
...
SetMinimalSize does not know about font size, so these labels were incorrectly sized if the font height is different from normal.
2024-05-30 12:31:21 +01:00
Tyler Trahan
37f68a65ee
Fix #12283 : Vehicle group dropdown shouldn't have default action ( #12727 )
2024-05-27 16:26:07 -04:00
Peter Nelson
9008d793ab
Change: Use per-company group numbers. ( #12297 )
...
This is used by the default group name, replacing the use of group index.
2024-05-07 19:01:28 +00:00
Rubidium
546a996d95
Codechange: pass options to ShowDropDownMenu using a span
2024-04-28 18:47:31 +02:00
Peter Nelson
33aedc43a5
Codechange: Shrink GUIList vectors less often, reserve before use.
...
After sorting and filter lists for GUI, we often shirnk them to reduce size. However this has very little benefit:
1) The memory has already been allocated, so it doesn't prevent that memory being required.
2) It causes a new allocation and copy when the vector is shrunk, actually using more memory.
3) The list is in window state, so the lifetime is only while the window is open.
4) When a filter is clearer, the original size will be needed again, which will cause another allocation.
In fact it is beneficial to reserve to the known maximum in most cases, so do that instead.
2024-04-27 19:25:34 +01:00
Peter Nelson
16eb17418b
Change: Use aspect ratios for some common widgets.
2024-04-19 22:11:16 +01:00
Peter Nelson
6458980413
Change: Draw group hierarchy tree lines. ( #12522 )
2024-04-17 21:55:19 +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
de4e00c93f
Codechange: Pass by reference to UpdateWidgetSize. ( #12457 )
...
These parameters are always provided and not optional.
2024-04-09 08:34:45 +01:00