mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-08-02 07:59:15 +07:00
Minor planet dialog polish
This commit is contained in:
@ -329,7 +329,7 @@ waves.every = every
|
|||||||
waves.waves = wave(s)
|
waves.waves = wave(s)
|
||||||
waves.perspawn = per spawn
|
waves.perspawn = per spawn
|
||||||
waves.to = to
|
waves.to = to
|
||||||
waves.boss = Boss
|
waves.guardian = Guardian
|
||||||
waves.preview = Preview
|
waves.preview = Preview
|
||||||
waves.edit = Edit...
|
waves.edit = Edit...
|
||||||
waves.copy = Copy to Clipboard
|
waves.copy = Copy to Clipboard
|
||||||
|
@ -197,7 +197,7 @@ public class WaveInfoDialog extends FloatingDialog{
|
|||||||
});
|
});
|
||||||
|
|
||||||
t.row();
|
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.row();
|
||||||
t.button("$waves.remove", () -> {
|
t.button("$waves.remove", () -> {
|
||||||
|
@ -15,6 +15,7 @@ import arc.util.*;
|
|||||||
import arc.util.ArcAnnotate.*;
|
import arc.util.ArcAnnotate.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.ctype.*;
|
import mindustry.ctype.*;
|
||||||
|
import mindustry.game.*;
|
||||||
import mindustry.game.EventType.*;
|
import mindustry.game.EventType.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
@ -46,7 +47,7 @@ public class PlanetDialog extends FloatingDialog{
|
|||||||
private final Vec3 camRelative = new Vec3();
|
private final Vec3 camRelative = new Vec3();
|
||||||
private final ResourcesDialog resources = new ResourcesDialog();
|
private final ResourcesDialog resources = new ResourcesDialog();
|
||||||
|
|
||||||
private float zoom = 1f, smoothZoom = 1f;
|
private float zoom = 1f, smoothZoom = 1f, selectAlpha = 1f;
|
||||||
private Bloom bloom;
|
private Bloom bloom;
|
||||||
private Planet planet = Planets.starter;
|
private Planet planet = Planets.starter;
|
||||||
private @Nullable Sector selected, hovered;
|
private @Nullable Sector selected, hovered;
|
||||||
@ -121,6 +122,7 @@ public class PlanetDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
smoothZoom = Mathf.lerpDelta(smoothZoom, zoom, 0.4f);
|
smoothZoom = Mathf.lerpDelta(smoothZoom, zoom, 0.4f);
|
||||||
|
selectAlpha = Mathf.lerpDelta(selectAlpha, Mathf.num(smoothZoom < 1.9f), 0.1f);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener(new ElementGestureListener(){
|
addListener(new ElementGestureListener(){
|
||||||
@ -277,12 +279,13 @@ public class PlanetDialog extends FloatingDialog{
|
|||||||
draw(sec, shadowColor, -0.001f);
|
draw(sec, shadowColor, -0.001f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sec.hostility >= 0.02f){
|
if(selectAlpha > 0.01f){
|
||||||
drawSelection(sec, Color.scarlet, 0.11f * sec.hostility, -0.02f);
|
float stroke = 0.026f;
|
||||||
}
|
if(sec.save != null){
|
||||||
|
drawSelection(sec, Tmp.c1.set(Team.sharded.color).a(selectAlpha), stroke, -0.01f);
|
||||||
if(sec.save != null){
|
}else if(sec.hostility >= 0.02f){
|
||||||
drawSelection(sec, Color.lime, 0.03f, -0.01f);
|
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.row();
|
||||||
|
|
||||||
stable.button("Launch", Styles.transt, () -> {
|
stable.button(selected.hasSave() ? "Continue" : "Launch", Styles.transt, () -> {
|
||||||
if(selected != null){
|
if(selected != null){
|
||||||
if(selected.is(SectorAttribute.naval)){
|
if(selected.is(SectorAttribute.naval)){
|
||||||
ui.showInfo("You need a naval loadout to launch here.");
|
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();
|
Tmp.v31.set(selected.tile.v).rotate(Vec3.Y, -planet.getRotation()).scl(-1f).nor();
|
||||||
float dot = cam.direction.dot(Tmp.v31);
|
float dot = cam.direction.dot(Tmp.v31);
|
||||||
stable.getColor().a = Math.max(dot, 0f)*2f;
|
stable.getColor().a = Math.max(dot, 0f)*2f;
|
||||||
|
if(stable.getColor().a <= 0.001f){
|
||||||
|
stable.remove();
|
||||||
|
selected = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user