v0.8.0: refactored most game actions into the core module
This commit is contained in:
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2019 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon;
|
||||
|
||||
import com.badlogic.gdx.Input;
|
||||
import com.watabou.input.GameAction;
|
||||
import com.watabou.input.KeyBindings;
|
||||
|
||||
public class SPDAction extends GameAction {
|
||||
|
||||
//--Existing actions from GameAction
|
||||
public static final int NONE = GameAction.NONE;
|
||||
|
||||
public static final int BACK = GameAction.BACK;
|
||||
public static final int MENU = GameAction.MENU;
|
||||
//--
|
||||
|
||||
public static final int HERO_INFO = 3;
|
||||
public static final int JOURNAL = 4;
|
||||
|
||||
public static final int WAIT = 5;
|
||||
public static final int SEARCH = 6;
|
||||
|
||||
public static final int INVENTORY = 7;
|
||||
public static final int QUICKSLOT_1 = 8;
|
||||
public static final int QUICKSLOT_2 = 9;
|
||||
public static final int QUICKSLOT_3 = 10;
|
||||
public static final int QUICKSLOT_4 = 11;
|
||||
|
||||
public static final int TAG_ATTACK = 12;
|
||||
public static final int TAG_DANGER = 13;
|
||||
public static final int TAG_ACTION = 14;
|
||||
public static final int TAG_LOOT = 15;
|
||||
public static final int TAG_RESUME = 16;
|
||||
|
||||
public static final int ZOOM_IN = 17;
|
||||
public static final int ZOOM_OUT = 18;
|
||||
public static final int ZOOM_DEFAULT= 19;
|
||||
|
||||
public static final int N = 20;
|
||||
public static final int NE = 21;
|
||||
public static final int E = 22;
|
||||
public static final int SE = 23;
|
||||
public static final int S = 24;
|
||||
public static final int SW = 25;
|
||||
public static final int W = 26;
|
||||
public static final int NW = 27;
|
||||
|
||||
public static void initialize() {
|
||||
|
||||
KeyBindings.addName(NONE, "none");
|
||||
|
||||
KeyBindings.addName(BACK, "back");
|
||||
KeyBindings.addName(MENU, "menu");
|
||||
|
||||
KeyBindings.addName(HERO_INFO, "hero_info");
|
||||
KeyBindings.addName(JOURNAL, "journal");
|
||||
|
||||
KeyBindings.addName(WAIT, "wait");
|
||||
KeyBindings.addName(SEARCH, "search");
|
||||
|
||||
KeyBindings.addName(INVENTORY, "inventory");
|
||||
KeyBindings.addName(QUICKSLOT_1, "quickslot_1");
|
||||
KeyBindings.addName(QUICKSLOT_2, "quickslot_2");
|
||||
KeyBindings.addName(QUICKSLOT_3, "quickslot_3");
|
||||
KeyBindings.addName(QUICKSLOT_4, "quickslot_4");
|
||||
|
||||
KeyBindings.addName(TAG_ATTACK, "tag_attack");
|
||||
KeyBindings.addName(TAG_DANGER, "tag_danger");
|
||||
KeyBindings.addName(TAG_ACTION, "tag_action");
|
||||
KeyBindings.addName(TAG_LOOT, "tag_loot");
|
||||
KeyBindings.addName(TAG_RESUME, "tag_resume");
|
||||
|
||||
KeyBindings.addName(ZOOM_IN, "zoom_in");
|
||||
KeyBindings.addName(ZOOM_OUT, "zoom_out");
|
||||
KeyBindings.addName(ZOOM_DEFAULT, "zoom_default");
|
||||
|
||||
KeyBindings.addName(N, "none");
|
||||
KeyBindings.addName(NE, "none");
|
||||
KeyBindings.addName(E, "none");
|
||||
KeyBindings.addName(SE, "none");
|
||||
KeyBindings.addName(S, "none");
|
||||
KeyBindings.addName(SW, "none");
|
||||
KeyBindings.addName(W, "none");
|
||||
KeyBindings.addName(NW, "none");
|
||||
|
||||
//default key bindings
|
||||
KeyBindings.addBinding( Input.Keys.BACK, GameAction.BACK );
|
||||
KeyBindings.addBinding( Input.Keys.MENU, GameAction.MENU );
|
||||
|
||||
KeyBindings.addBinding( Input.Keys.H, SPDAction.HERO_INFO );
|
||||
KeyBindings.addBinding( Input.Keys.J, SPDAction.JOURNAL );
|
||||
|
||||
KeyBindings.addBinding( Input.Keys.NUMPAD_5, SPDAction.WAIT );
|
||||
KeyBindings.addBinding( Input.Keys.SPACE, SPDAction.WAIT );
|
||||
KeyBindings.addBinding( Input.Keys.S, SPDAction.SEARCH );
|
||||
|
||||
KeyBindings.addBinding( Input.Keys.I, SPDAction.INVENTORY );
|
||||
KeyBindings.addBinding( Input.Keys.Q, SPDAction.QUICKSLOT_1 );
|
||||
KeyBindings.addBinding( Input.Keys.W, SPDAction.QUICKSLOT_2 );
|
||||
KeyBindings.addBinding( Input.Keys.E, SPDAction.QUICKSLOT_3 );
|
||||
KeyBindings.addBinding( Input.Keys.R, SPDAction.QUICKSLOT_4 );
|
||||
|
||||
KeyBindings.addBinding( Input.Keys.A, SPDAction.TAG_ATTACK );
|
||||
KeyBindings.addBinding( Input.Keys.TAB, SPDAction.TAG_DANGER );
|
||||
KeyBindings.addBinding( Input.Keys.D, SPDAction.TAG_ACTION );
|
||||
KeyBindings.addBinding( Input.Keys.ENTER, SPDAction.TAG_LOOT );
|
||||
KeyBindings.addBinding( Input.Keys.T, SPDAction.TAG_RESUME );
|
||||
|
||||
KeyBindings.addBinding( Input.Keys.PLUS, SPDAction.ZOOM_IN );
|
||||
KeyBindings.addBinding( Input.Keys.EQUALS, SPDAction.ZOOM_IN );
|
||||
KeyBindings.addBinding( Input.Keys.MINUS, SPDAction.ZOOM_OUT );
|
||||
KeyBindings.addBinding( Input.Keys.SLASH, SPDAction.ZOOM_DEFAULT );
|
||||
|
||||
KeyBindings.addBinding( Input.Keys.UP, SPDAction.N );
|
||||
KeyBindings.addBinding( Input.Keys.RIGHT, SPDAction.E );
|
||||
KeyBindings.addBinding( Input.Keys.DOWN, SPDAction.S );
|
||||
KeyBindings.addBinding( Input.Keys.LEFT, SPDAction.W );
|
||||
KeyBindings.addBinding( Input.Keys.NUMPAD_8, SPDAction.N );
|
||||
KeyBindings.addBinding( Input.Keys.NUMPAD_9, SPDAction.NE );
|
||||
KeyBindings.addBinding( Input.Keys.NUMPAD_6, SPDAction.E );
|
||||
KeyBindings.addBinding( Input.Keys.NUMPAD_3, SPDAction.SE );
|
||||
KeyBindings.addBinding( Input.Keys.NUMPAD_2, SPDAction.S );
|
||||
KeyBindings.addBinding( Input.Keys.NUMPAD_1, SPDAction.SW );
|
||||
KeyBindings.addBinding( Input.Keys.NUMPAD_4, SPDAction.W );
|
||||
KeyBindings.addBinding( Input.Keys.NUMPAD_7, SPDAction.NW );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -132,6 +132,7 @@ public class ShatteredPixelDungeon extends Game {
|
||||
super.create();
|
||||
|
||||
updateSystemUI();
|
||||
SPDAction.initialize();
|
||||
|
||||
Music.INSTANCE.enable( SPDSettings.music() );
|
||||
Music.INSTANCE.volume( SPDSettings.musicVol()/10f );
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
@@ -29,7 +30,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
||||
import com.watabou.input.KeyAction;
|
||||
import com.watabou.input.KeyBindings;
|
||||
import com.watabou.input.KeyEvent;
|
||||
import com.watabou.input.PointerEvent;
|
||||
@@ -208,7 +208,7 @@ public class CellSelector extends ScrollArea {
|
||||
|
||||
}
|
||||
|
||||
private int heldAction = KeyAction.NONE;
|
||||
private int heldAction = SPDAction.NONE;
|
||||
private int heldTurns = 0;
|
||||
|
||||
private Signal.Listener<KeyEvent> keyListener = new Signal.Listener<KeyEvent>() {
|
||||
@@ -222,13 +222,13 @@ public class CellSelector extends ScrollArea {
|
||||
return true;
|
||||
} else {
|
||||
switch (action){
|
||||
case KeyAction.ZOOM_IN:
|
||||
case SPDAction.ZOOM_IN:
|
||||
zoom( camera.zoom+1 );
|
||||
return true;
|
||||
case KeyAction.ZOOM_OUT:
|
||||
case SPDAction.ZOOM_OUT:
|
||||
zoom( camera.zoom-1 );
|
||||
return true;
|
||||
case KeyAction.ZOOM_DEFAULT:
|
||||
case SPDAction.ZOOM_DEFAULT:
|
||||
zoom( PixelScene.defaultZoom );
|
||||
return true;
|
||||
}
|
||||
@@ -245,30 +245,29 @@ public class CellSelector extends ScrollArea {
|
||||
private boolean moveFromKey(int event){
|
||||
boolean moved = true;
|
||||
int cell = Dungeon.hero.pos;
|
||||
//TODO implement game actions, instead of using keys directly
|
||||
switch (event){
|
||||
case KeyAction.N:
|
||||
case SPDAction.N:
|
||||
cell += -Dungeon.level.width();
|
||||
break;
|
||||
case KeyAction.NE:
|
||||
case SPDAction.NE:
|
||||
cell += +1-Dungeon.level.width();
|
||||
break;
|
||||
case KeyAction.E:
|
||||
case SPDAction.E:
|
||||
cell += +1;
|
||||
break;
|
||||
case KeyAction.SE:
|
||||
case SPDAction.SE:
|
||||
cell += +1+Dungeon.level.width();
|
||||
break;
|
||||
case KeyAction.S:
|
||||
case SPDAction.S:
|
||||
cell += +Dungeon.level.width();
|
||||
break;
|
||||
case KeyAction.SW:
|
||||
case SPDAction.SW:
|
||||
cell += -1+Dungeon.level.width();
|
||||
break;
|
||||
case KeyAction.W:
|
||||
case SPDAction.W:
|
||||
cell += -1;
|
||||
break;
|
||||
case KeyAction.NW:
|
||||
case SPDAction.NW:
|
||||
cell += -1-Dungeon.level.width();
|
||||
break;
|
||||
default:
|
||||
@@ -287,7 +286,7 @@ public class CellSelector extends ScrollArea {
|
||||
}
|
||||
|
||||
public void processKeyHold(){
|
||||
if (heldAction != KeyAction.NONE){
|
||||
if (heldAction != SPDAction.NONE){
|
||||
enabled = true;
|
||||
heldTurns++;
|
||||
moveFromKey(heldAction);
|
||||
@@ -295,7 +294,7 @@ public class CellSelector extends ScrollArea {
|
||||
}
|
||||
|
||||
public void resetKeyHold(){
|
||||
heldAction = KeyAction.NONE;
|
||||
heldAction = SPDAction.NONE;
|
||||
heldTurns = 0;
|
||||
CharSprite.setMoveInterval( CharSprite.DEFAULT_MOVE_INTERVAL );
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.watabou.input.KeyAction;
|
||||
import com.watabou.noosa.Image;
|
||||
|
||||
public class ActionIndicator extends Tag {
|
||||
@@ -44,7 +44,7 @@ public class ActionIndicator extends Tag {
|
||||
|
||||
@Override
|
||||
public int keyAction() {
|
||||
return KeyAction.TAG_ACTION;
|
||||
return SPDAction.TAG_ACTION;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.watabou.input.KeyAction;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.utils.Random;
|
||||
import com.watabou.utils.Reflection;
|
||||
@@ -60,7 +60,7 @@ public class AttackIndicator extends Tag {
|
||||
|
||||
@Override
|
||||
public int keyAction() {
|
||||
return KeyAction.TAG_ATTACK;
|
||||
return SPDAction.TAG_ATTACK;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.watabou.input.KeyAction;
|
||||
import com.watabou.noosa.BitmapText;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.Image;
|
||||
@@ -50,7 +50,7 @@ public class DangerIndicator extends Tag {
|
||||
|
||||
@Override
|
||||
public int keyAction() {
|
||||
return KeyAction.TAG_DANGER;
|
||||
return SPDAction.TAG_DANGER;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.watabou.input.KeyAction;
|
||||
|
||||
public class LootIndicator extends Tag {
|
||||
|
||||
@@ -43,7 +43,7 @@ public class LootIndicator extends Tag {
|
||||
|
||||
@Override
|
||||
public int keyAction() {
|
||||
return KeyAction.TAG_LOOT;
|
||||
return SPDAction.TAG_LOOT;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
@@ -31,7 +32,6 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
|
||||
import com.watabou.input.KeyAction;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.ui.Button;
|
||||
import com.watabou.utils.PathFinder;
|
||||
@@ -145,13 +145,13 @@ public class QuickSlotButton extends Button implements WndBag.Listener {
|
||||
public int keyAction() {
|
||||
switch (slotNum){
|
||||
case 0:
|
||||
return KeyAction.QUICKSLOT_1;
|
||||
return SPDAction.QUICKSLOT_1;
|
||||
case 1:
|
||||
return KeyAction.QUICKSLOT_2;
|
||||
return SPDAction.QUICKSLOT_2;
|
||||
case 2:
|
||||
return KeyAction.QUICKSLOT_3;
|
||||
return SPDAction.QUICKSLOT_3;
|
||||
case 3:
|
||||
return KeyAction.QUICKSLOT_4;
|
||||
return SPDAction.QUICKSLOT_4;
|
||||
default:
|
||||
return super.keyAction();
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.watabou.input.KeyAction;
|
||||
import com.watabou.noosa.Image;
|
||||
|
||||
public class ResumeIndicator extends Tag {
|
||||
@@ -41,7 +41,7 @@ public class ResumeIndicator extends Tag {
|
||||
|
||||
@Override
|
||||
public int keyAction() {
|
||||
return KeyAction.TAG_RESUME;
|
||||
return SPDAction.TAG_RESUME;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
@@ -32,7 +33,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndGame;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndHero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndJournal;
|
||||
import com.watabou.input.KeyAction;
|
||||
import com.watabou.noosa.BitmapText;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.Game;
|
||||
@@ -90,7 +90,7 @@ public class StatusPane extends Component {
|
||||
|
||||
@Override
|
||||
public int keyAction() {
|
||||
return KeyAction.HERO_INFO;
|
||||
return SPDAction.HERO_INFO;
|
||||
}
|
||||
}.setRect( 0, 1, 30, 30 ));
|
||||
|
||||
@@ -265,7 +265,7 @@ public class StatusPane extends Component {
|
||||
|
||||
@Override
|
||||
public int keyAction() {
|
||||
return KeyAction.JOURNAL;
|
||||
return SPDAction.JOURNAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
@@ -32,7 +33,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTerrainTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndJournal;
|
||||
import com.watabou.input.KeyAction;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.Gizmo;
|
||||
@@ -89,7 +89,7 @@ public class Toolbar extends Component {
|
||||
|
||||
@Override
|
||||
public int keyAction() {
|
||||
return KeyAction.WAIT;
|
||||
return SPDAction.WAIT;
|
||||
}
|
||||
|
||||
protected boolean onLongClick() {
|
||||
@@ -113,7 +113,7 @@ public class Toolbar extends Component {
|
||||
|
||||
@Override
|
||||
public int keyAction() {
|
||||
return KeyAction.SEARCH;
|
||||
return SPDAction.SEARCH;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -133,7 +133,7 @@ public class Toolbar extends Component {
|
||||
|
||||
@Override
|
||||
public int keyAction() {
|
||||
return KeyAction.INVENTORY;
|
||||
return SPDAction.INVENTORY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Chrome;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.ShadowBox;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.watabou.input.KeyAction;
|
||||
import com.watabou.input.KeyBindings;
|
||||
import com.watabou.input.KeyEvent;
|
||||
import com.watabou.input.PointerEvent;
|
||||
@@ -159,10 +159,10 @@ public class Window extends Group implements Signal.Listener<KeyEvent> {
|
||||
public boolean onSignal( KeyEvent event ) {
|
||||
if (event.pressed) {
|
||||
switch (KeyBindings.getBinding( event )) {
|
||||
case KeyAction.BACK:
|
||||
case SPDAction.BACK:
|
||||
onBackPressed();
|
||||
return true;
|
||||
case KeyAction.MENU:
|
||||
case SPDAction.MENU:
|
||||
onMenuPressed();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user