mirror of
https://github.com/yawaflua/Informatis.git
synced 2026-02-04 18:34:19 +02:00
fixed
This commit is contained in:
@@ -49,6 +49,8 @@ public class HudUi {
|
|||||||
Element image;
|
Element image;
|
||||||
Color lastItemColor = Pal.items;
|
Color lastItemColor = Pal.items;
|
||||||
Color lastAmmoColor = Pal.ammo;
|
Color lastAmmoColor = Pal.ammo;
|
||||||
|
Teamc lockedTarget;
|
||||||
|
boolean locked = false;
|
||||||
float charge;
|
float charge;
|
||||||
float a;
|
float a;
|
||||||
int uiIndex = 0;
|
int uiIndex = 0;
|
||||||
@@ -63,11 +65,12 @@ public class HudUi {
|
|||||||
Seq<Float> numbers = new Seq<>(new Float[]{0f,0f,0f,0f,0f,0f});
|
Seq<Float> numbers = new Seq<>(new Float[]{0f,0f,0f,0f,0f,0f});
|
||||||
Seq<Color> colors = new Seq<>(new Color[]{Color.clear,Color.clear,Color.clear,Color.clear,Color.clear,Color.clear});
|
Seq<Color> colors = new Seq<>(new Color[]{Color.clear,Color.clear,Color.clear,Color.clear,Color.clear,Color.clear});
|
||||||
|
|
||||||
|
|
||||||
CoresItemsDisplay coreItems = new CoresItemsDisplay(Team.baseTeams);
|
CoresItemsDisplay coreItems = new CoresItemsDisplay(Team.baseTeams);
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public <T extends Teamc> T getTarget(){
|
public <T extends Teamc> T getTarget(){
|
||||||
|
if(locked && lockedTarget != null) return (T) lockedTarget;
|
||||||
Seq<Unit> units = Groups.unit.intersect(Core.input.mouseWorldX(), Core.input.mouseWorldY(), 4, 4);
|
Seq<Unit> units = Groups.unit.intersect(Core.input.mouseWorldX(), Core.input.mouseWorldY(), 4, 4);
|
||||||
if(units.size > 0) return (T) units.peek();
|
if(units.size > 0) return (T) units.peek();
|
||||||
if(getTile() != null && getTile().build != null) return (T) getTile().build;
|
if(getTile() != null && getTile().build != null) return (T) getTile().build;
|
||||||
@@ -520,27 +523,32 @@ public class HudUi {
|
|||||||
}}.setScaling(Scaling.fit)).size(Scl.scl(4f * 8f))));
|
}}.setScaling(Scaling.fit)).size(Scl.scl(4f * 8f))));
|
||||||
add(new Table(ttt -> {
|
add(new Table(ttt -> {
|
||||||
ttt.add(new Stack(){{
|
ttt.add(new Stack(){{
|
||||||
add(new Table(temp -> {
|
add(new Table(temp -> temp.add(new Image(){{
|
||||||
Image image = new Image(Icon.defenseSmall);
|
update(()->{
|
||||||
temp.add(image).center();
|
TextureRegion region = atlas.find("clear");
|
||||||
}));
|
if(getTarget() instanceof Unit && !((Unit) getTarget()).dead) region = Icon.defenseSmall.getRegion();
|
||||||
|
setDrawable(region);
|
||||||
|
});
|
||||||
|
}}.setScaling(Scaling.fit))));
|
||||||
|
|
||||||
add(new Table(temp -> {
|
add(new Table(temp -> {
|
||||||
Label label = new Label(() -> (getTarget() instanceof Unit && ((Unit) getTarget()).type() != null ? (int)((Unit) getTarget()).type().armor+"" : ""));
|
if(getTarget() instanceof Unit) {
|
||||||
|
Label label = new Label(() -> (getTarget() instanceof Unit && ((Unit) getTarget()).type() != null ? (int) ((Unit) getTarget()).type().armor + "" : ""));
|
||||||
label.setColor(Pal.surge);
|
label.setColor(Pal.surge);
|
||||||
label.setFontScale(0.5f);
|
label.setFontScale(0.5f);
|
||||||
temp.add(label).center();
|
temp.add(label).center();
|
||||||
|
}
|
||||||
temp.pack();
|
temp.pack();
|
||||||
}));
|
}));
|
||||||
}}).padLeft(Scl.scl(2 * 8f)).padBottom(Scl.scl(2 * 8f));
|
}}).padLeft(Scl.scl(2 * 8f)).padBottom(Scl.scl(2 * 8f));
|
||||||
}));
|
}));
|
||||||
}};
|
}};
|
||||||
stack.visibility = () -> !(getTarget() == null || getTarget() instanceof Building);
|
|
||||||
|
|
||||||
Label label = new Label(() -> {
|
Label label = new Label(() -> {
|
||||||
String name = "";if (getTarget() instanceof Unit && ((Unit) getTarget()).type() != null)
|
String name = "";
|
||||||
|
if(getTarget() instanceof Unit && ((Unit) getTarget()).type() != null)
|
||||||
name = "[accent]" + ((Unit) getTarget()).type().localizedName + "[]";
|
name = "[accent]" + ((Unit) getTarget()).type().localizedName + "[]";
|
||||||
else if (getTarget() instanceof Building && ((Building) getTarget()).block() != null) {
|
else if(getTarget() instanceof Building && ((Building) getTarget()).block() != null) {
|
||||||
if(getTarget() instanceof ConstructBlock.ConstructBuild) name = "[accent]" + ((ConstructBlock.ConstructBuild) getTarget()).current.localizedName + "[]";
|
if(getTarget() instanceof ConstructBlock.ConstructBuild) name = "[accent]" + ((ConstructBlock.ConstructBuild) getTarget()).current.localizedName + "[]";
|
||||||
else name = "[accent]" + ((Building) getTarget()).block.localizedName + "[]";
|
else name = "[accent]" + ((Building) getTarget()).block.localizedName + "[]";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,16 +12,13 @@ import arc.math.Mathf;
|
|||||||
import arc.math.geom.Position;
|
import arc.math.geom.Position;
|
||||||
import arc.scene.ui.layout.Scl;
|
import arc.scene.ui.layout.Scl;
|
||||||
import arc.util.Align;
|
import arc.util.Align;
|
||||||
import arc.util.Log;
|
|
||||||
import arc.util.Time;
|
import arc.util.Time;
|
||||||
import arc.util.Tmp;
|
import arc.util.Tmp;
|
||||||
import mindustry.Vars;
|
import mindustry.Vars;
|
||||||
import mindustry.content.Fx;
|
import mindustry.content.Fx;
|
||||||
import mindustry.game.EventType.*;
|
import mindustry.game.EventType.*;
|
||||||
import mindustry.game.Team;
|
import mindustry.game.Team;
|
||||||
import mindustry.gen.Building;
|
|
||||||
import mindustry.gen.Groups;
|
import mindustry.gen.Groups;
|
||||||
import mindustry.gen.Teamc;
|
|
||||||
import mindustry.gen.Unit;
|
import mindustry.gen.Unit;
|
||||||
import mindustry.graphics.Drawf;
|
import mindustry.graphics.Drawf;
|
||||||
import mindustry.graphics.Layer;
|
import mindustry.graphics.Layer;
|
||||||
@@ -115,7 +112,7 @@ public class Main extends Mod {
|
|||||||
|
|
||||||
if(settings.getBool("rangeNearby")) Groups.all.each(entityc ->
|
if(settings.getBool("rangeNearby")) Groups.all.each(entityc ->
|
||||||
(entityc instanceof BaseTurret.BaseTurretBuild || entityc instanceof Unit)
|
(entityc instanceof BaseTurret.BaseTurretBuild || entityc instanceof Unit)
|
||||||
&& player != null && player.team() != ((Ranged) entityc).team(), entityc -> {
|
&& player != null && player.team() != ((Ranged) entityc).team() && ((Ranged) entityc).team() != Team.derelict, entityc -> {
|
||||||
if(entityc instanceof Turret.TurretBuild
|
if(entityc instanceof Turret.TurretBuild
|
||||||
&& !(player.unit().isFlying() && ((Turret)((Turret.TurretBuild) entityc).block).targetAir || !(player.unit().isFlying()) && ((Turret)((Turret.TurretBuild) entityc).block).targetGround)) return;
|
&& !(player.unit().isFlying() && ((Turret)((Turret.TurretBuild) entityc).block).targetAir || !(player.unit().isFlying()) && ((Turret)((Turret.TurretBuild) entityc).block).targetGround)) return;
|
||||||
float range = ((Ranged) entityc).range();
|
float range = ((Ranged) entityc).range();
|
||||||
|
|||||||
Reference in New Issue
Block a user