Crash fixes, additional controller support
This commit is contained in:
@@ -31,7 +31,7 @@ public class JoinDialog extends FloatingDialog {
|
||||
Mindustry.platforms.addDialog(join.content().addField(Settings.getString("ip"),text ->{
|
||||
Settings.putString("ip", text);
|
||||
Settings.save();
|
||||
}).size(180f, 54f).get());
|
||||
}).size(180f, 54f).get(), 100);
|
||||
|
||||
join.content().row();
|
||||
join.content().add("$text.server.port").left();
|
||||
|
||||
@@ -51,7 +51,7 @@ public class PausedDialog extends FloatingDialog{
|
||||
content().row();
|
||||
content().addButton("$text.loadgame", () -> {
|
||||
load.show();
|
||||
}).disabled(Net.active());
|
||||
}).disabled(b -> Net.active());
|
||||
|
||||
content().row();
|
||||
|
||||
@@ -93,16 +93,19 @@ public class PausedDialog extends FloatingDialog{
|
||||
|
||||
content().row();
|
||||
|
||||
new imagebutton("icon-load", isize, load::show).text("$text.load").padTop(4f).disabled(Net.active());
|
||||
imagebutton lo = new imagebutton("icon-load", isize, load::show);
|
||||
lo.text("$text.load").padTop(4f);
|
||||
lo.cell.disabled(b -> Net.active());
|
||||
|
||||
new imagebutton("icon-host", isize, () -> {
|
||||
imagebutton ho = new imagebutton("icon-host", isize, () -> {
|
||||
if(Vars.world.getMap().custom){
|
||||
ui.showError("$text.nohost");
|
||||
}else {
|
||||
ui.host.show();
|
||||
}
|
||||
}).text("$text.host")
|
||||
.disabled(b -> Net.active()).padTop(4f);
|
||||
});
|
||||
ho.text("$text.host").padTop(4f);
|
||||
ho.cell.disabled(b -> Net.active());
|
||||
|
||||
new imagebutton("icon-quit", isize, () -> {
|
||||
Vars.ui.showConfirm("$text.confirm", "$text.quit.confirm", () -> {
|
||||
|
||||
@@ -52,6 +52,10 @@ public class ChatFragment extends Table implements Fragment{
|
||||
if(Net.active() && Inputs.keyTap("chat")){
|
||||
toggle();
|
||||
}
|
||||
|
||||
if(GameState.is(State.menu) && messages.size > 0){
|
||||
messages.clear();
|
||||
}
|
||||
});
|
||||
|
||||
setup();
|
||||
@@ -80,7 +84,7 @@ public class ChatFragment extends Table implements Fragment{
|
||||
add(chatfield).padBottom(offsety).padLeft(offsetx).growX().padRight(offsetx).height(28);
|
||||
|
||||
if(Vars.android) {
|
||||
marginBottom(110f);
|
||||
marginBottom(105f);
|
||||
marginRight(240f);
|
||||
}
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ public class HudFragment implements Fragment{
|
||||
new imagebutton("icon-play", 30f, ()->{
|
||||
Vars.control.runWave();
|
||||
}).height(uheight).fillX().right().padTop(-8f).padBottom(-12f).padRight(-36).width(40f).update(l->{
|
||||
boolean vis = Vars.control.getMode().toggleWaves && Vars.control.getEnemiesRemaining() <= 0;
|
||||
boolean vis = Vars.control.getMode().toggleWaves && Vars.control.getEnemiesRemaining() <= 0 && (Net.server() || !Net.active());
|
||||
boolean paused = GameState.is(State.paused) || !vis;
|
||||
|
||||
l.setVisible(vis);
|
||||
|
||||
@@ -131,7 +131,11 @@ public class PlacementFragment implements Fragment{
|
||||
new imagebutton("icon-" + mode.name(), "toggle", 10 * 3, () -> {
|
||||
control.getInput().resetCursor();
|
||||
input.breakMode = mode;
|
||||
if (!mode.both) input.placeMode = mode;
|
||||
if (!mode.both){
|
||||
input.placeMode = mode;
|
||||
}else{
|
||||
input.placeMode = input.lastPlaceMode;
|
||||
}
|
||||
modeText(Bundles.format("text.mode.break", mode.toString()));
|
||||
}).group(breakGroup).get().setName(mode.name());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user