Removed desktop top menu / Rebound pause back to space

This commit is contained in:
Anuken
2018-11-07 15:30:42 -05:00
parent 7953cc416b
commit 0ce08319e7
2 changed files with 52 additions and 46 deletions

View File

@@ -30,7 +30,7 @@ public class DefaultKeybinds{
"zoom", new Axis(Input.SCROLL), "zoom", new Axis(Input.SCROLL),
"zoom_minimap", new Axis(Input.MINUS, Input.PLUS), "zoom_minimap", new Axis(Input.MINUS, Input.PLUS),
"menu", Gdx.app.getType() == ApplicationType.Android ? Input.BACK : Input.ESCAPE, "menu", Gdx.app.getType() == ApplicationType.Android ? Input.BACK : Input.ESCAPE,
"pause", Input.Q, "pause", Input.SPACE,
"toggle_menus", Input.C, "toggle_menus", Input.C,
new Category("multiplayer"), new Category("multiplayer"),
"player_list", Input.TAB, "player_list", Input.TAB,

View File

@@ -54,6 +54,7 @@ public class HudFragment extends Fragment{
cont.top().left().visible(() -> !state.is(State.menu)); cont.top().left().visible(() -> !state.is(State.menu));
if(mobile){
cont.table(select -> { cont.table(select -> {
select.left(); select.left();
select.defaults().size(dsize).left(); select.defaults().size(dsize).left();
@@ -61,12 +62,6 @@ public class HudFragment extends Fragment{
menu = select.addImageButton("icon-menu", isize, ui.paused::show).get(); menu = select.addImageButton("icon-menu", isize, ui.paused::show).get();
flip = select.addImageButton("icon-arrow-up", isize, this::toggleMenus).get(); flip = select.addImageButton("icon-arrow-up", isize, this::toggleMenus).get();
select.update(() -> {
if(Inputs.keyTap("toggle_menus") && !ui.chatfrag.chatOpen()){
toggleMenus();
}
});
select.addImageButton("icon-pause", isize, () -> { select.addImageButton("icon-pause", isize, () -> {
if(Net.active()){ if(Net.active()){
ui.listfrag.toggle(); ui.listfrag.toggle();
@@ -102,6 +97,13 @@ public class HudFragment extends Fragment{
}); });
cont.row(); cont.row();
}
cont.update(() -> {
if(Inputs.keyTap("toggle_menus") && !ui.chatfrag.chatOpen()){
toggleMenus();
}
});
Stack stack = new Stack(); Stack stack = new Stack();
TextButton waves = new TextButton(""); TextButton waves = new TextButton("");
@@ -114,7 +116,7 @@ public class HudFragment extends Fragment{
addWaveTable(waves); addWaveTable(waves);
addPlayButton(btable); addPlayButton(btable);
cont.add(stack).fillX(); cont.add(stack).width(dsize * 4);
cont.row(); cont.row();
@@ -132,7 +134,9 @@ public class HudFragment extends Fragment{
}).size(-1).visible(() -> Settings.getBool("fps")).update(t -> t.setTranslation(0, (!waves.isVisible() ? wavetable.getHeight() : Math.min(wavetable.getTranslation().y, wavetable.getHeight())) )).get(); }).size(-1).visible(() -> Settings.getBool("fps")).update(t -> t.setTranslation(0, (!waves.isVisible() ? wavetable.getHeight() : Math.min(wavetable.getTranslation().y, wavetable.getHeight())) )).get();
//make wave box appear below rest of menu //make wave box appear below rest of menu
if(mobile){
cont.swapActor(wavetable, menu.getParent()); cont.swapActor(wavetable, menu.getParent());
}
}); });
//minimap //minimap
@@ -333,7 +337,9 @@ public class HudFragment extends Fragment{
float dur = 0.3f; float dur = 0.3f;
Interpolation in = Interpolation.pow3Out; Interpolation in = Interpolation.pow3Out;
if(flip != null){
flip.getStyle().imageUp = Core.skin.getDrawable(shown ? "icon-arrow-down" : "icon-arrow-up"); flip.getStyle().imageUp = Core.skin.getDrawable(shown ? "icon-arrow-down" : "icon-arrow-up");
}
if(shown){ if(shown){
shown = false; shown = false;