Skip to content

Commit

Permalink
Fix for GameInputDevices
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteMasterEric committed Jun 13, 2024
1 parent e2a297d commit 0091fdf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/openfl/ui/GameInput.hx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ import lime.ui.GamepadButton;

if (!__devices.exists(gamepad))
{
var device = new GameInputDevice(gamepad.guid, gamepad.name);
var device = new GameInputDevice(gamepad);
__deviceList.push(device);
__devices.set(gamepad, device);
numDevices = __deviceList.length;
Expand Down
12 changes: 9 additions & 3 deletions src/openfl/ui/GameInputDevice.hx
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ import lime.ui.Gamepad;
}
#end

@:noCompletion private function new(id:String, name:String)
@:noCompletion private function new(gamepad:Gamepad)
{
this.id = id;
this.name = name;
this.__gamepad = gamepad;
this.id = gamepad.guid;
this.name = gamepad.name;

var control;

Expand Down Expand Up @@ -94,6 +95,11 @@ import lime.ui.Gamepad;
return 0;
}

public function getLimeGamepad():Gamepad
{
return __gamepad;
}

/**
Retrieves a specific control from a device.
@param i
Expand Down

0 comments on commit 0091fdf

Please sign in to comment.