diff --git a/core/assets-raw/sprites/ui/button-disabled.9.png b/core/assets-raw/sprites/ui/button-disabled.9.png index e6ba19a32b..8acc918363 100644 Binary files a/core/assets-raw/sprites/ui/button-disabled.9.png and b/core/assets-raw/sprites/ui/button-disabled.9.png differ diff --git a/core/assets-raw/sprites/ui/check-on-disabled.png b/core/assets-raw/sprites/ui/check-on-disabled.png index 45e57704b9..e5d81bd882 100644 Binary files a/core/assets-raw/sprites/ui/check-on-disabled.png and b/core/assets-raw/sprites/ui/check-on-disabled.png differ diff --git a/core/assets/sprites/sprites4.png b/core/assets/sprites/sprites4.png index 05d351dc7a..49e928c143 100644 Binary files a/core/assets/sprites/sprites4.png and b/core/assets/sprites/sprites4.png differ diff --git a/core/assets/sprites/uiskin.json b/core/assets/sprites/uiskin.json index 6f49fed1a0..50b2cc1912 100644 --- a/core/assets/sprites/uiskin.json +++ b/core/assets/sprites/uiskin.json @@ -112,7 +112,7 @@ }, clear-partial: { down: whiteui, - up: button-select, + up: pane, over: flat-down, font: default-font, fontColor: white, @@ -210,7 +210,7 @@ }, clear-full: { down: whiteui, - up: button-select, + up: pane, over: flat-down }, clear-partial: { diff --git a/core/src/io/anuke/mindustry/core/UI.java b/core/src/io/anuke/mindustry/core/UI.java index 6015376960..032ebb0fb6 100644 --- a/core/src/io/anuke/mindustry/core/UI.java +++ b/core/src/io/anuke/mindustry/core/UI.java @@ -37,7 +37,6 @@ public class UI implements ApplicationListener{ public HudFragment hudfrag; public ChatFragment chatfrag; public PlayerListFragment listfrag; - public BackgroundFragment backfrag; public LoadingFragment loadfrag; public WidgetGroup menuGroup, hudGroup; @@ -159,7 +158,6 @@ public class UI implements ApplicationListener{ hudfrag = new HudFragment(); chatfrag = new ChatFragment(); listfrag = new PlayerListFragment(); - backfrag = new BackgroundFragment(); loadfrag = new LoadingFragment(); editor = new MapEditorDialog(); @@ -197,7 +195,6 @@ public class UI implements ApplicationListener{ Core.scene.add(menuGroup); Core.scene.add(hudGroup); - // backfrag.build(group); control.input().getFrag().build(hudGroup); hudfrag.build(hudGroup); menufrag.build(menuGroup); diff --git a/core/src/io/anuke/mindustry/ui/ItemsDisplay.java b/core/src/io/anuke/mindustry/ui/ItemsDisplay.java index 684cc07aa1..97208b54ab 100644 --- a/core/src/io/anuke/mindustry/ui/ItemsDisplay.java +++ b/core/src/io/anuke/mindustry/ui/ItemsDisplay.java @@ -26,7 +26,7 @@ public class ItemsDisplay extends Table{ top().left(); margin(0); - table("flat", t -> { + table("button", t -> { t.margin(10).marginLeft(15).marginTop(15f); t.add("$launcheditems").colspan(3).left().padBottom(5); t.row(); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java index c6c554633a..d11d73a627 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java @@ -4,14 +4,14 @@ import io.anuke.arc.Core; import io.anuke.arc.collection.Array; import io.anuke.arc.collection.ObjectSet; import io.anuke.arc.collection.ObjectSet.ObjectSetIterator; +import io.anuke.arc.graphics.Color; import io.anuke.arc.graphics.g2d.Draw; import io.anuke.arc.graphics.g2d.Lines; import io.anuke.arc.scene.Group; +import io.anuke.arc.scene.ui.Image; import io.anuke.arc.scene.ui.TextButton; -import io.anuke.arc.scene.ui.layout.Table; -import io.anuke.arc.scene.ui.layout.Unit; -import io.anuke.arc.util.Align; -import io.anuke.arc.util.Structs; +import io.anuke.arc.scene.ui.layout.*; +import io.anuke.arc.util.*; import io.anuke.mindustry.content.Zones; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.game.Saves.SaveSlot; @@ -57,48 +57,53 @@ public class DeployDialog extends FloatingDialog{ Core.settings.save(); } - cont.stack(control.saves.getZoneSlot() == null ? new View() : new Table(){{ - SaveSlot slot = control.saves.getZoneSlot(); + Stack stack = new Stack(); + stack.add(new View()); - TextButton[] b = {null}; + if(control.saves.getZoneSlot() != null){ + stack.add(new Image("whiteui", new Color(0f, 0f, 0f, 0.9f))); + stack.add(new Table(t -> { + SaveSlot slot = control.saves.getZoneSlot(); - TextButton button = addButton(Core.bundle.format("resume", slot.getZone().localizedName()), () -> { - if(b[0].childrenPressed()) return; + TextButton button = t.addButton(Core.bundle.format("resume", slot.getZone().localizedName()), () -> { - hide(); - ui.loadAnd(() -> { - try{ - control.saves.getZoneSlot().load(); - state.set(State.playing); - }catch(SaveException e){ //make sure to handle any save load errors! - e.printStackTrace(); - if(control.saves.getZoneSlot() != null) control.saves.getZoneSlot().delete(); - Core.app.post(() -> ui.showInfo("$save.corrupted")); - show(); - } - }); - }).size(230f).get(); - b[0] = button; + hide(); + ui.loadAnd(() -> { + try{ + control.saves.getZoneSlot().load(); + state.set(State.playing); + }catch(SaveException e){ //make sure to handle any save load errors! + e.printStackTrace(); + if(control.saves.getZoneSlot() != null) control.saves.getZoneSlot().delete(); + Core.app.post(() -> ui.showInfo("$save.corrupted")); + show(); + } + }); + }).size(230f).get(); - String color = "[lightgray]"; + String color = "[lightgray]"; - button.defaults().colspan(2); - button.row(); - button.add(Core.bundle.format("save.wave", color + slot.getWave())); - button.row(); - button.label(() -> Core.bundle.format("save.playtime", color + slot.getPlayTime())); - button.row(); + button.defaults().colspan(2); + button.row(); + button.add(Core.bundle.format("save.wave", color + slot.getWave())); + button.row(); + button.label(() -> Core.bundle.format("save.playtime", color + slot.getPlayTime())); + button.row(); - row(); + t.row(); - addButton("$abandon", () -> { - ui.showConfirm("$warning", "$abandon.text", () -> { - slot.delete(); - setup(); - }); - }).fillX().height(50f).pad(3); + t.addButton("$abandon", () -> { + ui.showConfirm("$warning", "$abandon.text", () -> { + slot.delete(); + setup(); + }); + }).fillX().height(50f).pad(3); + })); + } - }}, new ItemsDisplay()).grow(); + stack.add(new ItemsDisplay()); + + cont.add(stack).grow(); //set up direct and indirect children for(ZoneNode node : nodes){ diff --git a/core/src/io/anuke/mindustry/ui/fragments/BackgroundFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BackgroundFragment.java deleted file mode 100644 index 7450f3128f..0000000000 --- a/core/src/io/anuke/mindustry/ui/fragments/BackgroundFragment.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.anuke.mindustry.ui.fragments; - -import io.anuke.arc.scene.Group; - -public class BackgroundFragment extends Fragment{ - - - @Override - public void build(Group parent){ - - } -} diff --git a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java index 67973ec73b..ec92a19f13 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java @@ -68,7 +68,7 @@ public class MenuFragment extends Fragment{ float logoh = logow * (float)logo.getHeight() / logo.getWidth(); Draw.color(); - Draw.rect(Draw.wrap(logo), (int)(Core.graphics.getWidth() / 2), (int)(Core.graphics.getHeight() - 10 - logoh) + logoh / 2 - (Core.graphics.isPortrait() ? Unit.dp.scl(30f) : 0f), logow, logoh); + Draw.rect(Draw.wrap(logo), (Core.graphics.getWidth() / 2), (int)(Core.graphics.getHeight() - 10 - logoh) + logoh / 2 - (Core.graphics.isPortrait() ? Unit.dp.scl(30f) : 0f), logow, logoh); }).touchable(Touchable.disabled); } @@ -81,11 +81,11 @@ public class MenuFragment extends Fragment{ container.defaults().size(size).pad(5).padTop(4f); MobileButton - play = new MobileButton("icon-play-2", isize, "$play", ui.deploy::show), - maps = new MobileButton("icon-map", isize, "$maps", ui.maps::show), + play = new MobileButton("icon-play-2", isize, "$campaign", ui.deploy::show), custom = new MobileButton("icon-play-custom", isize, "$customgame", this::showCustomSelect), + maps = new MobileButton("icon-load", isize, "$loadgame", ui.load::show), join = new MobileButton("icon-add", isize, "$joingame", ui.join::show), - editor = new MobileButton("icon-editor", isize, "$editor", () -> ui.loadAnd(ui.editor::show)), + editor = new MobileButton("icon-editor", isize, "$editor", ui.maps::show), tools = new MobileButton("icon-tools", isize, "$settings", ui.settings::show), donate = new MobileButton("icon-donate", isize, "$donate", () -> Core.net.openURI(donationURL)), exit = new MobileButton("icon-exit", isize, "$quit", () -> Core.app.exit());