Rubidium
3a2509198f
Codechange: use better location for the "invalid" action sentinel value
...
It used to be a random sentinel for end-of-(widget-)list that was used to tell
that no action has taken place yet. Since the last action is practically the
widget that was pressed, add the sentinel to that enumeration.
1 year ago
PeterN
acd7d3c913
Codechange: Rename *Railtype* to *RailType* for consistency. ( #11287 )
1 year ago
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.
1 year ago
Rubidium
eaae0bb5e7
Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
...
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
1 year ago
glx22
46b504a700
Fix: ini_key issues reported by the script
1 year ago
PeterN
d42a78f3e8
Codechange: Make DropDownListStringItem preformat and remove other implementations. ( #11063 )
...
Having to choose between DropDownListStringItem, DropDownListCharStringItem, and DropDownListParamStringItem depending on whether to draw a StringID, a raw string, or a StringID with extra parameters was needlessly complex.
Instead, allow passing a StringID or raw string to DropDownListStringItem. This will preformat the StringID into a raw string, and can therefore accept parameters via the normal SetDParam mechanism.
This also means that strings no longer need to be formatted on every draw.
1 year ago
Rubidium
7c37dcb8e3
Fix: do not use {STRING} when {STRING1} or {STRING2} is needed
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
PeterN
6ae6b65edb
Cleanup: Remove doubled statements. ( #10944 )
1 year ago
Jonathan G Rennison
d7bf6b2c07
Feature: Highlight waypoint tiles when adjacent or distant joining
1 year ago
Jonathan G Rennison
ba11467c02
Fix: Rail waypoint selection window not closed
...
When rail toolbar or rail waypoint build windows closed
1 year ago
PeterN
bc45c3f66c
Change: Remember waypoint filter string. ( #10857 )
1 year ago
PeterN
07473bfd2e
Fix: Don't use a loop to test if classid is valid. ( #10818 )
...
Additionally the Object class test was broken.
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
Peter Nelson
f5158c8b79
Feature: Add search filter and name text to build waypoint window.
1 year ago
Peter Nelson
dc50ff807c
Change: Remove incorrect minimal size.
1 year ago
Peter Nelson
b54d7f15ac
Change: Reduce size of waypoint matrix to 3 x 2.
1 year ago
Peter Nelson
0513a6ccb0
Change: Use separate names for default stations/roadstops.
1 year ago
Peter Nelson
93d49fa8b3
Fix: Make scrollwheel work on panel behind waypoint matrix.
1 year ago
PeterN
882f06bf14
Fix: Support more than 256 stations/waypoints/roadstops per class. ( #10793 )
...
It was already possible to define more than 256 per class, but not possible
to use them as the index used in GUI and passed through commands was limited
to a byte.
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
Peter Nelson
0880616851
Codechange: Remove various STRING strings.
1 year ago
Peter Nelson
4767641c8c
Codechange: Remove various INT strings.
1 year ago
Tyler Trahan
ba3de0383a
Codechange: Pass more std::string to StringFilter::AddLine() ( #10743 )
1 year ago
Patric Stout
7aa2b9ab0a
Codechange: move all date-related variables inside the timer ( #10706 )
1 year ago
Patric Stout
3ebc7ad16e
Codechange: migrate all game-time-related timers to the new framework
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
Rubidium
f001e84e5e
Codechange: use RAII to automatically restore _cur_dpi after use
2 years ago
Rubidium
fe2bcd2a58
Codechange: migrate size related functions to Map structure
2 years ago
PeterN
387c57b023
Fix eb4ba1991: Signal icons incorrectly positioned in UI. ( #10199 )
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
b6ed595176
Codechange: Prefer suggested widget padding.
2 years ago
Peter Nelson
1f1378c129
Change: Align picker previews to button centre.
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
Peter Nelson
f5f035a22b
Codechange: Make use of Rect Width/Height helpers.
2 years ago
Peter Nelson
eb4ba1991b
Change: Use CenterBounds function in more places.
...
CenterBounds may have a 1 pixel difference so the result is not exactly
the same.
2 years ago
Peter Nelson
ef8322ba25
Change: Add panel widget to waypoint GUI.
2 years ago
Peter Nelson
0e3400894f
Cleanup: Remove redundant WWT_PANEL SetDataTips.
...
WWT_PANEL defaults to 0x0 data and no tooltip, so no need to declare
the same in the widget tree.
2 years ago
Tyler Trahan
db98cedb7e
Fix #9883 : Show cost/income float over end tile of rail or road construction
2 years ago
Peter Nelson
af6c4d50ce
Change: Tidy up coverage area label widget layout.
...
Label is now centered properly and uses standard spacing.
2 years ago
Peter Nelson
8626090b24
Codechange: Draw station acceptance text in its own widget.
2 years ago
SamuXarick
374f0c7d11
Fix 6fe445e: Removing rail station parts without ctrl pressed was also removing tracks
...
The behaviour of holding ctrl key is swapped
2 years ago
Tyler Trahan
7f0efbe00e
Feature: Remember the last-used signal between games ( #9792 )
3 years ago
Jonathan G Rennison
6ccf020dc2
Fix #9802 : Assertion failure in BuildRailWaypointWindow constructor
3 years ago
Michael Lutz
8503854655
Codechange: Pass unpacked command arguments to command callbacks (except Script).
3 years ago
Michael Lutz
46bd2f1ced
Codechange: Un-bitstuff remaining transport infrastructure commands.
3 years ago
Michael Lutz
55170ae703
Codechange: Un-bitstuff rail commands.
3 years ago
Michael Lutz
6fe445e6c0
Codechange: Un-bitstuff station/depot/waypoint commands.
3 years ago
Michael Lutz
eab18f06a4
Codechange: Pass additional data as byte stream to command callbacks.
3 years ago