From 88b08d3dc361bed7feaf873f375be116ac8c0de5 Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 2 Nov 2020 00:39:28 -0500 Subject: [PATCH] shot in the dark 4.0 stuff --- source/Controls.hx | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/source/Controls.hx b/source/Controls.hx index 92b1fccb2..2ac71e0ae 100644 --- a/source/Controls.hx +++ b/source/Controls.hx @@ -278,7 +278,7 @@ class Controls extends FlxActionSet * @param func * @return ->Void) */ - function forEachBound(control:Control, func:FlxActionDigital -> Void, func:FlxInputState -> Void) + function forEachBound(control:Control, func:FlxActionDigital -> Void, func:FlxInputState -> Void) { switch (control) { @@ -383,7 +383,11 @@ class Controls extends FlxActionSet */ public function bindKeys(control:Control, keys:Array) { - inline forEachBound(control, (action, state) -> addKeys(action, keys, state)); + #if (haxe >= "4.0.0") + inline forEachBound(control, (action, state) -> addKeys(action, keys, state)); + #else + forEachBound(control, (action, state) -> addKeys(action, keys, state)); + #end } /** @@ -392,7 +396,11 @@ class Controls extends FlxActionSet */ public function unbindKeys(control:Control, keys:Array) { - inline forEachBound(control, (action, _) -> removeKeys(action, keys)); + #if (haxe >= "4.0.0") + inline forEachBound(control, (action, _) -> removeKeys(action, keys)); + #else + forEachBound(control, (action, _) -> removeKeys(action, keys)); + #end } inline static function addKeys(action:FlxActionDigital, keys:Array, state:FlxInputState) @@ -516,7 +524,11 @@ class Controls extends FlxActionSet */ public function bindButtons(control:Control, id, buttons) { - inline forEachBound(control, (action, state) -> addButtons(action, buttons, state, id)); + #if (haxe >= "4.0.0") + inline forEachBound(control, (action, state) -> addButtons(action, buttons, state, id)); + #else + forEachBound(control, (action, state) -> addButtons(action, buttons, state, id)); + #end } /** @@ -525,7 +537,11 @@ class Controls extends FlxActionSet */ public function unbindButtons(control:Control, gamepadID:Int, buttons) { - inline forEachBound(control, (action, _) -> removeButtons(action, gamepadID, buttons)); + #if (haxe >= "4.0.0") + inline forEachBound(control, (action, _) -> removeButtons(action, gamepadID, buttons)); + #else + forEachBound(control, (action, _) -> removeButtons(action, gamepadID, buttons)); + #end } inline static function addButtons(action:FlxActionDigital, buttons:Array, state, id)