frosch and frosch
b1718478c8
Codechange: Replace old non-standard attributes with C++17/20 standard attributes.
2024-02-02 22:29:28 +01:00
Peter Nelson and 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.
2024-01-16 21:57:05 +00:00
Peter Nelson and 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.
2023-12-30 00:23:57 +00:00
Peter Nelson and Peter Nelson
dcf730f1f6
Codechange: Optionally allow passing state to GUIList sorter function.
...
GUIList sorter functions can currently only use global state, which makes per-window-instance sorting difficult.
2023-12-04 08:24:39 +00:00
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
ef385499c7
Codechange: Remove ineffective NWidgetParts. ( #11443 )
2023-11-05 14:09:47 +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
frosch and frosch
b6c8f301be
Codechange: Silence warnings about intentionally unused parameters.
2023-09-19 22:49:59 +02: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
glx22 and Loïc Guilloux
46b504a700
Fix: ini_key issues reported by the script
2023-07-14 14:32:46 +02:00
Rubidium and rubidium42
d4c2043294
Codechange: remove a number of unneeded c_str() calls
2023-06-15 22:14:45 +02:00
PeterN and GitHub
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.
2023-06-05 18:12:30 +01: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
Peter Nelson and PeterN
0880616851
Codechange: Remove various STRING strings.
2023-05-05 07:07:54 +01:00
Rubidium and rubidium42
c829930440
Codechange: replace strnatcmp with C++ string capable version
2023-04-29 12:07:45 +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
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
Michael Lutz
58cff7b081
Codechange: Un-bitstuff the remaining on-map commands.
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
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
Tyler Trahan and GitHub
802ca4e722
Fix: Don't try to rename OWNER_DEITY signs in-game ( #9716 )
2021-11-28 15:16:42 +01:00
rubidium42 and rubidium42
55a11710a6
Codechange: convert printf DEBUG statements to fmt Debug statements
2021-06-13 12:45:45 +02:00
Vít Šefl and GitHub
f899772ec2
Fix 2e136285: Crash when CTRL-clicking on a sign ( #9345 )
2021-06-10 15:49:25 +02:00
glx22 and Loïc Guilloux
5799402f7a
Codechange: Rename window related DeleteXXX to match new behaviour
2021-05-29 21:08:25 +02:00
glx22 and Loïc Guilloux
994bf19aef
Fix f6d5c01: Delay deletion when closing windows
2021-05-29 21:08:25 +02:00
Peter Nelson and PeterN
957beaaefc
Fix: Improved scaling and spacing of sign list window.
...
Both company icon sprite and text now centred within each row, and extra
padding added to avoid the sprites running into each other.
2021-04-30 17:08:15 +01:00
Tyler Trahan and GitHub
de891238d6
Change: Recolour graph windows to brown ( #8700 )
2021-03-11 15:30:29 +01:00
frosch and frosch
1432dbac53
Add: another go-to-location button to the sign window.
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
Michael Lutz
63ccb36ef3
Codechange: Use std::string for most of the user-settable custom names.
2020-05-21 20:02:34 +02:00
glx and Niels Martin Hansen
869581eb23
Codechange: Replace FOR_ALL_SIGNS with range-based for loops
2019-12-21 20:13:03 +01:00
S. D. Cloudt and Charles Pigott
13cc8a0cee
Cleanup: Removed SVN headers
2019-11-10 17:59:20 +00:00
glx and PeterN
2db88953e7
Codechange: use std::sort() in GUIList
2019-04-13 12:49:18 +01:00
Henry Wilson and Michael Lutz
7c8e7c6b6e
Codechange: Use null pointer literal instead of the NULL macro
2019-04-10 23:22:20 +02:00
glx22 and GitHub
66dd7c3879
Fix: MSVC warnings ( #7423 )
2019-03-28 00:09:33 +01:00
Henry Wilson and PeterN
a0f36a50e6
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
2019-03-26 20:15:57 +00:00
Henry Wilson and PeterN
a690936ed7
Codechange: Replace SmallVector::Length() with std::vector::size()
2019-03-26 20:15:57 +00:00
Henry Wilson and PeterN
9cba6f7193
Codechange: Replaced SmallVector::Compact() with std::vector::shrink_to_fit()
2019-03-26 20:15:57 +00:00
Henry Wilson and PeterN
bfd79e59dc
Codechange: Replace SmallVector::Clear() with std::vector::clear()
2019-03-26 20:15:57 +00:00
peter1138 and Michael Lutz
317f69c152
Codechange: Use override specifier in Window-derived classes.
2019-03-24 16:10:04 +01:00
PeterN and GitHub
cbaf52fbe1
Codechange: Sort and filter sign names directly rather than through string system. ( #7304 )
...
This provides a notable performance benefit in the Sign List window when there are many signs.
2019-03-02 17:08:45 +00:00
frosch
b4b98e5165
(svn r27893) -Codechange: Use fallthrough attribute. (LordAro)
2017-08-13 18:38:42 +00:00
michi_cc
2b8bb12d62
(svn r27381) -Fix: Warnings due to C++11 requirements for explicit narrowing conversions in initializer lists.
2015-08-10 20:24:13 +00:00
frosch
01dae23dc7
(svn r26827) -Change [FS#6116]: The ok-button in the OSK for the signs list should just close the OSK.
2014-09-15 19:26:03 +00:00
rubidium
0463dbdc9e
(svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values
2014-04-23 20:13:33 +00:00
frosch
2b8e66e3e3
(svn r25918) -Fix: Center the edit sign window like all query windows. (Juanjo)
2013-10-28 10:05:00 +00:00