Steve Goldman
72276e2d3c
Add: Vehicle window zoom with mouse wheel
3 months ago
Steve Goldman
c53ed9fad6
Codechange: Creating enum for 'scrollwheel_scrolling' setting
3 months ago
Peter Nelson
55314513ce
Codechange: Pass NWidgetParts as span instead of begin/end pointers. ( #12779 )
3 months ago
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.
3 months ago
Peter Nelson
a866166673
Codechange: Use initializer_list and range-for for OpenTTD title. ( #12430 )
...
Replaces C-style array and looping.
6 months ago
Patric Stout
a3cfd23cf9
Codechange: rename byte to uint8_t ( #12308 )
6 months ago
Rubidium
86cb184eb4
Codechange: use std::source_location over __FILE__ and __LINE__ for WindowDesc
7 months ago
Peter Nelson
86be6d7e0b
Codechange: Off-by-one in colour gradient initialisation.
...
Remap sprites start with a count byte followed by 256 entries, but
SetupColoursAndInitialWindow did not take account of this extra byte and
therefore started at palette index 0xC5 instead of 0xC6. This caused the
first colour of each gradient to be incorrect and all shades were actually
1 step lower in the gradient than indicated.
7 months ago
Peter Nelson
ae3390fe48
Codechange: Add ColourShade enum.
7 months ago
Peter Nelson
0463d4c198
Codechange: Remove direct access to _colour_gradient.
...
Access is now through GetColourGradient, which ensures parameters are in range.
7 months ago
Peter Nelson
c0ab436077
Codechange: Store Colours in Colours type. ( #11625 )
...
This reduces casts, some magic numbers, and introduces a bit of type-safety.
8 months ago
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.
8 months ago
Peter Nelson
7eecd7512f
Codechange: Remove redundant struct keyword.
8 months ago
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.
9 months ago
Peter Nelson
18fb8e153f
Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
...
This is to allow unit-tests to produce more useful output.
11 months ago
Peter Nelson
c0aa9a5f87
Add: Debug tool to draw widget outlines. ( #11401 )
...
This is considered a developer tool and is controlled from the help menu (or default hotkey Ctrl-O).
This draws a white dashed outline around widgets. NWidgetSpacer and (unused) WWT_EMPTY widgets are also filled with check pattern to highlight them, as they usually indicate a design issue.
11 months ago
frosch
b6c8f301be
Codechange: Silence warnings about intentionally unused parameters.
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
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
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
e97bf271dc
Codechange: Make SpriteType, CargoSortType, SourceType and ScriptType enum classes. ( #10663 )
...
This avoids a (soft) namespace conflict between the four ST_* enums.
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
c1077212d7
Codechange: Use a shared_ptr for viewport overlay. ( #10586 )
2 years ago
merni-ns
2d0c1ffdb7
Change #10255 : Reduce basic thickness of linkgraph GUI lines ( #10410 )
...
From 3px to 2px (multiplied by UI scale).
2 years 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.
2 years ago
Nicolas Chappe
864771ca09
Feature: [Linkgraph] Show a tooltip with statistics when hovering a link
2 years ago
Bouke Haarsma
93d2d4590f
Fix #9995 : Adjust viewport zoom level for HiDPI displays
...
On HiDPI screens the zoom level is increased for detailed rendering. This causes hard-coded zoom levels to be off by this adjustment. To fix these default zoom levels, we scale the zoom level based on `_gui_zoom` to get the scaled zoom level.
2 years ago
Bouke Haarsma
18c210b013
Fix: title positioning on HiDPI displays
2 years ago
Michael Lutz
8503854655
Codechange: Pass unpacked command arguments to command callbacks (except Script).
3 years ago
Michael Lutz
13528bfcd0
Codechange: Un-bitstuff all remaining commands.
3 years ago
Michael Lutz
eab18f06a4
Codechange: Pass additional data as byte stream to command callbacks.
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
4fc055d6e9
Codechange: Align parameter order of command callbacks to command handlers.
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
Loïc Guilloux
bc1b84cbbb
Fix #9630 : intro game could zoom in/out more than allowed by settings ( #9633 )
...
Also fixes #9622
3 years ago
Niels Martin Hansen
6bd3106681
Feature: Multiple rotating views on title screen
3 years ago
Rubidium
f904aef176
Cleanup: use nullptr instead of 0 or NULL
3 years ago
glx22
5799402f7a
Codechange: Rename window related DeleteXXX to match new behaviour
3 years ago
glx22
6b8ad5a9b1
Change: Apply some consistency to singleplayer related comments
4 years ago
Patric Stout
62cdadb582
Change: move "give money" from client-list to company window
...
This is a much better location for this button, as you send
money from one company to another company, not from player
to player.
This is based on work done by JGRPP in:
f820543391
and surrounding commits, which took the work from estys:
https://www.tt-forums.net/viewtopic.php?p=1183311#p1183311
We did modify it to fix several bugs and clean up the code while
here anyway.
The callback was removed, as it meant a modified client could
prevent anyone from seeing money was transfered. The message
is now generated in the command itself, making that impossible.
4 years ago
Patric Stout
f2fa2a14d7
Fix: allow input of numbers greater than INT32_MAX for GiveMoney ( #8499 )
...
Based on patch by JGR.
4 years ago
dP
0110fa12da
Feature: Make news and errors close hotkeys configurable
4 years ago
TechGeekNZ
a10013dd00
Codechange: Spell 'Viewport' consistently
...
Some places in the codebase misspell 'Viewport' as 'ViewPort' or 'view_port'.
This patch makes everything consistent.
4 years ago
S. D. Cloudt
13cc8a0cee
Cleanup: Removed SVN headers
5 years ago
glx22
b3fd787959
Fix #7188 : check the validity of command callback for scripts ( #7701 )
5 years ago
Niels Martin Hansen
37daf43037
Change: Zoom title game by UI zoom level
5 years ago
Henry Wilson
7c8e7c6b6e
Codechange: Use null pointer literal instead of the NULL macro
6 years ago
peter1138
317f69c152
Codechange: Use override specifier in Window-derived classes.
6 years ago