diff --git a/core/assets/fonts/font.woff b/core/assets/fonts/font.woff index 7960523d0f..4d8ed4b9f7 100644 Binary files a/core/assets/fonts/font.woff and b/core/assets/fonts/font.woff differ diff --git a/core/src/mindustry/game/Universe.java b/core/src/mindustry/game/Universe.java index 4e91437a76..ec4a666e5e 100644 --- a/core/src/mindustry/game/Universe.java +++ b/core/src/mindustry/game/Universe.java @@ -55,9 +55,22 @@ public class Universe{ public void displayTimeEnd(){ if(!headless){ - state.set(State.paused); + //check if any sectors are under attack to display this + Seq attacked = state.getSector().planet.sectors.select(s -> s.hasWaves() && s.hasBase() && !s.isBeingPlayed()); - ui.announce("Next turn incoming."); + if(attacked.any()){ + state.set(State.paused); + + //TODO localize + String text = attacked.size > 1 ? attacked.size + " sectors attacked." : "Sector " + attacked.first().id + " under attack."; + + ui.hudfrag.sectorText = text; + ui.hudfrag.attackedSectors = attacked; + ui.announce(text); + }else{ + //autorun next turn + universe.runTurn(); + } } } diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index a58bc8ea07..e10fac92f4 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -35,6 +35,10 @@ public class HudFragment extends Fragment{ public final PlacementFragment blockfrag = new PlacementFragment(); + //TODO localize + public String sectorText = "Out of sector time."; + public Seq attackedSectors = new Seq<>(); + private ImageButton flip; private Table lastUnlockTable; private Table lastUnlockLayout; @@ -280,20 +284,27 @@ public class HudFragment extends Fragment{ parent.fill(t -> { t.top().visible(() -> state.isOutOfTime()); t.table(Styles.black5, top -> { - //TODO localize when done - top.add("Out of sector time.").style(Styles.outlineLabel).color(Pal.accent).update(l -> l.color.a = Mathf.absin(Time.globalTime(), 7f, 1f)).colspan(2); + //TODO localize + top.add(sectorText).style(Styles.outlineLabel).color(Pal.accent).update(l -> { + l.color.a = Mathf.absin(Time.globalTime(), 7f, 1f); + l.setText(sectorText); + }).colspan(2); top.row(); top.defaults().pad(2).size(150f, 54f); - top.button("Next Turn", () -> { + //TODO localize + top.button("Ignore", () -> { universe.runTurn(); state.set(State.playing); }); - top.button("Back to Planet", () -> { + //TODO localize + top.button("Switch Sectors", () -> { ui.paused.runExitSave(); - ui.planet.show(); - }); + + + control.playSector(attackedSectors.first()); + }).disabled(b -> attackedSectors.isEmpty()); }).margin(8).growX(); }); @@ -339,6 +350,7 @@ public class HudFragment extends Fragment{ }); //TODO DEBUG: rate table + if(false) parent.fill(t -> { t.bottom().left(); t.table(Styles.black6, c -> { diff --git a/core/src/mindustry/ui/fragments/PlacementFragment.java b/core/src/mindustry/ui/fragments/PlacementFragment.java index 66a96e0ffe..c705b34f6b 100644 --- a/core/src/mindustry/ui/fragments/PlacementFragment.java +++ b/core/src/mindustry/ui/fragments/PlacementFragment.java @@ -31,7 +31,7 @@ public class PlacementFragment extends Fragment{ final int rowWidth = 4; public Category currentCategory = Category.distribution; - Seq returnArray = new Seq<>(); + Seq returnArray = new Seq<>(), returnArray2 = new Seq<>(); Seq returnCatArray = new Seq<>(); boolean[] categoryEmpty = new boolean[Category.all.length]; ObjectMap selectedBlocks = new ObjectMap<>(); @@ -422,7 +422,7 @@ public class PlacementFragment extends Fragment{ } Seq getUnlockedByCategory(Category cat){ - return returnArray.selectFrom(content.blocks(), block -> block.category == cat && block.isVisible() && unlocked(block)).sort((b1, b2) -> Boolean.compare(!b1.isPlaceable(), !b2.isPlaceable())); + return returnArray2.selectFrom(content.blocks(), block -> block.category == cat && block.isVisible() && unlocked(block)).sort((b1, b2) -> Boolean.compare(!b1.isPlaceable(), !b2.isPlaceable())); } Block getSelectedBlock(Category cat){