Commit Graph

100 Commits

Author SHA1 Message Date
dP 8404c2a7cc Merge remote-tracking branch 'upstream/master' 2025-09-28 02:33:49 +05:00
dP df3a6e321f Merge remote-tracking branch 'upstream/master' 2025-05-14 18:41:13 +05:00
Rubidium 1f39d469ff Codechange: pass the characters to trim to StrTrimView 2025-05-03 15:57:53 +02:00
frosch b564fbb5e6 Codechange: Use StringConsumer to parse hotkeys. 2025-04-30 19:33:56 +02:00
dP a86fd7c621 Update to 15.0-beta1 2024-12-25 20:34:06 +05:00
Peter Nelson 3be0166801 Codechange: Use std::ranges::find where possible.
Replace `std::find(range.begin(), range.end(), ...)` with `std::ranges::find(range, ...)`.
2024-11-24 10:36:03 +00:00
Peter Nelson 1dc94d0670 Codechange: Construct string_view with first+last. (#12568)
Avoids needing to calculate size when we already have last.
2024-04-24 21:29:33 +01:00
Peter Nelson a28ab8cac2 Codechange: Replace C-style casts to size_t with static_cast. (#12455)
* Codechange: Replace C-style casts to size_t with static_cast.

This touches only simple value-type casts.

* Codechange: Replace static_cast<size_t>(-1) with SIZE_MAX

Co-authored-by: Rubidium <rubidium@openttd.org>
2024-04-19 20:34:36 +01:00
Peter Nelson a4c2f0778a Codechange: Use range-for to iterate keycode-to-name lookups. (#12429)
Replaces C-style looping.
2024-04-06 19:30:01 +01:00
dP 34e8262283 Send hotkey stats in survey 2024-03-19 03:15:13 +07:00
dP 645bfaffbd Merge remote-tracking branch 'upstream/master' 2024-02-04 22:50:08 +05:30
dP 33ef333b57 Update to 14.0-beta1 2024-02-04 02:18:17 +05:30
Peter Nelson 69e20e79ab Codechange: Add const versions of GetItem/GetGroup, and sprinkle liberally.
Non-const version of GetItem is not needed.
2023-10-20 18:37:27 +01:00
Peter Nelson 1fecbeff76 Codechange: Remove create parameter from IniLoadFile::GetGroup.
GetGroup now only returns nullptr if the group does not exist.
Use GetOrCreateGroup to create a group.

This avoids creating groups while reading ini files.
2023-10-20 18:37:27 +01:00
Peter Nelson 6ce7195ef1 Codechange: Split GetGroup into GetGroup/GetOrCreateGroup.
This follows the pattern used for GetItem/GetOrCreateItem, and allows use
of references where we know the group must exist.
2023-10-20 18:37:27 +01:00
Peter Nelson 0c85ce29ea Codechange: Pass ini file by reference and prefer automatic storage.
This avoids new/delete operations, and (not) checking for nullptr.
2023-10-20 18:37:27 +01:00
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
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
2023-07-19 19:30:14 +02:00
PeterN 64d6ad50f9 Codechange: Split GetItem with GetOrCreateItem. (#10952)
`IniGroup::GetItem()` returns nullptr if the item does not exist, but does not if the create parameter is set to true. Resolve CodeQL warnings with `GetOrCreateItem()` which returns a reference to the item instead.
2023-06-05 18:29:52 +00:00
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.
2023-06-05 18:12:30 +01:00
Rubidium 80d8c01814 Codechange: replace std::vector + duplicate preventing include with std::set 2023-05-20 16:53:10 +02:00
Rubidium 86e5dfce3d Codechange: use std::string instead of strecat to build hotkey strings 2023-05-12 22:02:59 +02:00
Rubidium ee8b1dfbc3 Fix 4dd5f994: hotkey parsing was broken 2023-04-29 14:56:41 +02:00
Rubidium 4dd5f994be Codechange: replace strncasecmp with case ignoring variant of StrStarts/EndsWith 2023-04-29 10:25:25 +02:00
dP 1a961a0600 Merge branch 'master' into 1.11 2021-03-18 00:21:09 +03:00
dP 0cde13b1ca Add hotkeys for other mouse buttons and video drivers 2021-01-27 18:58:51 +03:00
dP 363cfa7e8c Add hotkey to rotate depot while building, default to middle mouse button (SDL2 only for now) 2021-01-27 01:13:37 +03:00
dP c47930887b Merge remote-tracking branch 'upstream/1.11' into 1.11 2021-01-25 22:53:44 +03:00
dP 5e4506f493 Update to 1.11.0-beta1 2021-01-23 17:31:11 +03:00
Michael Lutz dd138fc460 Codechange: Stringify config file paths. 2020-12-27 13:19:25 +01:00
dP ab420d8cc0 Change: Use key names instead of characters in hotkey.cfg 2020-09-01 09:33:17 +01:00
dP 9ad0325962 Remove , as a hotkey option in favor of COMMA 2020-08-10 10:07:17 +03:00
dP e65bf2cd69 Allow to use TAB as a hotkey 2020-07-05 21:49:26 +03:00
dP 852eb93b08 Remove custom hotkey keycodes that were added to vanilla 2020-07-05 18:00:23 +03:00
Michael Lutz 715aa67a9c Codechange: Use std::string in INI file parsing. 2020-05-21 20:02:34 +02:00
dP 9b9a850d0b Merge 1.10.0-RC1 2020-02-18 20:56:38 +03:00
dP d4ae6a1d91 Update to 1.10.0-RC1 2020-02-18 18:13:33 +03:00
dP 1492a22027 Update to 1.10.0-beta2 2020-01-06 19:06:51 +03:00
dP c7c3966eec Update to 1.10.0-beta2 2020-01-06 18:49:34 +03:00
Konstantin Gribov 69f9529ba3 Add: Missing keycodes for hotkeys.cfg (#7850)
Added missing keycodes mapping to `_keycode_to_name` array
to allow their use in `hotkeys.cfg`.

Also reordered them according to `WindowKeyCodes` order.

Signed-off-by: Konstantin Gribov <grossws@gmail.com>
2019-12-27 08:32:34 +00:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
dP ceea4c88be Merge 1.10.0-beta1 2019-11-01 16:08:44 +03:00
dP 599ccf0c2b Update to 1.10.0-beta1 2019-10-31 22:24:28 +03:00
dP b84a475e14 Initialize with OpenTTD 1.9.3 2019-10-31 21:58:04 +03:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 2019-03-26 20:15:57 +00:00
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 2019-03-26 20:15:57 +00:00
Henry Wilson 297fd3dda3 Codechange: Replaced SmallVector::Include() with include() 2019-03-26 20:15:57 +00:00
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 2019-03-26 20:15:57 +00:00
Henry Wilson 5795f66d2e Codechange: Replaced SmallVector::Contains() with std::find() pattern 2019-03-26 20:15:57 +00:00