Peter Nelson
ab535c0a86
Codechange: Add base() method to StrongType to allow access to the base type without casting. ( #11445 )
...
This removes the ability to explicitly cast to the base type, but the requirement
to use .base() means the conversion is still explicit.
8 months ago
Peter Nelson
d4a77411a5
Fix: Some NWidget lists were not properly closed. ( #11425 )
8 months ago
Peter Nelson
18fb8e153f
Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
...
This is to allow unit-tests to produce more useful output.
8 months ago
Peter Nelson
bb6fa9bf3b
Change: Display cargo lists in sorted cargo order. ( #11383 )
8 months ago
Peter Nelson
f379b31e28
Add: data parameter in Window::Close method.
...
This allows passing data when closing a window, e.g. to indicate how it was closed.
9 months ago
frosch
b5885295f0
Codechange: Use parameters, which should be used.
9 months ago
frosch
b6c8f301be
Codechange: Silence warnings about intentionally unused parameters.
9 months ago
Tyler Trahan
77173a6a10
Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes
10 months ago
Tyler Trahan
fca2b37726
Codechange: Move Ticks into their own class
10 months 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.
10 months ago
Patric Stout
07730584d7
Codechange: make explicit when a TileIndex is cast to its basetype ( #11190 )
...
This prevents people accidentially assigning a TileIndex to a Date
or any other type they shouldn't.
11 months 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
12 months ago
glx22
46b504a700
Fix: ini_key issues reported by the script
12 months ago
merni-ns
fc9afb2d32
Fix #11115 : Focus the abandon game/exit game windows ( #11125 )
12 months ago
Rubidium
af9b9327af
Codechange: do not keep local variable for temporary string parameters
1 year ago
Rubidium
f4a3032985
Codechange: move tooltip and query window over to the new StringParameterBackup type
1 year ago
Rubidium
836541b41c
Codechange: use SetDParam and CopyOutDParam for tooltips
1 year ago
PeterN
f51f117b00
Change: Add window description flag to disallow interactive window closing. ( #11008 )
...
This replaces/simplifies testing for a closebox to allow closing a window with right-click, and testing for specific window classes when closing all windows by hotkey.
This allows right-click closing of dropdowns and the high-score window.
1 year ago
Rubidium
82851a9bef
Codechange: do not mess with global string params to get pointer to first element
1 year ago
Rubidium
82b434b589
Codechange: rename function to better describe what it is doing
1 year ago
Rubidium
f86500df92
Codechange: remove need for SetDParamX
1 year ago
Rubidium
6c6f365d2f
Codechange: remove offset parameter for copying DParams in and out
1 year ago
Rubidium
d42ef3a0ef
Codechange: inject the query window caption into the widget
1 year ago
Rubidium
a4bf45729a
Change: move string validation (and assignment) to textbuf
1 year ago
Patric Stout
caa0474d30
Fix: crash with tooltip on low resolution screens ( #10933 )
1 year ago
Patric Stout
0f3dd9c796
Fix: crash when window can't be placed on low resolution screens. ( #10932 )
...
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
1 year ago
PeterN
1ff0dc11d8
Fix: Land info window maximum width was not scaled. ( #10894 )
1 year ago
Peter Nelson
f177ce7c9a
Codechange: Base CargoArray off std::array.
...
This avoids needing to define array accessors and allows use of
default value initialization.
1 year ago
Rubidium
6f2f38b3ed
Codechange: fmt (and std::format) do explicitly not support enums out-of-the-box
...
That it works for the version we have packaged it pure coincidence, as that is
one of the few versions that due to a bug allow it. So add the appropriate
template specialisations to support it out-of-the-box within OpenTTD.
1 year ago
Rubidium
6d1586dd49
Codechange: use std::string instead of char* for original editor strings
1 year ago
Patric Stout
60399e17bd
Codechange: C++-ify the Layouter and related functions
...
They all now access a std::string_view, instead of a "const char *"
or std::string (in some cases).
Additionally, GetCharAtPosition and friends now return an index
instead of a "const char *", as it makes for a more clear interface.
1 year ago
Peter Nelson
61407840c6
Codechange: Remove STR_BLACK_RAW_STRING.
1 year ago
Peter Nelson
0880616851
Codechange: Remove various STRING strings.
1 year ago
Peter Nelson
5e185d5328
Codechange: Draw tooltip text in black.
1 year ago
PeterN
003bab3c8a
Change: Size space for editbox clear button by interface scale. ( #10749 )
1 year ago
Rubidium
7b539fa7c9
Fix: fmt's {:#04X} yields '0X00', not '0x0000'
...
Technically the 0X vs 0x is not a big problem, just not pretty. However, the
length also including the 0x results in unexpected behaviour, so it probably
better to not use it.
1 year ago
Patric Stout
1ba4dcc924
Codechange: migrate all Window-related timers to the new framework
...
This means we also say goodbye to GUITimers.
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.
1 year ago
PeterN
73474b08fe
Fix: Clicking on editbox clear button didn't take account of padding. ( #10583 )
1 year ago
Tyler Trahan
066ae6f3fb
Codechange: Simplify some CodeQL-flagged trivial switches
1 year ago
Rubidium
580d0a6343
Codechange: make use of Tile in for all direct map accesses
1 year ago
Rubidium
f001e84e5e
Codechange: use RAII to automatically restore _cur_dpi after use
1 year ago
Rubidium
bcfe0fb076
Codechange: introduce GetMainWindow() to properly account for nullptr checks
...
Some nullptr checks have been removed as they were not triggered with nullptr
with the null video driver and in dedicated server mode.
1 year ago
PeterN
23eec0b7b3
Fix #8971 : Resize QueryStrings with interface scale change. ( #10281 )
...
* Fix: Use width of caret symbol '_' for text entry.
This replaces an arbitrary pixel width with the space actually required.
* Fix #8971 : Update QueryString sizes with interface scale change.
2 years ago
PeterN
485368f607
Fix: Missing extra padding when drawing tooltip text. ( #10201 )
...
* Fix: Missing extra padding when drawing tooltip text.
This padding is included when calculating the size of the tooltips, the
difference caused a mismatch in height for some tooltips.
* Codechange: Don't draw grey panel underneath tooltip.
This removes the default framerect padding so it is now added explicitly.
SetMinimalSize is also removed as this is overridden in UpdateWidgetSize
anyway.
2 years ago
Tyler Trahan
b846c574d7
Update: Developer credits ( #10190 )
2 years ago
Peter Nelson
dff03124e5
Change: Use modalpopup padding for error/query windows.
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
cb059fc081
Change: Use Rect for QueryString editor.
2 years ago