Jordan Woyak
cdabd651aa
InputCommon/ExpressionParser: Add compound assignment operators.
2025-02-02 14:37:11 -06:00
Admiral H. Curtiss
9ff833e2f4
Merge pull request #13315 from jordan-woyak/func-exp-cleanup
...
InputCommon/ExpressionParser: Function argument parsing minor cleanup.
2025-02-02 17:23:13 +01:00
Admiral H. Curtiss
04775b6ef8
Merge pull request #13314 from jordan-woyak/input-expressions-assignment-op-fix
...
InputCommon: Fix input expression assignment operator behavior.
2025-02-02 17:22:25 +01:00
JMC47
8291cff46d
Merge pull request #13280 from jordan-woyak/input-expressions-highlighting
...
InputCommon/DolphinQt: Fix sometimes broken syntax highlighting in IOWindow.
2025-02-02 02:01:34 -05:00
Jordan Woyak
67b8100cd2
InputCommon/ExpressionParser: Make ValidateArguments access existing
...
members instead of passing arguments.
2025-01-28 20:15:45 -06:00
Jordan Woyak
e4b464e727
InputCommon/ExpressionParser: Make function argument parsing error
...
message more clear.
2025-01-28 20:13:06 -06:00
Jordan Woyak
c9ad5430d0
InputCommon: Fix input expression assignment operator behavior.
2025-01-28 14:32:39 -06:00
JMC47
e18a4d04b4
Merge pull request #13178 from jordan-woyak/input-expressions-conditional-op
...
InputCommon: Add ternary conditional operator to input expressions.
2025-01-27 21:16:29 -05:00
Jordan Woyak
78bb30d44c
InputCommon/ExpressionParser: Require delimited tokens actually have their terminating delimiter.
2025-01-19 17:20:07 -06:00
Jordan Woyak
a618854413
ExpressionParser: Remove RemoveInertTokens.
2025-01-17 02:31:33 -06:00
Jordan Woyak
c94ec85460
InputCommon: Make input expression multiline-comment tokenizing less hacky.
2025-01-17 02:29:23 -06:00
mitaclaw
2b0cd16c8c
Modernize std::none_of
with ranges
...
In JitRegCache.cpp, the lambda predicate were replaced by a pointer to member function because ranges algorithms are able to invoke those.
In ConvertDialog.cpp, the `std::mem_fn` helper was removed because ranges algorithms are able to handle pointers to member functions as predicates.
In BoundingBox.cpp, the lambda predicate was returning the bool element unchanged, so `std::identity` was a better fit.
2024-12-15 19:54:17 -08:00
mitaclaw
860e6cf5cb
Modernize std::all_of
with ranges
...
In DITSpecification.cpp, MaterialAsset.cpp, and ShaderAsset.cpp, lambda predicates were replaced by pointers to member functions because ranges algorithms are able invoke those.
In NetPlayClient.cpp, the non-trivial `NetPlay::Player` elements were being passed by value in `NetPlayClient::DoAllPlayersHaveGame()`. This has been fixed.
In WIABlob.cpp, the second example's predicate was returning the `std::optional` by value instead of implicitly converting it to a bool. This has been fixed.
2024-12-15 19:50:34 -08:00
Jordan Woyak
5078a63084
InputCommon: Add ternary conditional operator to input expressions.
2024-11-07 08:31:25 -06:00
Dr. Dystopia
9602f36248
Remove redundant semicolons
2024-08-20 14:59:54 +02:00
JosJuice
defc38b258
InputCommon: Translate ExpressionParser error messages
...
The _trans macro marks strings for translation but doesn't do anything
at runtime. For that, we need to use a function like GetStringT.
2024-07-28 12:09:15 +02:00
Jordan Woyak
e9fe0d3d5b
NumericSetting: Stop values from binding to numbered input names.
2024-04-12 15:54:18 -05:00
Jordan Woyak
5039072ae9
ExpressionParser: Support unary plus operator.
2024-04-12 15:52:35 -05:00
Tilka
8cbb2c2e44
Merge pull request #12399 from lioncash/erasing
...
General: Make use of std::erase_if/std::erase where applicable
2023-12-12 20:54:52 +00:00
Lioncash
ded2d55438
ExpressionParser: Avoid some miscellaneous copies
...
Just some trivial copies that can be eliminated or turned into moves.
2023-12-12 14:03:41 -05:00
Lioncash
a5bbeb721a
ExpressionParser: Mark constructors explicit where applicable
...
Makes for consistency with the surrounding code.
2023-12-12 14:00:27 -05:00
Lioncash
ea71a76ea9
ExpressionParser: Pass control qualifiers by const reference
...
These aren't necessarily cheap to copy, since a control qualifier will
have around 3 std::strings inside of it, so passing by value can churn
allocations a little bit.
2023-12-12 13:50:46 -05:00
Lioncash
9aea481e59
ExpressionParser: Make use of std::erase_if
2023-12-12 13:31:58 -05:00
get
1df482d51f
Prefer static const std::regex
...
std::regex has a relatively expensive constructor, and these are unchanging regexes.
2023-06-08 09:39:23 -05:00
Pokechu22
f1f3fd5d9d
InputCommon: Fix memory leak in ExpressionParser
...
We allocate in MakeSuppressor via `return unique_ptr(std::make_unique<...>(...).release(), InvokingDeleter{}`, so it wasn't properly getting freed.
2023-02-17 18:29:36 -08:00
Jordan Woyak
f5b9049421
Input: Add "abs" input expression function.
2022-10-11 19:28:21 -05:00
Shawn Hoffman
f92541fbd9
StripSpaces: only strip spaces
...
StripWhitespace maintains old behavior
2022-07-25 18:40:12 -07:00
Pokechu22
78bfd25964
Fix all uninitialized variable warnings (C26495)
2021-10-13 12:32:16 -07:00
Pierre Bourdon
e149ad4f0a
treewide: convert GPLv2+ license info to SPDX tags
...
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
Filoppi
93e3e691f9
Expose Control Expression variables to mappings UI
...
-add a way to reset their value (from the mappings UI)
-fix "memory leak" where they would never be cleaned,
one would be created every time you wrote a character after a "$"
-fix ability to create variables with an empty string by just writing "$" (+added error for it)
-Add $ operator to the UI operators list, to expose this functionality even more
2021-05-24 02:38:06 +03:00
Filoppi
5f74d0e08f
InputCommon: follow coding conventions
2021-05-12 18:27:24 +03:00
Filoppi
f4fec42165
Add mixed comments to input code, make some tooltip clearer
2021-05-12 18:27:23 +03:00
Jordan Woyak
1daefeb20a
Merge pull request #9674 from Filoppi/fix_hotkey_suppresion_crash
...
Fix hotkey suppression crash
2021-04-28 18:21:07 -05:00
Filoppi
799a368a7c
InputCommon: small hotkey threshold symmetry fix
2021-04-26 19:45:13 +03:00
Filoppi
ba2782e9d1
InputCommon: fix hotkey suppression crash if nullptr suppressions were added to the map
...
Update references was failing to update the references, causing input to stay nullptr and crashing.
I fixed the case that triggered that, though also added checks against nullptrs for safety.
(cherry picked from commit 4bdcf707555a5568eddff957fa3604975ffb6ed7)
2021-04-26 19:44:04 +03:00
Pokechu22
004dfd1586
Replace uses of cassert with Common/Assert.h
2021-04-02 10:18:18 -07:00
Shawn Hoffman
7e1df34735
rename InputCommon/ControllerInterface/Device to CoreDevice
2021-01-27 14:29:48 -08:00
Admiral H. Curtiss
cae741584b
InputCommon: Return error, if any, from ControlReference::SetExpression().
2020-11-08 01:04:33 +01:00
Lioncash
faf509e315
ExpressionParser: Add missing <functional> include
...
Unbreaks Windows CMake builds.
2020-10-20 16:18:32 -04:00
Jordan Woyak
431eb4d60d
ExpressionParser: Improve hotkey suppression logic. Allow activation with simultaneous press of modifier and final input.
2020-09-25 22:51:33 -05:00
Jordan Woyak
44927da420
ExpressionParser: Replace ScopeGuard with custom deleter unique_ptr.
2020-09-25 22:51:33 -05:00
Jordan Woyak
d8ad8c3861
InputCommon: Make hotkeys and input detection aware of Ctrl -> L_Ctrl / R_Ctrl hierarchy.
2020-09-25 20:29:18 -05:00
Jordan Woyak
aae913fbc6
InputCommon: Clean up modifier ignoring logic.
2020-09-25 20:29:18 -05:00
Jordan Woyak
d2729df281
ExpressionParser: Allow duplicate and superset modifier hotkeys to function.
2020-09-25 20:29:18 -05:00
Jordan Woyak
e6ba495486
ExpressionParser: Suppress inputs when hotkey modifiers are pressed.
2020-09-25 20:29:18 -05:00
Jordan Woyak
52547379c9
ExpressionParser: Add Hotkey syntax.
2020-09-25 20:29:18 -05:00
Admiral H. Curtiss
2281cde28b
InputCommon: Add a handful of math functions to the expression parser.
2020-08-02 22:09:09 +02:00
Jun Su
b6ff15c130
Cleanup warnings of -Wmissing-declarations
...
Add static to the functions which is not intentionally
export to big scope.
2020-03-24 20:16:10 +08:00
Jordan Woyak
f07457b6cc
InputCommon: Eliminate some duplicated button threshold logic.
2020-02-09 10:37:18 -06:00
Jordan Woyak
e8152b700f
InputCommon: Allow controller settings specified with input expresions.
2020-02-08 14:01:55 -06:00