Cleaned up custom game dialog / Disabled saving in sectors
This commit is contained in:
@@ -43,7 +43,7 @@ public class UI extends SceneModule{
|
|||||||
|
|
||||||
public AboutDialog about;
|
public AboutDialog about;
|
||||||
public RestartDialog restart;
|
public RestartDialog restart;
|
||||||
public LevelDialog levels;
|
public CustomGameDialog levels;
|
||||||
public MapsDialog maps;
|
public MapsDialog maps;
|
||||||
public LoadDialog load;
|
public LoadDialog load;
|
||||||
public DiscordDialog discord;
|
public DiscordDialog discord;
|
||||||
@@ -154,7 +154,7 @@ public class UI extends SceneModule{
|
|||||||
join = new JoinDialog();
|
join = new JoinDialog();
|
||||||
discord = new DiscordDialog();
|
discord = new DiscordDialog();
|
||||||
load = new LoadDialog();
|
load = new LoadDialog();
|
||||||
levels = new LevelDialog();
|
levels = new CustomGameDialog();
|
||||||
language = new LanguageDialog();
|
language = new LanguageDialog();
|
||||||
settings = new SettingsMenuDialog();
|
settings = new SettingsMenuDialog();
|
||||||
host = new HostDialog();
|
host = new HostDialog();
|
||||||
|
|||||||
+5
-28
@@ -8,7 +8,6 @@ import io.anuke.mindustry.game.GameMode;
|
|||||||
import io.anuke.mindustry.maps.Map;
|
import io.anuke.mindustry.maps.Map;
|
||||||
import io.anuke.mindustry.ui.BorderImage;
|
import io.anuke.mindustry.ui.BorderImage;
|
||||||
import io.anuke.ucore.core.Settings;
|
import io.anuke.ucore.core.Settings;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
|
||||||
import io.anuke.ucore.scene.event.Touchable;
|
import io.anuke.ucore.scene.event.Touchable;
|
||||||
import io.anuke.ucore.scene.ui.ButtonGroup;
|
import io.anuke.ucore.scene.ui.ButtonGroup;
|
||||||
import io.anuke.ucore.scene.ui.ImageButton;
|
import io.anuke.ucore.scene.ui.ImageButton;
|
||||||
@@ -21,9 +20,9 @@ import io.anuke.ucore.util.Mathf;
|
|||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class LevelDialog extends FloatingDialog{
|
public class CustomGameDialog extends FloatingDialog{
|
||||||
|
|
||||||
public LevelDialog(){
|
public CustomGameDialog(){
|
||||||
super("$text.level.select");
|
super("$text.level.select");
|
||||||
addCloseButton();
|
addCloseButton();
|
||||||
shown(this::setup);
|
shown(this::setup);
|
||||||
@@ -115,31 +114,9 @@ public class LevelDialog extends FloatingDialog{
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageButton genb = maps.addImageButton("icon-editor", "clear", 16 * 3, () -> {
|
if(world.maps().all().size == 0){
|
||||||
hide();
|
maps.add("$text.maps.none").pad(50);
|
||||||
//TODO
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
ui.loadfrag.show();
|
|
||||||
|
|
||||||
Timers.run(5f, () -> {
|
|
||||||
Cursors.restoreCursor();
|
|
||||||
threads.run(() -> {
|
|
||||||
world.loadSector(0, 0);
|
|
||||||
logic.play();
|
|
||||||
Gdx.app.postRunnable(ui.loadfrag::hide);
|
|
||||||
});
|
|
||||||
});*/
|
|
||||||
}).width(170).fillY().pad(4f).get();
|
|
||||||
|
|
||||||
genb.top();
|
|
||||||
genb.margin(5);
|
|
||||||
genb.clearChildren();
|
|
||||||
genb.add(new BorderImage(Draw.region("icon-generated"), 3f)).size(images);
|
|
||||||
genb.row();
|
|
||||||
genb.add("$text.map.random").growX().wrap().pad(3f).get().setAlignment(Align.center, Align.center);
|
|
||||||
genb.row();
|
|
||||||
genb.add("<generated>").pad(3f);
|
|
||||||
|
|
||||||
content().add(pane).uniformX();
|
content().add(pane).uniformX();
|
||||||
}
|
}
|
||||||
@@ -43,20 +43,13 @@ public class PausedDialog extends FloatingDialog{
|
|||||||
content().row();
|
content().row();
|
||||||
content().addButton("$text.savegame", () -> {
|
content().addButton("$text.savegame", () -> {
|
||||||
save.show();
|
save.show();
|
||||||
});
|
}).disabled(s -> world.getSector() != null);
|
||||||
|
|
||||||
content().row();
|
content().row();
|
||||||
content().addButton("$text.loadgame", () -> {
|
content().addButton("$text.loadgame", () -> {
|
||||||
load.show();
|
load.show();
|
||||||
}).disabled(b -> Net.active());
|
}).disabled(b -> Net.active());
|
||||||
|
|
||||||
//Local multiplayer is currently functional, but disabled.
|
|
||||||
/*
|
|
||||||
content().row();
|
|
||||||
content().addButton("$text.addplayers", () -> {
|
|
||||||
ui.localplayers.show();
|
|
||||||
}).disabled(b -> Net.active());*/
|
|
||||||
|
|
||||||
content().row();
|
content().row();
|
||||||
|
|
||||||
content().addButton("$text.hostserver", () -> {
|
content().addButton("$text.hostserver", () -> {
|
||||||
@@ -88,7 +81,7 @@ public class PausedDialog extends FloatingDialog{
|
|||||||
state.set(State.playing);
|
state.set(State.playing);
|
||||||
});
|
});
|
||||||
content().addRowImageTextButton("$text.settings", "icon-tools", isize, ui.settings::show);
|
content().addRowImageTextButton("$text.settings", "icon-tools", isize, ui.settings::show);
|
||||||
content().addRowImageTextButton("$text.save", "icon-save", isize, save::show);
|
content().addRowImageTextButton("$text.save", "icon-save", isize, save::show).disabled(b -> world.getSector() != null);
|
||||||
|
|
||||||
content().row();
|
content().row();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user