From 6938c69d979baa79ef77011179fcb5940714c9c9 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 15 May 2020 22:24:01 -0400 Subject: [PATCH] Minor planet dialog polish --- core/assets/bundles/bundle.properties | 2 +- core/src/mindustry/editor/WaveInfoDialog.java | 2 +- .../mindustry/ui/dialogs/PlanetDialog.java | 23 ++++++++++++------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index c6a53558e8..2b5caeefa1 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -329,7 +329,7 @@ waves.every = every waves.waves = wave(s) waves.perspawn = per spawn waves.to = to -waves.boss = Boss +waves.guardian = Guardian waves.preview = Preview waves.edit = Edit... waves.copy = Copy to Clipboard diff --git a/core/src/mindustry/editor/WaveInfoDialog.java b/core/src/mindustry/editor/WaveInfoDialog.java index a9e42e6326..5dcd6d284b 100644 --- a/core/src/mindustry/editor/WaveInfoDialog.java +++ b/core/src/mindustry/editor/WaveInfoDialog.java @@ -197,7 +197,7 @@ public class WaveInfoDialog extends FloatingDialog{ }); t.row(); - t.check("$waves.boss", b -> group.effect = (b ? StatusEffects.boss : null)).padTop(4).update(b -> b.setChecked(group.effect == StatusEffects.boss)); + t.check("$waves.guardian", b -> group.effect = (b ? StatusEffects.boss : null)).padTop(4).update(b -> b.setChecked(group.effect == StatusEffects.boss)); t.row(); t.button("$waves.remove", () -> { diff --git a/core/src/mindustry/ui/dialogs/PlanetDialog.java b/core/src/mindustry/ui/dialogs/PlanetDialog.java index 55ee0b4441..621abca6bf 100644 --- a/core/src/mindustry/ui/dialogs/PlanetDialog.java +++ b/core/src/mindustry/ui/dialogs/PlanetDialog.java @@ -15,6 +15,7 @@ import arc.util.*; import arc.util.ArcAnnotate.*; import mindustry.content.*; import mindustry.ctype.*; +import mindustry.game.*; import mindustry.game.EventType.*; import mindustry.gen.*; import mindustry.graphics.*; @@ -46,7 +47,7 @@ public class PlanetDialog extends FloatingDialog{ private final Vec3 camRelative = new Vec3(); private final ResourcesDialog resources = new ResourcesDialog(); - private float zoom = 1f, smoothZoom = 1f; + private float zoom = 1f, smoothZoom = 1f, selectAlpha = 1f; private Bloom bloom; private Planet planet = Planets.starter; private @Nullable Sector selected, hovered; @@ -121,6 +122,7 @@ public class PlanetDialog extends FloatingDialog{ } smoothZoom = Mathf.lerpDelta(smoothZoom, zoom, 0.4f); + selectAlpha = Mathf.lerpDelta(selectAlpha, Mathf.num(smoothZoom < 1.9f), 0.1f); }); addListener(new ElementGestureListener(){ @@ -277,12 +279,13 @@ public class PlanetDialog extends FloatingDialog{ draw(sec, shadowColor, -0.001f); } - if(sec.hostility >= 0.02f){ - drawSelection(sec, Color.scarlet, 0.11f * sec.hostility, -0.02f); - } - - if(sec.save != null){ - drawSelection(sec, Color.lime, 0.03f, -0.01f); + if(selectAlpha > 0.01f){ + float stroke = 0.026f; + if(sec.save != null){ + drawSelection(sec, Tmp.c1.set(Team.sharded.color).a(selectAlpha), stroke, -0.01f); + }else if(sec.hostility >= 0.02f){ + drawSelection(sec, Tmp.c1.set(Team.crux.color).a(selectAlpha), stroke, -0.02f); + } } } @@ -379,7 +382,7 @@ public class PlanetDialog extends FloatingDialog{ stable.row(); - stable.button("Launch", Styles.transt, () -> { + stable.button(selected.hasSave() ? "Continue" : "Launch", Styles.transt, () -> { if(selected != null){ if(selected.is(SectorAttribute.naval)){ ui.showInfo("You need a naval loadout to launch here."); @@ -399,6 +402,10 @@ public class PlanetDialog extends FloatingDialog{ Tmp.v31.set(selected.tile.v).rotate(Vec3.Y, -planet.getRotation()).scl(-1f).nor(); float dot = cam.direction.dot(Tmp.v31); stable.getColor().a = Math.max(dot, 0f)*2f; + if(stable.getColor().a <= 0.001f){ + stable.remove(); + selected = null; + } } });