Use MainViewport when input is not provided a viewport (#3897)
This commit is contained in:
@@ -165,5 +165,13 @@ namespace Content.Client.State
|
|||||||
|
|
||||||
Viewport.Viewport.Eye = _eyeManager.CurrentEye;
|
Viewport.Viewport.Eye = _eyeManager.CurrentEye;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnKeyBindStateChanged(ViewportBoundKeyEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.Viewport == null)
|
||||||
|
base.OnKeyBindStateChanged(new ViewportBoundKeyEventArgs(args.KeyEventArgs, Viewport.Viewport));
|
||||||
|
else
|
||||||
|
base.OnKeyBindStateChanged(args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ namespace Content.Client.State
|
|||||||
/// Converts a state change event from outside the simulation to inside the simulation.
|
/// Converts a state change event from outside the simulation to inside the simulation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="args">Event data values for a bound key state change.</param>
|
/// <param name="args">Event data values for a bound key state change.</param>
|
||||||
private void OnKeyBindStateChanged(ViewportBoundKeyEventArgs args)
|
protected virtual void OnKeyBindStateChanged(ViewportBoundKeyEventArgs args)
|
||||||
{
|
{
|
||||||
// If there is no InputSystem, then there is nothing to forward to, and nothing to do here.
|
// If there is no InputSystem, then there is nothing to forward to, and nothing to do here.
|
||||||
if(!EntitySystemManager.TryGetEntitySystem(out InputSystem? inputSys))
|
if(!EntitySystemManager.TryGetEntitySystem(out InputSystem? inputSys))
|
||||||
|
|||||||
Reference in New Issue
Block a user