v1.2.0: reworked default keybinds again

This commit is contained in:
Evan Debenham 2022-02-18 00:24:52 -05:00
parent 3bc9506eaa
commit ccfb7ddfad
6 changed files with 69 additions and 68 deletions

View File

@ -100,7 +100,7 @@ windows.wndkeybindings.menu=Menu
windows.wndkeybindings.hero_info=Hero Info windows.wndkeybindings.hero_info=Hero Info
windows.wndkeybindings.journal=Journal windows.wndkeybindings.journal=Journal
windows.wndkeybindings.wait=Wait windows.wndkeybindings.wait=Wait
windows.wndkeybindings.search=Search windows.wndkeybindings.examine=Examine
windows.wndkeybindings.rest=Rest windows.wndkeybindings.rest=Rest
windows.wndkeybindings.inventory=Inventory windows.wndkeybindings.inventory=Inventory
windows.wndkeybindings.quickslot_1=Quickslot 1 windows.wndkeybindings.quickslot_1=Quickslot 1

View File

@ -65,7 +65,7 @@ public class SPDAction extends GameAction {
public static final GameAction BAG_4 = new SPDAction("bag_4"); public static final GameAction BAG_4 = new SPDAction("bag_4");
public static final GameAction BAG_5 = new SPDAction("bag_5"); public static final GameAction BAG_5 = new SPDAction("bag_5");
public static final GameAction SEARCH = new SPDAction("search"); public static final GameAction EXAMINE = new SPDAction("examine");
public static final GameAction REST = new SPDAction("rest"); public static final GameAction REST = new SPDAction("rest");
public static final GameAction TAG_ATTACK = new SPDAction("tag_attack"); public static final GameAction TAG_ATTACK = new SPDAction("tag_attack");
@ -87,13 +87,14 @@ public class SPDAction extends GameAction {
defaultBindings.put( Input.Keys.W, SPDAction.N ); defaultBindings.put( Input.Keys.W, SPDAction.N );
defaultBindings.put( Input.Keys.A, SPDAction.W ); defaultBindings.put( Input.Keys.A, SPDAction.W );
defaultBindings.put( Input.Keys.X, SPDAction.S ); defaultBindings.put( Input.Keys.S, SPDAction.S );
defaultBindings.put( Input.Keys.D, SPDAction.E ); defaultBindings.put( Input.Keys.D, SPDAction.E );
defaultBindings.put( Input.Keys.Q, SPDAction.NW ); defaultBindings.put( Input.Keys.SPACE, SPDAction.WAIT );
defaultBindings.put( Input.Keys.E, SPDAction.NE );
defaultBindings.put( Input.Keys.Z, SPDAction.SW ); defaultBindings.put( Input.Keys.UP, SPDAction.N );
defaultBindings.put( Input.Keys.C, SPDAction.SE ); defaultBindings.put( Input.Keys.LEFT, SPDAction.W );
defaultBindings.put( Input.Keys.S, SPDAction.WAIT ); defaultBindings.put( Input.Keys.DOWN, SPDAction.S );
defaultBindings.put( Input.Keys.RIGHT, SPDAction.E );
defaultBindings.put( Input.Keys.NUMPAD_8, SPDAction.N ); defaultBindings.put( Input.Keys.NUMPAD_8, SPDAction.N );
defaultBindings.put( Input.Keys.NUMPAD_4, SPDAction.W ); defaultBindings.put( Input.Keys.NUMPAD_4, SPDAction.W );
@ -105,12 +106,7 @@ public class SPDAction extends GameAction {
defaultBindings.put( Input.Keys.NUMPAD_3, SPDAction.SE ); defaultBindings.put( Input.Keys.NUMPAD_3, SPDAction.SE );
defaultBindings.put( Input.Keys.NUMPAD_5, SPDAction.WAIT ); defaultBindings.put( Input.Keys.NUMPAD_5, SPDAction.WAIT );
defaultBindings.put( Input.Keys.UP, SPDAction.N ); defaultBindings.put( Input.Keys.F, SPDAction.INVENTORY );
defaultBindings.put( Input.Keys.LEFT, SPDAction.W );
defaultBindings.put( Input.Keys.DOWN, SPDAction.S );
defaultBindings.put( Input.Keys.RIGHT, SPDAction.E );
defaultBindings.put( Input.Keys.T, SPDAction.INVENTORY );
defaultBindings.put( Input.Keys.I, SPDAction.INVENTORY ); defaultBindings.put( Input.Keys.I, SPDAction.INVENTORY );
defaultBindings.put( Input.Keys.NUM_1, SPDAction.QUICKSLOT_1 ); defaultBindings.put( Input.Keys.NUM_1, SPDAction.QUICKSLOT_1 );
defaultBindings.put( Input.Keys.NUM_2, SPDAction.QUICKSLOT_2 ); defaultBindings.put( Input.Keys.NUM_2, SPDAction.QUICKSLOT_2 );
@ -125,16 +121,15 @@ public class SPDAction extends GameAction {
defaultBindings.put( Input.Keys.F4, SPDAction.BAG_4 ); defaultBindings.put( Input.Keys.F4, SPDAction.BAG_4 );
defaultBindings.put( Input.Keys.F5, SPDAction.BAG_5 ); defaultBindings.put( Input.Keys.F5, SPDAction.BAG_5 );
defaultBindings.put( Input.Keys.G, SPDAction.SEARCH ); defaultBindings.put( Input.Keys.E, SPDAction.EXAMINE );
defaultBindings.put( Input.Keys.B, SPDAction.REST ); defaultBindings.put( Input.Keys.Z, SPDAction.REST );
defaultBindings.put( Input.Keys.R, SPDAction.TAG_ATTACK ); defaultBindings.put( Input.Keys.Q, SPDAction.TAG_ATTACK );
defaultBindings.put( Input.Keys.CONTROL_LEFT, SPDAction.TAG_ATTACK );
defaultBindings.put( Input.Keys.TAB, SPDAction.TAG_DANGER ); defaultBindings.put( Input.Keys.TAB, SPDAction.TAG_DANGER );
defaultBindings.put( Input.Keys.F, SPDAction.TAG_ACTION ); defaultBindings.put( Input.Keys.X, SPDAction.TAG_ACTION );
defaultBindings.put( Input.Keys.V, SPDAction.TAG_LOOT ); defaultBindings.put( Input.Keys.C, SPDAction.TAG_LOOT );
defaultBindings.put( Input.Keys.ENTER, SPDAction.TAG_LOOT ); defaultBindings.put( Input.Keys.ENTER, SPDAction.TAG_LOOT );
defaultBindings.put( Input.Keys.SPACE, SPDAction.TAG_RESUME ); defaultBindings.put( Input.Keys.R, SPDAction.TAG_RESUME );
defaultBindings.put( Input.Keys.H, SPDAction.HERO_INFO ); defaultBindings.put( Input.Keys.H, SPDAction.HERO_INFO );
defaultBindings.put( Input.Keys.J, SPDAction.JOURNAL ); defaultBindings.put( Input.Keys.J, SPDAction.JOURNAL );

View File

@ -195,20 +195,21 @@ public class WelcomeScene extends PixelScene {
text.setPos((w - text.width()) / 2f, (topRegion + 2) + (textSpace - text.height())/2); text.setPos((w - text.width()) / 2f, (topRegion + 2) + (textSpace - text.height())/2);
add(text); add(text);
if (previousVersion <= 593){ if (previousVersion <= 594){
//TODO translate! //TODO translate!
add(new WndHardNotification(Icons.get(Icons.INFO), add(new WndHardNotification(Icons.get(Icons.INFO),
"Key Bindings", "Key Bindings",
"Shattered Pixel Dungeon's default keybindings have changed based on early demo feedback!\n\n" + "Once again, Shattered Pixel Dungeon's default keybindings have changed based on early demo feedback!\n\n" +
"Here's a quick summary of what's been adjusted:\n" + "Here's a quick summary of what's been adjusted:\n" +
"_-_ The WAXD and QEZC keys are now used for movement, S is used for waiting\n" + "_-_ Two movement keys can be pressed at once to move diagonally\n" +
"_-_ The WASD keys are now used for movement\n" +
"_-_ Several game action bindings have been moved around WASD\n" +
"_-_ Quickslots now use the number keys\n" + "_-_ Quickslots now use the number keys\n" +
"_-_ Several game action bindings have been moved to the right of WASD\n" +
"_-_ Inventory bags can now be tabbed through with F1-F5\n" + "_-_ Inventory bags can now be tabbed through with F1-F5\n" +
"_-_ Other bindings (including numpad and arrow keys to move) are unchanged.\n\n" + "_-_ Other bindings (including numpad and arrow keys to move) are unchanged.\n\n" +
"Please let me know if these new bindings work well for you, I am open to further adjustments. All keybinds can still be customized via the settings menu.", "Thanks for your continued feedback, I think these bindings and the new diagonal movement functionality should work very well. All keybinds can still be customized via the settings menu.",
Messages.get(this, "continue"), Messages.get(this, "continue"),
2){ 4){
@Override @Override
public void hide() { public void hide() {
super.hide(); super.hide();

View File

@ -144,12 +144,12 @@ public class Toolbar extends Component {
@Override @Override
public GameAction keyAction() { public GameAction keyAction() {
return SPDAction.SEARCH; return SPDAction.EXAMINE;
} }
@Override @Override
protected String hoverText() { protected String hoverText() {
return Messages.titleCase(Messages.get(WndKeyBindings.class, "search")); return Messages.titleCase(Messages.get(WndKeyBindings.class, "examine"));
} }
@Override @Override

View File

@ -195,7 +195,8 @@ public class Window extends Group implements Signal.Listener<KeyEvent> {
@Override @Override
public boolean onSignal( KeyEvent event ) { public boolean onSignal( KeyEvent event ) {
if (event.pressed) { if (event.pressed) {
if (KeyBindings.getActionForKey( event ) == SPDAction.BACK){ if (KeyBindings.getActionForKey( event ) == SPDAction.BACK
|| KeyBindings.getActionForKey( event ) == SPDAction.WAIT){
onBackPressed(); onBackPressed();
} }
} }

View File

@ -58,15 +58,19 @@ public class WndHardNotification extends WndTitledMessage{
resize(width, (int) btnOkay.bottom()); resize(width, (int) btnOkay.bottom());
} }
float incTime = 0;
@Override @Override
public void update() { public void update() {
super.update(); super.update();
timeLeft -= Game.elapsed; incTime += Game.elapsed;
if (timeLeft <= 0 ){ if (timeLeft <= 0 && !btnOkay.active){
btnOkay.enable(true); btnOkay.enable(true);
btnOkay.text(btnMessage); btnOkay.text(btnMessage);
} else { } else if (timeLeft > 0 && incTime >= 1) {
timeLeft -= incTime;
incTime = 0;
btnOkay.text(btnMessage + " (" + (int)Math.ceil(timeLeft) + ")"); btnOkay.text(btnMessage + " (" + (int)Math.ceil(timeLeft) + ")");
} }