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,
|
phaseFabric, surgeAlloy, sporePod, sand, blastCompound, pyratite, metaglass,
|
||||||
beryllium, tungsten, oxide, carbide, fissileMatter, dormantCyst;
|
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 final Seq<Item> serpuloItems = new Seq<>(), erekirItems = new Seq<>(), erekirOnlyItems = new Seq<>();
|
||||||
|
|
||||||
public static void load(){
|
public static void load(){
|
||||||
|
|||||||
@@ -32,10 +32,11 @@ public class PausedDialog extends BaseDialog{
|
|||||||
float dw = 220f;
|
float dw = 220f;
|
||||||
cont.defaults().width(dw).height(55).pad(5f);
|
cont.defaults().width(dw).height(55).pad(5f);
|
||||||
|
|
||||||
cont.button("@objective", Icon.info, () -> {
|
cont.button("@objective", Icon.info, () -> ui.fullText.show("@objective", state.rules.sector.preset.description))
|
||||||
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);
|
||||||
}).padTop(-60f).colspan(2)
|
|
||||||
.visible(() -> state.rules.sector != null && state.rules.sector.preset != null && state.rules.sector.preset.description != null).row();
|
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("@back", Icon.left, this::hide).name("back");
|
||||||
cont.button("@settings", Icon.settings, ui.settings::show).name("settings");
|
cont.button("@settings", Icon.settings, ui.settings::show).name("settings");
|
||||||
|
|||||||
@@ -952,33 +952,35 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
dialog.addCloseButton();
|
dialog.addCloseButton();
|
||||||
|
|
||||||
if(sector.hasBase()){
|
if(sector.hasBase()){
|
||||||
dialog.buttons.button("@sector.abandon", Icon.cancel, () -> {
|
dialog.buttons.button("@sector.abandon", Icon.cancel, () -> abandonSectorConfirm(sector, dialog::hide));
|
||||||
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.show();
|
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){
|
void addSurvivedInfo(Sector sector, Table table, boolean wrap){
|
||||||
if(!wrap){
|
if(!wrap){
|
||||||
table.add(sector.planet.allowWaveSimulation ? Core.bundle.format("sectors.underattack", (int)(sector.info.damage * 100)) : "@sectors.underattack.nodamage").wrapLabel(wrap).row();
|
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(){{
|
String str2 = JsonIO.write(new Rules(){{
|
||||||
attackMode = true;
|
attackMode = true;
|
||||||
}});
|
}});
|
||||||
Log.info(str2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user