mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-04 15:27:19 +07:00
Misc UI tweaks + fixed tests
This commit is contained in:
Binary file not shown.
Binary file not shown.
@ -10,7 +10,6 @@ public class Items{
|
||||
phaseFabric, surgeAlloy, sporePod, sand, blastCompound, pyratite, metaglass,
|
||||
beryllium, tungsten, oxide, carbide, fissileMatter, dormantCyst;
|
||||
|
||||
//TODO remove, these are for debugging only
|
||||
public static final Seq<Item> serpuloItems = new Seq<>(), erekirItems = new Seq<>(), erekirOnlyItems = new Seq<>();
|
||||
|
||||
public static void load(){
|
||||
|
@ -32,10 +32,11 @@ public class PausedDialog extends BaseDialog{
|
||||
float dw = 220f;
|
||||
cont.defaults().width(dw).height(55).pad(5f);
|
||||
|
||||
cont.button("@objective", Icon.info, () -> {
|
||||
ui.fullText.show("@objective", state.rules.sector.preset.description);
|
||||
}).padTop(-60f).colspan(2)
|
||||
.visible(() -> state.rules.sector != null && state.rules.sector.preset != null && state.rules.sector.preset.description != null).row();
|
||||
cont.button("@objective", Icon.info, () -> ui.fullText.show("@objective", state.rules.sector.preset.description))
|
||||
.visible(() -> state.rules.sector != null && state.rules.sector.preset != null && state.rules.sector.preset.description != null).padTop(-60f);
|
||||
|
||||
cont.button("@abandon", Icon.cancel, () -> ui.planet.abandonSectorConfirm(state.rules.sector, this::hide)).padTop(-60f)
|
||||
.visible(() -> state.rules.sector != null).row();
|
||||
|
||||
cont.button("@back", Icon.left, this::hide).name("back");
|
||||
cont.button("@settings", Icon.settings, ui.settings::show).name("settings");
|
||||
|
@ -952,33 +952,35 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
dialog.addCloseButton();
|
||||
|
||||
if(sector.hasBase()){
|
||||
dialog.buttons.button("@sector.abandon", Icon.cancel, () -> {
|
||||
ui.showConfirm("@sector.abandon.confirm", () -> {
|
||||
dialog.hide();
|
||||
|
||||
if(sector.isBeingPlayed()){
|
||||
hide();
|
||||
//after dialog is hidden
|
||||
Time.runTask(7f, () -> {
|
||||
//force game over in a more dramatic fashion
|
||||
for(var core : player.team().cores().copy()){
|
||||
core.kill();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
if(sector.save != null){
|
||||
sector.save.delete();
|
||||
}
|
||||
sector.save = null;
|
||||
}
|
||||
updateSelected();
|
||||
});
|
||||
});
|
||||
dialog.buttons.button("@sector.abandon", Icon.cancel, () -> abandonSectorConfirm(sector, dialog::hide));
|
||||
}
|
||||
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
public void abandonSectorConfirm(Sector sector, Runnable listener){
|
||||
ui.showConfirm("@sector.abandon.confirm", () -> {
|
||||
if(listener != null) listener.run();
|
||||
|
||||
if(sector.isBeingPlayed()){
|
||||
hide();
|
||||
//after dialog is hidden
|
||||
Time.runTask(7f, () -> {
|
||||
//force game over in a more dramatic fashion
|
||||
for(var core : player.team().cores().copy()){
|
||||
core.kill();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
if(sector.save != null){
|
||||
sector.save.delete();
|
||||
}
|
||||
sector.save = null;
|
||||
}
|
||||
updateSelected();
|
||||
});
|
||||
}
|
||||
|
||||
void addSurvivedInfo(Sector sector, Table table, boolean wrap){
|
||||
if(!wrap){
|
||||
table.add(sector.planet.allowWaveSimulation ? Core.bundle.format("sectors.underattack", (int)(sector.info.damage * 100)) : "@sectors.underattack.nodamage").wrapLabel(wrap).row();
|
||||
|
@ -221,7 +221,6 @@ public class ApplicationTests{
|
||||
String str2 = JsonIO.write(new Rules(){{
|
||||
attackMode = true;
|
||||
}});
|
||||
Log.info(str2);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user