gamepad support and keybind cleaning up
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package;
|
||||
|
||||
import flixel.input.gamepad.FlxGamepad;
|
||||
import Controls.KeyboardScheme;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxObject;
|
||||
@ -144,13 +145,29 @@ class MainMenuState extends MusicBeatState
|
||||
|
||||
if (!selectedSomethin)
|
||||
{
|
||||
if (controls.UP_P)
|
||||
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
|
||||
|
||||
if (gamepad != null)
|
||||
{
|
||||
if (gamepad.justPressed.DPAD_UP)
|
||||
{
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'));
|
||||
changeItem(-1);
|
||||
}
|
||||
if (gamepad.justPressed.DPAD_DOWN)
|
||||
{
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'));
|
||||
changeItem(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (FlxG.keys.justPressed.UP)
|
||||
{
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'));
|
||||
changeItem(-1);
|
||||
}
|
||||
|
||||
if (controls.DOWN_P)
|
||||
if (FlxG.keys.justPressed.DOWN)
|
||||
{
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'));
|
||||
changeItem(1);
|
||||
|
Reference in New Issue
Block a user