Cleaned up custom game dialog / Disabled saving in sectors

This commit is contained in:
Anuken 2018-07-26 13:34:20 -04:00
parent 7a3fb9c759
commit 7289c1080c
3 changed files with 9 additions and 39 deletions

View File

@ -43,7 +43,7 @@ public class UI extends SceneModule{
public AboutDialog about;
public RestartDialog restart;
public LevelDialog levels;
public CustomGameDialog levels;
public MapsDialog maps;
public LoadDialog load;
public DiscordDialog discord;
@ -154,7 +154,7 @@ public class UI extends SceneModule{
join = new JoinDialog();
discord = new DiscordDialog();
load = new LoadDialog();
levels = new LevelDialog();
levels = new CustomGameDialog();
language = new LanguageDialog();
settings = new SettingsMenuDialog();
host = new HostDialog();

View File

@ -8,7 +8,6 @@ import io.anuke.mindustry.game.GameMode;
import io.anuke.mindustry.maps.Map;
import io.anuke.mindustry.ui.BorderImage;
import io.anuke.ucore.core.Settings;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.scene.event.Touchable;
import io.anuke.ucore.scene.ui.ButtonGroup;
import io.anuke.ucore.scene.ui.ImageButton;
@ -21,9 +20,9 @@ import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.*;
public class LevelDialog extends FloatingDialog{
public class CustomGameDialog extends FloatingDialog{
public LevelDialog(){
public CustomGameDialog(){
super("$text.level.select");
addCloseButton();
shown(this::setup);
@ -115,31 +114,9 @@ public class LevelDialog extends FloatingDialog{
i++;
}
ImageButton genb = maps.addImageButton("icon-editor", "clear", 16 * 3, () -> {
hide();
//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);
if(world.maps().all().size == 0){
maps.add("$text.maps.none").pad(50);
}
content().add(pane).uniformX();
}

View File

@ -43,20 +43,13 @@ public class PausedDialog extends FloatingDialog{
content().row();
content().addButton("$text.savegame", () -> {
save.show();
});
}).disabled(s -> world.getSector() != null);
content().row();
content().addButton("$text.loadgame", () -> {
load.show();
}).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().addButton("$text.hostserver", () -> {
@ -88,7 +81,7 @@ public class PausedDialog extends FloatingDialog{
state.set(State.playing);
});
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();