Skip to content

Commit

Permalink
Misc UI tweaks + fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Oct 11, 2022
1 parent a21d908 commit 8bd8fc5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 28 deletions.
Binary file modified core/assets/maps/siege.msav
Binary file not shown.
Binary file modified core/assets/maps/split.msav
Binary file not shown.
1 change: 0 additions & 1 deletion core/src/mindustry/content/Items.java
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down
9 changes: 5 additions & 4 deletions core/src/mindustry/ui/dialogs/PausedDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ void rebuild(){
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");
Expand Down
46 changes: 24 additions & 22 deletions core/src/mindustry/ui/dialogs/PlanetDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -952,33 +952,35 @@ void showStats(Sector sector){
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();
Expand Down
1 change: 0 additions & 1 deletion tests/src/test/java/ApplicationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ void writeRules2(){
String str2 = JsonIO.write(new Rules(){{
attackMode = true;
}});
Log.info(str2);
}

@Test
Expand Down

0 comments on commit 8bd8fc5

Please sign in to comment.