-
Notifications
You must be signed in to change notification settings - Fork 331
CHANGE: Adding or removing device no longer temp-disables actions (case 1379932). #1500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b14e8d7
445736e
f33678e
3388471
0c6317c
9b62c65
0f3a511
4dd36f5
1fa8b34
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -389,7 +389,7 @@ public InputBinding? bindingMask | |
|
|
||
| var map = GetOrCreateActionMap(); | ||
| if (map.m_State != null) | ||
| map.LazyResolveBindings(); | ||
| map.LazyResolveBindings(fullResolve: true); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -1095,6 +1095,22 @@ public unsafe bool IsPressed() | |
| return false; | ||
| } | ||
|
|
||
| /// <summary> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this method really necessary when the inProgress property exists?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Absolutely not. Me being confused. Will remove. |
||
| /// Whether the action has been <see cref="InputActionPhase.Started"/> or <see cref="InputActionPhase.Performed"/>. | ||
| /// </summary> | ||
| /// <returns>True if the action is currently triggering.</returns> | ||
| /// <seealso cref="phase"/> | ||
| public unsafe bool IsInProgress() | ||
| { | ||
| var state = GetOrCreateActionMap().m_State; | ||
| if (state != null) | ||
| { | ||
| var actionStatePtr = &state.actionStates[m_ActionIndexInState]; | ||
| return actionStatePtr->phase.IsInProgress(); | ||
| } | ||
| return false; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Returns true if the action's value crossed the press threshold (see <see cref="InputSettings.defaultButtonPressPoint"/>) | ||
| /// at any point in the frame. | ||
|
|
@@ -1479,8 +1495,8 @@ private InputActionState.TriggerState currentState | |
| { | ||
| if (m_ActionIndexInState == InputActionState.kInvalidIndex) | ||
| return new InputActionState.TriggerState(); | ||
| Debug.Assert(m_ActionMap != null); | ||
| Debug.Assert(m_ActionMap.m_State != null); | ||
| Debug.Assert(m_ActionMap != null, "Action must have associated action map"); | ||
| Debug.Assert(m_ActionMap.m_State != null, "Action map must have state at this point"); | ||
| return m_ActionMap.m_State.FetchActionState(this); | ||
| } | ||
| } | ||
|
|
@@ -1514,6 +1530,40 @@ private void CreateInternalActionMapForSingletonAction() | |
| }; | ||
| } | ||
|
|
||
| internal void RequestInitialStateCheckOnEnabledAction() | ||
| { | ||
| Debug.Assert(enabled, "This should only be called on actions that are enabled"); | ||
|
|
||
| var map = GetOrCreateActionMap(); | ||
| var state = map.m_State; | ||
| state.SetInitialStateCheckPending(m_ActionIndexInState); | ||
| } | ||
|
|
||
| // NOTE: This does *NOT* check whether the control is valid according to the binding it | ||
| // resolved from and/or the current binding mask. If, for example, the binding is | ||
| // "<Keyboard>/#(ä)" and the keyboard switches from a DE layout to a US layout, the | ||
| // key would still be considered valid even if the path in the binding would actually | ||
| // no longer resolve to it. | ||
| internal bool ActiveControlIsValid(InputControl control) | ||
| { | ||
| if (control == null) | ||
| return false; | ||
|
|
||
| // Device must still be added. | ||
| var device = control.device; | ||
| if (!device.added) | ||
| return false; | ||
|
|
||
| // If we have a device list in the map or asset, device | ||
| // must be in list. | ||
| var map = GetOrCreateActionMap(); | ||
| var deviceList = map.devices; | ||
| if (deviceList != null && !deviceList.Value.ContainsReference(device)) | ||
| return false; | ||
|
|
||
| return true; | ||
| } | ||
|
|
||
| internal InputBinding? FindEffectiveBindingMask() | ||
| { | ||
| if (m_BindingMask.HasValue) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed these changes in my initial commit.