Misc UI tweaks + fixed tests

This commit is contained in:
Anuken
2022-10-10 21:27:11 -04:00
parent a21d908834
commit 8bd8fc5d80
6 changed files with 29 additions and 28 deletions

Binary file not shown.

Binary file not shown.

View File

@ -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(){

View File

@ -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");

View File

@ -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();

View File

@ -221,7 +221,6 @@ public class ApplicationTests{
String str2 = JsonIO.write(new Rules(){{
attackMode = true;
}});
Log.info(str2);
}
@Test