Peter Nelson and GitHub
c18a1494b7
Codechange: Remove FONT_HEIGHT_... macros. ( #11481 )
...
These make it look like we're dealing with a constant, but actually each is a call to `GetCharacterHeight(...)`.
2023-11-21 19:04:24 +00:00
Peter Nelson and GitHub
0578b8eaa9
Change: Use picker-spacing for scenario found town window. ( #11478 )
2023-11-20 23:06:15 +00:00
Peter Nelson and Peter Nelson
18fb8e153f
Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
...
This is to allow unit-tests to produce more useful output.
2023-11-02 22:25:01 +00:00
Rubidium and rubidium42
c9276c2959
Codechange: replace x.size() == 0 with x.empty()
2023-10-20 23:05:43 +02:00
Tyler Trahan and GitHub
088db62dba
Change: Always allow expanding towns in Scenario Editor to build new roads ( #11377 )
2023-10-19 17:01:45 -04:00
Peter Nelson and 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.
2023-10-13 20:47:28 +01:00
frosch and frosch
b6c8f301be
Codechange: Silence warnings about intentionally unused parameters.
2023-09-19 22:49:59 +02:00
Rubidium and rubidium42
8ab0936491
Codechange: use parameter pack/folding instead of va_arg macros for widget states
2023-09-16 23:09:53 +02:00
Tyler Trahan
fca2b37726
Codechange: Move Ticks into their own class
2023-09-10 08:40:25 -04:00
Peter Nelson and PeterN
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.
2023-09-04 10:20:45 +01:00
Rubidium and rubidium42
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
2023-07-19 19:30:14 +02:00
Rubidium and rubidium42
74924c8186
Codechange: includes must be before 'safeguards.h'
2023-06-18 21:22:14 +02:00
Rubidium and rubidium42
2dd2b698d2
Codechange: convert C-style GetTownName API to std::string returning API
2023-06-05 17:07:39 +02:00
Patric Stout and GitHub
772729cc7d
Fix: when syncing width of GUI items, take padding into account ( #10915 )
2023-06-05 10:27:04 +02:00
Peter Nelson and PeterN
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.
2023-05-12 21:45:32 +01:00
Peter Nelson and PeterN
d2034d9c38
Codechange: Scrollbar methods now accept size_t.
...
This clears up a lot of casts from size_t to int.
2023-05-07 20:25:44 +01:00
Rubidium and rubidium42
c829930440
Codechange: replace strnatcmp with C++ string capable version
2023-04-29 12:07:45 +02:00
Jonathan G Rennison and PeterN
684c7bbc93
Fix: Violation of strict weak ordering in TownRatingSorter
...
If two unrated town names compare equal in TownNameSorter
2023-04-23 12:52:12 +01:00
Patric Stout and Patric Stout
3ebc7ad16e
Codechange: migrate all game-time-related timers to the new framework
2023-04-15 13:58:55 +02:00
Patric Stout and Patric Stout
1ba4dcc924
Codechange: migrate all Window-related timers to the new framework
...
This means we also say goodbye to GUITimers.
2023-04-15 13:58:55 +02:00
glx22 and Loïc Guilloux
3278f4c7bb
Fix #10280 , 59645c6: Ignore double-click for unavailable town actions
2023-02-10 19:39:21 +01:00
glx22 and Loïc Guilloux
d6aa526b69
Fix #10461 , 59645c6: Properly check for _local_company validity
2023-02-10 19:39:21 +01:00
Rubidium and rubidium42
3373128233
Codechange: pass the randomizer directly to the town name generation
2023-01-14 22:00:11 +01:00
PeterN and GitHub
9e56e16147
Fix: Local authority window rating list height ignored icon sizes. ( #10285 )
...
Only font height was taken into account, so the list was broken if icon
sizes were taller than font height.
2022-12-26 18:26:01 +00:00
Didac Perez Parera and GitHub
35d55bd534
Feature: Expand all towns in the scenario editor ( #10215 )
2022-12-25 19:42:50 +01:00
Peter Nelson and PeterN
890b2666d3
Change: Use scaled WidgetDimensions.
2022-11-12 18:28:39 +00:00
Peter Nelson and PeterN
6f95e04005
Change: Use Rect helpers for widget drawing.
...
This replaces repetitive and sometimes unwieldy use of constants.
2022-11-12 18:28:39 +00:00
Joel-Milligan and GitHub
59645c6733
Change: Remove scrollbar from town authority actions panel ( #9928 )
2022-11-11 23:52:38 +01:00
Bouke Haarsma and Michael Lutz
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.
2022-10-18 22:03:21 +02:00
Michael Lutz
2e39637db2
Codechange: Don't use a global for the 'not enough cash' message.
2021-12-16 22:28:32 +01:00
Michael Lutz
57b82e2e99
Codechange: Don't use globals for story/goal/sign/group command proc return values.
2021-12-16 22:28:32 +01:00
Michael Lutz
8503854655
Codechange: Pass unpacked command arguments to command callbacks (except Script).
2021-12-16 22:28:32 +01:00
Michael Lutz
1a42a8a5d5
Codechange: Un-bitstuff town-related commands.
2021-12-16 22:28:32 +01:00
Michael Lutz
eab18f06a4
Codechange: Pass additional data as byte stream to command callbacks.
2021-12-16 22:28:32 +01:00
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.
2021-12-16 22:28:32 +01:00
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.
2021-12-16 22:28:32 +01:00
Michael Lutz
4fc055d6e9
Codechange: Align parameter order of command callbacks to command handlers.
2021-12-16 22:28:32 +01:00
Michael Lutz
a38bbefe1b
Codechange: Untangle command code, flags and error string for DoCommand*.
2021-12-16 22:28:32 +01:00
Michael Lutz
549caca39c
Codechange: Move command arguments to the back of the networked command function calls.
2021-12-16 22:28:32 +01:00
Loïc Guilloux and GitHub
ddb6024bc6
Codechange: Don't explicitly unset _generating_world outside of genworld.cpp ( #9418 )
2021-07-10 14:59:17 +02:00
glx22 and Loïc Guilloux
89ab8b79a5
Codechange: Remove FOR_EACH_SET_BIT
2021-07-09 21:36:09 +02:00
Loïc Guilloux and GitHub
87eb0e4fce
Fix #9402 , 2e136285: Crash when founding town using default name ( #9403 )
2021-06-27 17:18:21 +02:00
glx22 and Loïc Guilloux
994bf19aef
Fix f6d5c01: Delay deletion when closing windows
2021-05-29 21:08:25 +02:00
PeterN and GitHub
330a305c99
Fix: Apply unscaled padding to Viewport inside WWT_INSET. ( #9219 )
...
Since pixel dimensions in SetPadding() are scaled by GUI size, padding for inset viewports was excessive.
Instead, automatically apply padding for WWT_INSET at widget level. This applies to all widgets inside a WWT_INSET, which in all instances is a NWID_VIEWPORT.
2021-05-08 21:01:16 +01:00
rubidium42 and rubidium42
6bca9e090d
Codechange: add SetDParamStr that accepts std::string&
2021-05-06 21:45:36 +02:00
rubidium42 and rubidium42
0345f99180
Feature: make the town directory horizontally resizable
2021-05-01 13:30:27 +02:00
Peter Nelson and PeterN
4f93dd95e4
Cleanup: Tidy up resize, fill and minimal size on widgets in town list window.
2021-04-30 17:08:15 +01:00
frosch and GitHub
d9b4413bc9
Codechange: rename sound ids to make more sense. ( #8701 )
2021-02-20 19:01:04 +01:00
frosch and frosch
5bfcd742b8
Change: Relocate rename and location buttons in all windows.
2021-01-11 22:15:58 +01:00
Charles Pigott and GitHub
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants ( #8502 )
2021-01-08 11:16:18 +01:00