merni-ns
b3669a8795
Fix #11026 : Use real engine name instead of default name for filtering ( #11033 )
1 year ago
PeterN
f814c86389
Codechange: Reorganise hotkey initialisation. ( #10951 )
...
Hotkeys are now initialized inline, and use std::vector instead of
separate static C-arrays and std::string instead of char *. The list end
marker is no longer required.
1 year ago
Rubidium
f29606fd14
Codechange: use std::string to cache engine/group/vehicle names
1 year ago
Peter Nelson
76516d7f70
Codechange: Use IsValidCargoID/IsValidCargoType.
...
IsValidCargoType() is used only for unmapped IDs.
1 year ago
PeterN
64930c343a
Codechange: Pass reference instead of pointer to GUI*Lists. ( #10822 )
...
Pointer-avoidance.
1 year ago
Peter Nelson
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.
1 year ago
Tyler Trahan
61d1b330d1
Change: Add padding to build vehicle text filter ( #10792 )
1 year ago
Peter Nelson
d2034d9c38
Codechange: Scrollbar methods now accept size_t.
...
This clears up a lot of casts from size_t to int.
1 year ago
Rubidium
19ec4e8beb
Codechange: replace ClampToI32/U16 with ClampTo<int32_t/uint16_t>
1 year ago
Peter Nelson
0880616851
Codechange: Remove various STRING strings.
1 year ago
Peter Nelson
e18f688db5
Codechange: Remove various COMMA strings.
1 year ago
Tyler Trahan
6501f84b4a
Codechange: Move calendar date functions inside TimerGameCalendar ( #10753 )
1 year ago
Tyler Trahan
aa8830f57a
Feature: Filter engine build menu by name and NewGRF extra text ( #10519 )
1 year ago
Rubidium
c829930440
Codechange: replace strnatcmp with C++ string capable version
1 year ago
Peter Nelson
1a24016964
Fix: Set TC_NO_SHADE only for shaded engine in purchase list.
...
Additionally use TC_FORCE to prevent additional colours in the shaded text.
1 year ago
PeterN
1697dff744
Change: Hide all variants from UI when (display) parent is hidden. ( #10708 )
1 year ago
Patric Stout
1c76e0904d
Codechange: revive STR_TINY_BLACK_COMMA from its coma ( #10714 )
1 year ago
Jonathan G Rennison
a967cc4de2
Fix: Violation of strict weak ordering in engine value/running cost sorter
1 year ago
Andy
15c3bc456f
Change: extend callback 161 (engine name) with bit 0x22 for context 'Autoreplace - Vehicles in use' ( #10666 )
1 year ago
PeterN
f1144de509
Feature: Separate rail/road and sea/air velocity units, and add knots. ( #10594 )
...
This is achieved by packing vehicle type along with the velocity so that
the string system can decode and pick the appropriate unit.
2 years ago
Michael Lutz
05ed9f56fd
Feature: [NewGRF] Engine name callback.
2 years ago
PeterN
4dfd6a096f
Fix #10220 : Don't select unselectable engine as default. ( #10404 )
2 years ago
Rubidium
8aeef665c7
Fix #10377 , Fix 94167df: bad sorting of rail vehicles when primary variant is missing
2 years ago
Rubidium
90f1768006
Codechange: add non-nullptr asserts in cases where it should never be nullptr
...
Though where similar calls are checked for nullptr as in those instances of
the use of that function it can actually return nullptr. In other words, write
down the assumption that the function never returns nullptr in an assert.
2 years ago
Jonathan G Rennison
10e76b2788
Fix #10032 : Capacities of articulated vehicles in build window
...
See also: #9954
2 years ago
PeterN
5e22788664
Fix #10220 : Adding unavailable variants failed for non-rail engines. ( #10297 )
...
Unavailable parent variant engine for non-rail engines was added to the
wrong (temporary) list so the hierarchy was not added correctly.
2 years ago
Peter Nelson
85814b29d4
Feature: Vehicle add-ons can now group engines in purchase list.
...
Grouped engines are collapsed by default but can be expanded. This allows
similar engines to be grouped together to avoid cluttering the list.
Suggested uses for this are e.g.:
* Liveries; same stats but different paint job.
* Re-gearing; engine design is mostly the same but different stats.
... but avoiding complex hidden cargo subtype refit systems.
Grouped engines are otherwise separate, so can be independently
autoreplaced, even between variants.
2 years ago
peter1138
94167dfd34
Change: Add variant hierarchy to build vehicle window list.
2 years ago
Peter Nelson
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.
2 years ago
Peter Nelson
890b2666d3
Change: Use scaled WidgetDimensions.
2 years ago
Peter Nelson
5786d49143
Change: Use Rect when drawing build engine list.
2 years ago
Peter Nelson
6f95e04005
Change: Use Rect helpers for widget drawing.
...
This replaces repetitive and sometimes unwieldy use of constants.
2 years ago
Henry Wilson
89cf0d5da8
Codechange: Factor cargotype weight conversion magic numbers
2 years ago
Michael Lutz
41fa16f325
Codechange: Don't use globals for return values from vehicle command procs.
3 years ago
Michael Lutz
21675ec7e2
Codechange: Un-bitstuff vehicle/engine commands.
3 years ago
Michael Lutz
4f3ea3907e
Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID).
3 years ago
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.
3 years ago
Michael Lutz
e740c24eb7
Codechange: Template DoCommand 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.
3 years ago
Michael Lutz
b0990fcff7
Codechange: Make TileIndex a "strong" typedef to give it a distinct type.
...
This is accomplished by changing it to a single member struct with the
appropriate operator overloads to make it all work with not too much
source modifications.
3 years ago
Michael Lutz
123c7f99c3
Codechange: Move command callback declarations to the cmd header files.
3 years ago
Michael Lutz
a38bbefe1b
Codechange: Untangle command code, flags and error string for DoCommand*.
3 years ago
Michael Lutz
549caca39c
Codechange: Move command arguments to the back of the networked command function calls.
3 years ago
Michael Lutz
b6933a2ebd
Codechange: Move command arguments to the back of the DoCommand function call.
3 years ago
Loïc Guilloux
9b0bb21f3b
Fix 57734fd: Don't enable rename button for network clients in build vehicle window ( #9452 )
3 years ago
glx22
5844027eb8
Codechange: Remove FOR_ALL_SORTED_STANDARD_CARGOSPECS
3 years ago
glx22
5799402f7a
Codechange: Rename window related DeleteXXX to match new behaviour
3 years ago
rubidium42
2e136285e1
Codechange: move from C-string to std::string for DoCommand
3 years ago
PeterN
224625942c
Fix: Count engine details text in lines rather than pixels. ( #9107 )
...
This allows the details panel to scale correctly for different zoom levels.
3 years ago
stormcone
9c5a7d3a57
Fix #8733 : Can't buy train engine when the "Engines only" filter is active
4 years ago
Didac Perez Parera
6e2a96c133
Add: filter for "engines only" in build train window ( #8733 )
4 years ago