Fixes remapping continuous inputs

This commit is contained in:
Riley Testut 2022-10-19 17:14:22 -05:00
parent 7d93470738
commit d17a1f3d8f

View File

@ -573,13 +573,19 @@ extension ControllerInputsViewController: GameControllerReceiver
{ {
func gameController(_ gameController: GameController, didActivate controllerInput: DeltaCore.Input, value: Double) func gameController(_ gameController: GameController, didActivate controllerInput: DeltaCore.Input, value: Double)
{ {
guard self.isViewLoaded else { return } guard self.isViewLoaded, value > 0.9 else { return }
switch gameController switch gameController
{ {
case self.gameViewController.controllerView: case self.gameViewController.controllerView:
if let calloutView = self.calloutViews[AnyInput(controllerInput)] if let calloutView = self.calloutViews[AnyInput(controllerInput)]
{ {
if controllerInput.isContinuous
{
// Make sure we only toggle calloutView once in a single gesture.
guard calloutView.state == .normal else { break }
}
self.toggle(calloutView) self.toggle(calloutView)
} }