mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
keyboard/gameepad input for menu
This commit is contained in:
parent
2c4ef113d5
commit
e11e34d042
21 changed files with 92 additions and 16 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
package gui;
|
package gui;
|
||||||
|
|
||||||
|
import hxd.Key;
|
||||||
import src.MarbleGame;
|
import src.MarbleGame;
|
||||||
import hxd.res.BitmapFont;
|
import hxd.res.BitmapFont;
|
||||||
import h3d.Vector;
|
import h3d.Vector;
|
||||||
|
|
@ -108,6 +109,7 @@ class AboutMenuOptionsGui extends GuiImage {
|
||||||
backButton.vertSizing = Bottom;
|
backButton.vertSizing = Bottom;
|
||||||
backButton.horizSizing = Right;
|
backButton.horizSizing = Right;
|
||||||
backButton.gamepadAccelerator = ["B"];
|
backButton.gamepadAccelerator = ["B"];
|
||||||
|
backButton.accelerators = [Key.ESCAPE, Key.BACKSPACE];
|
||||||
if (pauseGui)
|
if (pauseGui)
|
||||||
backButton.pressedAction = (e) -> {
|
backButton.pressedAction = (e) -> {
|
||||||
MarbleGame.canvas.popDialog(this);
|
MarbleGame.canvas.popDialog(this);
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,7 @@ class AchievementsGui extends GuiImage {
|
||||||
backButton.vertSizing = Bottom;
|
backButton.vertSizing = Bottom;
|
||||||
backButton.horizSizing = Right;
|
backButton.horizSizing = Right;
|
||||||
backButton.gamepadAccelerator = ["B"];
|
backButton.gamepadAccelerator = ["B"];
|
||||||
|
backButton.accelerators = [hxd.Key.ESCAPE, hxd.Key.BACKSPACE];
|
||||||
if (isPause)
|
if (isPause)
|
||||||
backButton.pressedAction = (e) -> {
|
backButton.pressedAction = (e) -> {
|
||||||
MarbleGame.canvas.popDialog(this);
|
MarbleGame.canvas.popDialog(this);
|
||||||
|
|
@ -129,6 +130,8 @@ class AchievementsGui extends GuiImage {
|
||||||
nextButton.position = new Vector(960, 0);
|
nextButton.position = new Vector(960, 0);
|
||||||
nextButton.vertSizing = Bottom;
|
nextButton.vertSizing = Bottom;
|
||||||
nextButton.horizSizing = Right;
|
nextButton.horizSizing = Right;
|
||||||
|
nextButton.accelerators = [hxd.Key.ENTER];
|
||||||
|
nextButton.gamepadAccelerator = ["X"];
|
||||||
nextButton.pressedAction = (e) -> {
|
nextButton.pressedAction = (e) -> {
|
||||||
var desc = "Select an achievement from the list.";
|
var desc = "Select an achievement from the list.";
|
||||||
var selection = curSelection;
|
var selection = curSelection;
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,7 @@ class DifficultySelectGui extends GuiImage {
|
||||||
backButton.vertSizing = Bottom;
|
backButton.vertSizing = Bottom;
|
||||||
backButton.horizSizing = Right;
|
backButton.horizSizing = Right;
|
||||||
backButton.gamepadAccelerator = ["B"];
|
backButton.gamepadAccelerator = ["B"];
|
||||||
|
backButton.accelerators = [hxd.Key.ESCAPE, hxd.Key.BACKSPACE];
|
||||||
backButton.pressedAction = (e) -> MarbleGame.canvas.setContent(new MainMenuGui());
|
backButton.pressedAction = (e) -> MarbleGame.canvas.setContent(new MainMenuGui());
|
||||||
bottomBar.addChild(backButton);
|
bottomBar.addChild(backButton);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,7 @@ class EndGameGui extends GuiImage {
|
||||||
retryButton.vertSizing = Bottom;
|
retryButton.vertSizing = Bottom;
|
||||||
retryButton.horizSizing = Right;
|
retryButton.horizSizing = Right;
|
||||||
retryButton.gamepadAccelerator = ["B"];
|
retryButton.gamepadAccelerator = ["B"];
|
||||||
|
retryButton.accelerators = [hxd.Key.ESCAPE, hxd.Key.BACKSPACE];
|
||||||
retryButton.pressedAction = (e) -> restartFunc(retryButton);
|
retryButton.pressedAction = (e) -> restartFunc(retryButton);
|
||||||
bottomBar.addChild(retryButton);
|
bottomBar.addChild(retryButton);
|
||||||
|
|
||||||
|
|
@ -166,6 +167,8 @@ class EndGameGui extends GuiImage {
|
||||||
nextButton.position = new Vector(960, 0);
|
nextButton.position = new Vector(960, 0);
|
||||||
nextButton.vertSizing = Bottom;
|
nextButton.vertSizing = Bottom;
|
||||||
nextButton.horizSizing = Right;
|
nextButton.horizSizing = Right;
|
||||||
|
nextButton.gamepadAccelerator = ["A"];
|
||||||
|
nextButton.accelerators = [hxd.Key.ENTER];
|
||||||
nextButton.pressedAction = (e) -> continueFunc(nextButton);
|
nextButton.pressedAction = (e) -> continueFunc(nextButton);
|
||||||
bottomBar.addChild(nextButton);
|
bottomBar.addChild(nextButton);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ class GuiXboxButton extends GuiControl {
|
||||||
|
|
||||||
public var buttonSounds:Bool = true;
|
public var buttonSounds:Bool = true;
|
||||||
|
|
||||||
public var accelerator:Int = 0;
|
public var accelerators:Array<Int> = [];
|
||||||
public var gamepadAccelerator:Array<String> = [];
|
public var gamepadAccelerator:Array<String> = [];
|
||||||
public var acceleratorWasPressed = false;
|
public var acceleratorWasPressed = false;
|
||||||
|
|
||||||
|
|
@ -116,16 +116,21 @@ class GuiXboxButton extends GuiControl {
|
||||||
pressed = false;
|
pressed = false;
|
||||||
}
|
}
|
||||||
if (!disabled) {
|
if (!disabled) {
|
||||||
if (acceleratorWasPressed && (accelerator != 0 && hxd.Key.isReleased(accelerator)) || Gamepad.isReleased(gamepadAccelerator)) {
|
if (acceleratorWasPressed
|
||||||
|
&& (accelerators.length != 0 && accelerators.map(x -> hxd.Key.isReleased(x)).contains(true))
|
||||||
|
|| Gamepad.isReleased(gamepadAccelerator)) {
|
||||||
if (this.pressedAction != null) {
|
if (this.pressedAction != null) {
|
||||||
this.pressedAction(new GuiEvent(this));
|
this.pressedAction(new GuiEvent(this));
|
||||||
}
|
}
|
||||||
} else if ((accelerator != 0 && hxd.Key.isPressed(accelerator)) || Gamepad.isPressed(gamepadAccelerator)) {
|
} else if (accelerators.length != 0
|
||||||
|
&& accelerators.map(x -> hxd.Key.isPressed(x)).contains(true)
|
||||||
|
|| Gamepad.isPressed(gamepadAccelerator)) {
|
||||||
acceleratorWasPressed = true;
|
acceleratorWasPressed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (acceleratorWasPressed) {
|
if (acceleratorWasPressed) {
|
||||||
if ((accelerator != 0 && hxd.Key.isReleased(accelerator)) || Gamepad.isReleased(gamepadAccelerator))
|
if ((accelerators.length != 0 && accelerators.map(x -> hxd.Key.isReleased(x)).contains(true))
|
||||||
|
|| Gamepad.isReleased(gamepadAccelerator))
|
||||||
acceleratorWasPressed = false;
|
acceleratorWasPressed = false;
|
||||||
}
|
}
|
||||||
super.update(dt, mouseState);
|
super.update(dt, mouseState);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,15 @@
|
||||||
package gui;
|
package gui;
|
||||||
|
|
||||||
|
import src.Gamepad;
|
||||||
|
import hxd.Key;
|
||||||
|
import gui.GuiControl.MouseState;
|
||||||
import h3d.Vector;
|
import h3d.Vector;
|
||||||
|
|
||||||
class GuiXboxList extends GuiControl {
|
class GuiXboxList extends GuiControl {
|
||||||
var currentOffset:Float = 0;
|
var currentOffset:Float = 0;
|
||||||
|
var selected:Int = 0;
|
||||||
|
|
||||||
|
var buttons:Array<GuiXboxListButton> = [];
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
super();
|
super();
|
||||||
|
|
@ -14,8 +20,30 @@ class GuiXboxList extends GuiControl {
|
||||||
btn.position = new Vector(0, currentOffset + addOffset);
|
btn.position = new Vector(0, currentOffset + addOffset);
|
||||||
btn.extent = new Vector(502, 94);
|
btn.extent = new Vector(502, 94);
|
||||||
btn.pressedAction = func;
|
btn.pressedAction = func;
|
||||||
|
btn.list = this;
|
||||||
this.addChild(btn);
|
this.addChild(btn);
|
||||||
|
buttons.push(btn);
|
||||||
currentOffset += 60 + addOffset;
|
currentOffset += 60 + addOffset;
|
||||||
return btn;
|
return btn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override function update(dt:Float, mouseState:MouseState) {
|
||||||
|
super.update(dt, mouseState);
|
||||||
|
|
||||||
|
var prevSelected = selected;
|
||||||
|
if (Key.isPressed(Key.DOWN) || Gamepad.isPressed(["dpadDown"]))
|
||||||
|
selected++;
|
||||||
|
if (Key.isPressed(Key.UP) || Gamepad.isPressed(["dpadUp"]))
|
||||||
|
selected--;
|
||||||
|
if (selected < 0)
|
||||||
|
selected = buttons.length - 1;
|
||||||
|
if (selected >= buttons.length)
|
||||||
|
selected = 0;
|
||||||
|
if (prevSelected != selected) {
|
||||||
|
buttons[prevSelected].selected = false;
|
||||||
|
buttons[selected].selected = true;
|
||||||
|
}
|
||||||
|
if (Key.isPressed(Key.ENTER) || Gamepad.isPressed(["A"]))
|
||||||
|
buttons[selected].pressedAction(new GuiEvent(buttons[selected]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,16 @@ class GuiXboxListButton extends GuiControl {
|
||||||
public var disabled:Bool = false;
|
public var disabled:Bool = false;
|
||||||
|
|
||||||
public var pressed:Bool = false;
|
public var pressed:Bool = false;
|
||||||
|
public var selected:Bool = false;
|
||||||
|
|
||||||
public var buttonSounds:Bool = true;
|
public var buttonSounds:Bool = true;
|
||||||
|
|
||||||
public var accelerator:Int = 0;
|
public var accelerator:Int = 0;
|
||||||
public var gamepadAccelerator:Array<String> = [];
|
public var gamepadAccelerator:Array<String> = [];
|
||||||
public var acceleratorWasPressed = false;
|
public var acceleratorWasPressed = false;
|
||||||
|
public var list:GuiXboxList;
|
||||||
|
|
||||||
|
var _prevMousePos:Vector;
|
||||||
|
|
||||||
public function new(icon:Int, text:String) {
|
public function new(icon:Int, text:String) {
|
||||||
super();
|
super();
|
||||||
|
|
@ -76,7 +80,20 @@ class GuiXboxListButton extends GuiControl {
|
||||||
AudioManager.playSound(ResourceLoader.getResource("data/sound/buttonpress.wav", ResourceLoader.getAudio, this.soundResources));
|
AudioManager.playSound(ResourceLoader.getResource("data/sound/buttonpress.wav", ResourceLoader.getAudio, this.soundResources));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (renderRect.inRect(mouseState.position) && !disabled) {
|
if (_prevMousePos == null || !_prevMousePos.equals(mouseState.position)) {
|
||||||
|
if (renderRect.inRect(mouseState.position) && !selected) {
|
||||||
|
if (list != null) {
|
||||||
|
list.buttons[list.selected].selected = false;
|
||||||
|
list.selected = list.buttons.indexOf(this);
|
||||||
|
}
|
||||||
|
this.selected = true;
|
||||||
|
}
|
||||||
|
if (!renderRect.inRect(mouseState.position) && selected) {
|
||||||
|
this.selected = false;
|
||||||
|
}
|
||||||
|
_prevMousePos = mouseState.position.clone();
|
||||||
|
}
|
||||||
|
if (selected && !disabled) {
|
||||||
if (Key.isDown(Key.MOUSE_LEFT)) {
|
if (Key.isDown(Key.MOUSE_LEFT)) {
|
||||||
this.button.anim.currentFrame = 1;
|
this.button.anim.currentFrame = 1;
|
||||||
this.buttonIcon.anim.currentFrame = 1;
|
this.buttonIcon.anim.currentFrame = 1;
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,8 @@ class HelpCreditsGui extends GuiImage {
|
||||||
backButton.position = new Vector(960, 0);
|
backButton.position = new Vector(960, 0);
|
||||||
backButton.vertSizing = Bottom;
|
backButton.vertSizing = Bottom;
|
||||||
backButton.horizSizing = Right;
|
backButton.horizSizing = Right;
|
||||||
backButton.gamepadAccelerator = ["OK"];
|
backButton.gamepadAccelerator = ["A"];
|
||||||
|
backButton.accelerators = [hxd.Key.ENTER];
|
||||||
if (pauseGui)
|
if (pauseGui)
|
||||||
if (index == 5)
|
if (index == 5)
|
||||||
backButton.pressedAction = (e) -> {
|
backButton.pressedAction = (e) -> {
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,8 @@ class InputOptionsGui extends GuiImage {
|
||||||
backButton.position = new Vector(960, 0);
|
backButton.position = new Vector(960, 0);
|
||||||
backButton.vertSizing = Bottom;
|
backButton.vertSizing = Bottom;
|
||||||
backButton.horizSizing = Right;
|
backButton.horizSizing = Right;
|
||||||
backButton.gamepadAccelerator = ["OK"];
|
backButton.gamepadAccelerator = ["A"];
|
||||||
|
backButton.accelerators = [hxd.Key.ENTER];
|
||||||
if (pauseGui)
|
if (pauseGui)
|
||||||
backButton.pressedAction = (e) -> {
|
backButton.pressedAction = (e) -> {
|
||||||
Settings.applySettings();
|
Settings.applySettings();
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,7 @@ class KeyBindingsGui extends GuiImage {
|
||||||
backButton.vertSizing = Bottom;
|
backButton.vertSizing = Bottom;
|
||||||
backButton.horizSizing = Right;
|
backButton.horizSizing = Right;
|
||||||
backButton.gamepadAccelerator = ["B"];
|
backButton.gamepadAccelerator = ["B"];
|
||||||
|
backButton.accelerators = [hxd.Key.ESCAPE, hxd.Key.BACKSPACE];
|
||||||
if (pauseGui)
|
if (pauseGui)
|
||||||
backButton.pressedAction = (e) -> {
|
backButton.pressedAction = (e) -> {
|
||||||
MarbleGame.canvas.popDialog(this);
|
MarbleGame.canvas.popDialog(this);
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,7 @@ class LevelSelectGui extends GuiImage {
|
||||||
backButton.vertSizing = Bottom;
|
backButton.vertSizing = Bottom;
|
||||||
backButton.horizSizing = Right;
|
backButton.horizSizing = Right;
|
||||||
backButton.gamepadAccelerator = ["B"];
|
backButton.gamepadAccelerator = ["B"];
|
||||||
|
backButton.accelerators = [hxd.Key.ESCAPE, hxd.Key.BACKSPACE];
|
||||||
backButton.pressedAction = (e) -> MarbleGame.canvas.setContent(new DifficultySelectGui());
|
backButton.pressedAction = (e) -> MarbleGame.canvas.setContent(new DifficultySelectGui());
|
||||||
bottomBar.addChild(backButton);
|
bottomBar.addChild(backButton);
|
||||||
|
|
||||||
|
|
@ -143,6 +144,7 @@ class LevelSelectGui extends GuiImage {
|
||||||
recordButton.position = new Vector(560, 0);
|
recordButton.position = new Vector(560, 0);
|
||||||
recordButton.vertSizing = Bottom;
|
recordButton.vertSizing = Bottom;
|
||||||
recordButton.horizSizing = Right;
|
recordButton.horizSizing = Right;
|
||||||
|
backButton.gamepadAccelerator = ["X"];
|
||||||
recordButton.pressedAction = (e) -> {
|
recordButton.pressedAction = (e) -> {
|
||||||
MarbleGame.instance.toRecord = true;
|
MarbleGame.instance.toRecord = true;
|
||||||
MarbleGame.canvas.pushDialog(new MessageBoxOkDlg("The next mission you play will be recorded."));
|
MarbleGame.canvas.pushDialog(new MessageBoxOkDlg("The next mission you play will be recorded."));
|
||||||
|
|
@ -159,6 +161,8 @@ class LevelSelectGui extends GuiImage {
|
||||||
nextButton.position = new Vector(960, 0);
|
nextButton.position = new Vector(960, 0);
|
||||||
nextButton.vertSizing = Bottom;
|
nextButton.vertSizing = Bottom;
|
||||||
nextButton.horizSizing = Right;
|
nextButton.horizSizing = Right;
|
||||||
|
nextButton.gamepadAccelerator = ["A"];
|
||||||
|
nextButton.accelerators = [hxd.Key.ENTER];
|
||||||
nextButton.pressedAction = (e) -> {
|
nextButton.pressedAction = (e) -> {
|
||||||
MarbleGame.instance.playMission(curMission);
|
MarbleGame.instance.playMission(curMission);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -330,7 +330,8 @@ class MarblePickerGui extends GuiImage {
|
||||||
backButton.position = new Vector(960, 0);
|
backButton.position = new Vector(960, 0);
|
||||||
backButton.vertSizing = Bottom;
|
backButton.vertSizing = Bottom;
|
||||||
backButton.horizSizing = Right;
|
backButton.horizSizing = Right;
|
||||||
backButton.gamepadAccelerator = ["OK"];
|
backButton.gamepadAccelerator = ["A"];
|
||||||
|
backButton.accelerators = [hxd.Key.ENTER];
|
||||||
backButton.pressedAction = (e) -> {
|
backButton.pressedAction = (e) -> {
|
||||||
this.bmp.visible = true;
|
this.bmp.visible = true;
|
||||||
MarbleGame.instance.setPreviewMission(prevPreview, () -> {
|
MarbleGame.instance.setPreviewMission(prevPreview, () -> {
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ class MessageBoxOkDlg extends GuiImage {
|
||||||
okButton.position = new Vector(211, 248);
|
okButton.position = new Vector(211, 248);
|
||||||
okButton.extent = new Vector(120, 94);
|
okButton.extent = new Vector(120, 94);
|
||||||
okButton.vertSizing = Top;
|
okButton.vertSizing = Top;
|
||||||
okButton.accelerator = hxd.Key.ENTER;
|
okButton.accelerators = [hxd.Key.ENTER];
|
||||||
okButton.gamepadAccelerator = ["A"];
|
okButton.gamepadAccelerator = ["A"];
|
||||||
okButton.pressedAction = (sender) -> {
|
okButton.pressedAction = (sender) -> {
|
||||||
MarbleGame.canvas.popDialog(this);
|
MarbleGame.canvas.popDialog(this);
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ class MessageBoxYesNoDlg extends GuiImage {
|
||||||
okButton.position = new Vector(211, 248);
|
okButton.position = new Vector(211, 248);
|
||||||
okButton.extent = new Vector(120, 94);
|
okButton.extent = new Vector(120, 94);
|
||||||
okButton.vertSizing = Top;
|
okButton.vertSizing = Top;
|
||||||
okButton.accelerator = hxd.Key.ENTER;
|
okButton.accelerators = [hxd.Key.ENTER];
|
||||||
okButton.gamepadAccelerator = ["A"];
|
okButton.gamepadAccelerator = ["A"];
|
||||||
okButton.pressedAction = (sender) -> {
|
okButton.pressedAction = (sender) -> {
|
||||||
MarbleGame.canvas.popDialog(this);
|
MarbleGame.canvas.popDialog(this);
|
||||||
|
|
@ -50,7 +50,7 @@ class MessageBoxYesNoDlg extends GuiImage {
|
||||||
cancelButton.position = new Vector(321, 248);
|
cancelButton.position = new Vector(321, 248);
|
||||||
cancelButton.extent = new Vector(120, 94);
|
cancelButton.extent = new Vector(120, 94);
|
||||||
cancelButton.vertSizing = Top;
|
cancelButton.vertSizing = Top;
|
||||||
cancelButton.accelerator = hxd.Key.ENTER;
|
cancelButton.accelerators = [hxd.Key.ESCAPE, hxd.Key.BACKSPACE];
|
||||||
cancelButton.gamepadAccelerator = ["A"];
|
cancelButton.gamepadAccelerator = ["A"];
|
||||||
cancelButton.pressedAction = (sender) -> {
|
cancelButton.pressedAction = (sender) -> {
|
||||||
MarbleGame.canvas.popDialog(this);
|
MarbleGame.canvas.popDialog(this);
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,8 @@ class MiscOptionsGui extends GuiImage {
|
||||||
backButton.position = new Vector(960, 0);
|
backButton.position = new Vector(960, 0);
|
||||||
backButton.vertSizing = Bottom;
|
backButton.vertSizing = Bottom;
|
||||||
backButton.horizSizing = Right;
|
backButton.horizSizing = Right;
|
||||||
backButton.gamepadAccelerator = ["OK"];
|
backButton.gamepadAccelerator = ["A"];
|
||||||
|
backButton.accelerators = [hxd.Key.ENTER];
|
||||||
if (pauseGui)
|
if (pauseGui)
|
||||||
backButton.pressedAction = (e) -> {
|
backButton.pressedAction = (e) -> {
|
||||||
Settings.applySettings();
|
Settings.applySettings();
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@ class OptionsListGui extends GuiImage {
|
||||||
backButton.vertSizing = Bottom;
|
backButton.vertSizing = Bottom;
|
||||||
backButton.horizSizing = Right;
|
backButton.horizSizing = Right;
|
||||||
backButton.gamepadAccelerator = ["B"];
|
backButton.gamepadAccelerator = ["B"];
|
||||||
|
backButton.accelerators = [hxd.Key.ESCAPE, hxd.Key.BACKSPACE];
|
||||||
if (pauseGui)
|
if (pauseGui)
|
||||||
backButton.pressedAction = (e) -> {
|
backButton.pressedAction = (e) -> {
|
||||||
MarbleGame.canvas.popDialog(this);
|
MarbleGame.canvas.popDialog(this);
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,7 @@ class ReplayCenterGui extends GuiImage {
|
||||||
backButton.vertSizing = Bottom;
|
backButton.vertSizing = Bottom;
|
||||||
backButton.horizSizing = Right;
|
backButton.horizSizing = Right;
|
||||||
backButton.gamepadAccelerator = ["B"];
|
backButton.gamepadAccelerator = ["B"];
|
||||||
|
backButton.accelerators = [hxd.Key.ESCAPE, hxd.Key.BACKSPACE];
|
||||||
backButton.pressedAction = (e) -> MarbleGame.canvas.setContent(new MainMenuGui());
|
backButton.pressedAction = (e) -> MarbleGame.canvas.setContent(new MainMenuGui());
|
||||||
bottomBar.addChild(backButton);
|
bottomBar.addChild(backButton);
|
||||||
|
|
||||||
|
|
@ -119,6 +120,8 @@ class ReplayCenterGui extends GuiImage {
|
||||||
nextButton.position = new Vector(960, 0);
|
nextButton.position = new Vector(960, 0);
|
||||||
nextButton.vertSizing = Bottom;
|
nextButton.vertSizing = Bottom;
|
||||||
nextButton.horizSizing = Right;
|
nextButton.horizSizing = Right;
|
||||||
|
nextButton.gamepadAccelerator = ["A"];
|
||||||
|
nextButton.accelerators = [hxd.Key.ENTER];
|
||||||
nextButton.pressedAction = (e) -> {
|
nextButton.pressedAction = (e) -> {
|
||||||
if (selectedIdx != -1) {
|
if (selectedIdx != -1) {
|
||||||
var repl = replayList[selectedIdx];
|
var repl = replayList[selectedIdx];
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ class ReplayNameDlg extends GuiImage {
|
||||||
okButton.position = new Vector(211, 248);
|
okButton.position = new Vector(211, 248);
|
||||||
okButton.extent = new Vector(120, 94);
|
okButton.extent = new Vector(120, 94);
|
||||||
okButton.vertSizing = Top;
|
okButton.vertSizing = Top;
|
||||||
okButton.accelerator = hxd.Key.ENTER;
|
okButton.accelerators = [hxd.Key.ENTER];
|
||||||
okButton.gamepadAccelerator = ["A"];
|
okButton.gamepadAccelerator = ["A"];
|
||||||
okButton.pressedAction = (sender) -> {
|
okButton.pressedAction = (sender) -> {
|
||||||
if (StringTools.trim(textInput.text.text) != "") {
|
if (StringTools.trim(textInput.text.text) != "") {
|
||||||
|
|
@ -79,7 +79,7 @@ class ReplayNameDlg extends GuiImage {
|
||||||
cancelButton.position = new Vector(321, 248);
|
cancelButton.position = new Vector(321, 248);
|
||||||
cancelButton.extent = new Vector(120, 94);
|
cancelButton.extent = new Vector(120, 94);
|
||||||
cancelButton.vertSizing = Top;
|
cancelButton.vertSizing = Top;
|
||||||
cancelButton.accelerator = hxd.Key.ENTER;
|
cancelButton.accelerators = [hxd.Key.ENTER];
|
||||||
cancelButton.gamepadAccelerator = ["A"];
|
cancelButton.gamepadAccelerator = ["A"];
|
||||||
cancelButton.pressedAction = (sender) -> {
|
cancelButton.pressedAction = (sender) -> {
|
||||||
MarbleGame.canvas.popDialog(this);
|
MarbleGame.canvas.popDialog(this);
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,8 @@ class TouchCtrlsEditGui extends GuiImage {
|
||||||
nextButton.position = new Vector(960, 100);
|
nextButton.position = new Vector(960, 100);
|
||||||
nextButton.vertSizing = Bottom;
|
nextButton.vertSizing = Bottom;
|
||||||
nextButton.horizSizing = Right;
|
nextButton.horizSizing = Right;
|
||||||
|
nextButton.gamepadAccelerator = ["A"];
|
||||||
|
nextButton.accelerators = [hxd.Key.ENTER];
|
||||||
nextButton.pressedAction = (e) -> {
|
nextButton.pressedAction = (e) -> {
|
||||||
if (paused) {
|
if (paused) {
|
||||||
MarbleGame.canvas.popDialog(this);
|
MarbleGame.canvas.popDialog(this);
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,8 @@ class VersionGui extends GuiImage {
|
||||||
backButton.position = new Vector(960, 0);
|
backButton.position = new Vector(960, 0);
|
||||||
backButton.vertSizing = Bottom;
|
backButton.vertSizing = Bottom;
|
||||||
backButton.horizSizing = Right;
|
backButton.horizSizing = Right;
|
||||||
backButton.gamepadAccelerator = ["OK"];
|
backButton.gamepadAccelerator = ["A"];
|
||||||
|
backButton.accelerators = [hxd.Key.ENTER];
|
||||||
backButton.pressedAction = (e) -> MarbleGame.canvas.setContent(new MainMenuGui());
|
backButton.pressedAction = (e) -> MarbleGame.canvas.setContent(new MainMenuGui());
|
||||||
bottomBar.addChild(backButton);
|
bottomBar.addChild(backButton);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,8 @@ class VideoOptionsGui extends GuiImage {
|
||||||
backButton.position = new Vector(960, 0);
|
backButton.position = new Vector(960, 0);
|
||||||
backButton.vertSizing = Bottom;
|
backButton.vertSizing = Bottom;
|
||||||
backButton.horizSizing = Right;
|
backButton.horizSizing = Right;
|
||||||
backButton.gamepadAccelerator = ["OK"];
|
backButton.gamepadAccelerator = ["A"];
|
||||||
|
backButton.accelerators = [hxd.Key.ENTER];
|
||||||
if (pauseGui)
|
if (pauseGui)
|
||||||
backButton.pressedAction = (e) -> {
|
backButton.pressedAction = (e) -> {
|
||||||
Settings.applySettings();
|
Settings.applySettings();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue