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.
-1
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(){
@@ -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,9 +952,15 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
dialog.addCloseButton();
if(sector.hasBase()){
dialog.buttons.button("@sector.abandon", Icon.cancel, () -> {
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", () -> {
dialog.hide();
if(listener != null) listener.run();
if(sector.isBeingPlayed()){
hide();
@@ -973,10 +979,6 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
}
updateSelected();
});
});
}
dialog.show();
}
void addSurvivedInfo(Sector sector, Table table, boolean wrap){
@@ -221,7 +221,6 @@ public class ApplicationTests{
String str2 = JsonIO.write(new Rules(){{
attackMode = true;
}});
Log.info(str2);
}
@Test