update icon lol
|
Before Width: | Height: | Size: 119 B After Width: | Height: | Size: 119 B |
|
Before Width: | Height: | Size: 119 B After Width: | Height: | Size: 119 B |
|
Before Width: | Height: | Size: 253 B After Width: | Height: | Size: 253 B |
|
Before Width: | Height: | Size: 243 B After Width: | Height: | Size: 243 B |
|
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 270 B |
|
Before Width: | Height: | Size: 284 B After Width: | Height: | Size: 284 B |
|
Before Width: | Height: | Size: 471 B After Width: | Height: | Size: 471 B |
|
Before Width: | Height: | Size: 412 B After Width: | Height: | Size: 412 B |
|
Before Width: | Height: | Size: 421 B After Width: | Height: | Size: 421 B |
|
Before Width: | Height: | Size: 385 B After Width: | Height: | Size: 385 B |
|
Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 426 B |
|
Before Width: | Height: | Size: 384 B After Width: | Height: | Size: 384 B |
|
Before Width: | Height: | Size: 464 B After Width: | Height: | Size: 464 B |
|
Before Width: | Height: | Size: 385 B After Width: | Height: | Size: 385 B |
BIN
assets/sprites/ui/icons/ammo.png
Normal file
|
After Width: | Height: | Size: 304 B |
BIN
assets/sprites/ui/icons/health.png
Normal file
|
After Width: | Height: | Size: 210 B |
BIN
assets/sprites/ui/icons/item.png
Normal file
|
After Width: | Height: | Size: 295 B |
BIN
assets/sprites/ui/icons/liquid.png
Normal file
|
After Width: | Height: | Size: 308 B |
BIN
assets/sprites/ui/icons/power.png
Normal file
|
After Width: | Height: | Size: 265 B |
BIN
assets/sprites/ui/icons/reload.png
Normal file
|
After Width: | Height: | Size: 330 B |
BIN
assets/sprites/ui/icons/shield.png
Normal file
|
After Width: | Height: | Size: 312 B |
@@ -4,6 +4,7 @@ import UnitInfo.core.*;
|
||||
import arc.Core;
|
||||
import arc.files.*;
|
||||
import arc.graphics.g2d.TextureRegion;
|
||||
import arc.math.geom.Rect;
|
||||
import arc.scene.ui.TextButton;
|
||||
import arc.scene.ui.layout.Scl;
|
||||
import arc.scene.ui.layout.Table;
|
||||
@@ -15,12 +16,11 @@ import static arc.Core.settings;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class SVars {
|
||||
public static Fi modRoot = modDirectory.child("UnitInfo");
|
||||
public static SettingS settingAdder = new SettingS();
|
||||
public static HudUi hud = new HudUi();
|
||||
public static TextureRegion clear = atlas.find("clear");
|
||||
public static TextureRegion error = atlas.find("error");
|
||||
public static float modUiScale = settings.getInt("infoUiScale") / 100f == 0 ? 1 : settings.getInt("infoUiScale") / 100f;
|
||||
public static boolean pathLine = false, unitLine = false, logicLine = false;
|
||||
public static Seq<Tile> pathTiles = new Seq<>();
|
||||
public static TextureRegion clear = atlas.find("clear");
|
||||
public static TextureRegion error = atlas.find("error");
|
||||
}
|
||||
|
||||
@@ -92,6 +92,19 @@ public class BarInfo {
|
||||
colors.set(1, Pal.shield);
|
||||
numbers.set(1, (max-force.buildup)/max);
|
||||
}
|
||||
else if(target instanceof MendProjector.MendBuild mend){
|
||||
strings.set(1, bundle.format("shar-stat.progress", floatFormat((float) mend.sense(LAccess.progress) * 100f)));
|
||||
colors.set(1, Pal.heal);
|
||||
numbers.set(1, (float) mend.sense(LAccess.progress));
|
||||
}
|
||||
else if(target instanceof OverdriveProjector.OverdriveBuild over){
|
||||
Field ohno = OverdriveProjector.OverdriveBuild.class.getDeclaredField("charge");
|
||||
ohno.setAccessible(true);
|
||||
float charge = (float) ohno.get(over);
|
||||
strings.set(1, bundle.format("shar-stat.progress", floatFormat(Mathf.clamp(charge/((OverdriveProjector)over.block).reload) * 100f)));
|
||||
colors.set(1, Color.valueOf("feb380"));
|
||||
numbers.set(1, Mathf.clamp(charge/((OverdriveProjector)over.block).reload));
|
||||
}
|
||||
else if(target instanceof ConstructBlock.ConstructBuild build){
|
||||
strings.set(1, bundle.format("shar-stat.progress", floatFormat(build.progress * 100)));
|
||||
colors.set(1, Pal.darkerMetal);
|
||||
@@ -107,19 +120,6 @@ public class BarInfo {
|
||||
colors.set(1, Pal.darkerMetal);
|
||||
numbers.set(1, reconstruct.fraction());
|
||||
}
|
||||
else if(target instanceof MendProjector.MendBuild mend){
|
||||
strings.set(1, bundle.format("shar-stat.progress", floatFormat((float) mend.sense(LAccess.progress) * 100f)));
|
||||
colors.set(1, Pal.heal);
|
||||
numbers.set(1, (float) mend.sense(LAccess.progress));
|
||||
}
|
||||
else if(target instanceof OverdriveProjector.OverdriveBuild over){
|
||||
Field ohno = OverdriveProjector.OverdriveBuild.class.getDeclaredField("charge");
|
||||
ohno.setAccessible(true);
|
||||
float charge = (float) ohno.get(over);
|
||||
strings.set(1, bundle.format("shar-stat.progress", floatFormat(Mathf.clamp(charge/((OverdriveProjector)over.block).reload) * 100f)));
|
||||
colors.set(1, Color.valueOf("feb380"));
|
||||
numbers.set(1, Mathf.clamp(charge/((OverdriveProjector)over.block).reload));
|
||||
}
|
||||
else if(target instanceof Drill.DrillBuild drill){
|
||||
strings.set(1, bundle.format("shar-stat.progress", floatFormat((float) drill.sense(LAccess.progress) * 100f)));
|
||||
colors.set(1, drill.dominantItem == null ? Pal.items : drill.dominantItem.color);
|
||||
@@ -135,12 +135,12 @@ public class BarInfo {
|
||||
numbers.set(1, (float) crafter.sense(LAccess.progress));
|
||||
}
|
||||
else if(target instanceof PowerNode.PowerNodeBuild node){
|
||||
strings.set(1, bundle.format("bar.powerstored", floatFormat(node.power.graph.getLastPowerStored()), floatFormat(node.power.graph.getLastCapacity())));
|
||||
strings.set(1, bundle.format("bar.power", floatFormat(node.power.graph.getLastPowerStored()), floatFormat(node.power.graph.getLastCapacity())));
|
||||
colors.set(1, Pal.powerBar);
|
||||
numbers.set(1, node.power.graph.getLastPowerStored() / node.power.graph.getLastCapacity());
|
||||
}
|
||||
else if(target instanceof PowerGenerator.GeneratorBuild generator){
|
||||
strings.set(1, bundle.format("bar.poweroutput", floatFormat(generator.getPowerProduction() * generator.timeScale() * 60f)));
|
||||
strings.set(1, bundle.format("bar.power", floatFormat(generator.getPowerProduction() * generator.timeScale() * 60f)));
|
||||
colors.set(1, Pal.powerBar);
|
||||
numbers.set(1, generator.productionEfficiency);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package UnitInfo.core;
|
||||
|
||||
import UnitInfo.SVars;
|
||||
import UnitInfo.ui.*;
|
||||
import arc.*;
|
||||
import arc.graphics.*;
|
||||
@@ -30,11 +31,22 @@ import mindustry.type.ammo.*;
|
||||
import mindustry.ui.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.*;
|
||||
import mindustry.world.blocks.defense.ForceProjector;
|
||||
import mindustry.world.blocks.defense.MendProjector;
|
||||
import mindustry.world.blocks.defense.OverdriveProjector;
|
||||
import mindustry.world.blocks.defense.turrets.*;
|
||||
import mindustry.world.blocks.distribution.MassDriver;
|
||||
import mindustry.world.blocks.payloads.Payload;
|
||||
import mindustry.world.blocks.payloads.PayloadMassDriver;
|
||||
import mindustry.world.blocks.power.PowerGenerator;
|
||||
import mindustry.world.blocks.power.PowerNode;
|
||||
import mindustry.world.blocks.power.ThermalGenerator;
|
||||
import mindustry.world.blocks.production.AttributeCrafter;
|
||||
import mindustry.world.blocks.production.Drill;
|
||||
import mindustry.world.blocks.production.GenericCrafter;
|
||||
import mindustry.world.blocks.production.SolidPump;
|
||||
import mindustry.world.blocks.units.Reconstructor;
|
||||
import mindustry.world.blocks.units.UnitFactory;
|
||||
|
||||
import static UnitInfo.SVars.*;
|
||||
import static arc.Core.*;
|
||||
@@ -76,6 +88,8 @@ public class HudUi {
|
||||
public Seq<PayloadMassDriver.PayloadDriverBuild> linkedPayloadMasses = new Seq<>();
|
||||
public Seq<Building> linkedNodes = new Seq<>();
|
||||
|
||||
public final Rect scissor = new Rect();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends Teamc> T getTarget(){
|
||||
if(locked && lockedTarget != null) {
|
||||
@@ -506,163 +520,131 @@ public class HudUi {
|
||||
ui.hudGroup.addChild(mainTable);
|
||||
}
|
||||
|
||||
public void addBars(){
|
||||
bars.clear();
|
||||
lastColors.set(2, colors.get(2));
|
||||
{
|
||||
int i = 0;
|
||||
bars.add(new SBar(
|
||||
() -> strings.get(i),
|
||||
() -> {
|
||||
if (colors.get(i) != Color.clear) lastColors.set(i, colors.get(i));
|
||||
return lastColors.get(i);
|
||||
},
|
||||
() -> numbers.get(i)
|
||||
));
|
||||
public TextureRegion getRegions(int i){
|
||||
Teamc target = getTarget();
|
||||
|
||||
TextureRegion region = clear;
|
||||
if(i == 0){
|
||||
if(target instanceof Healthc) region = SIcons.health;
|
||||
} else if(i == 1){
|
||||
if(target instanceof Turret.TurretBuild ||
|
||||
target instanceof MassDriver.MassDriverBuild){
|
||||
region = SIcons.reload;
|
||||
} else if((target instanceof Unit unit && unit.type != null) ||
|
||||
target instanceof ForceProjector.ForceBuild){
|
||||
region = SIcons.shield;
|
||||
} else if(target instanceof MendProjector.MendBuild ||
|
||||
target instanceof OverdriveProjector.OverdriveBuild ||
|
||||
target instanceof ConstructBlock.ConstructBuild ||
|
||||
target instanceof UnitFactory.UnitFactoryBuild ||
|
||||
target instanceof Reconstructor.ReconstructorBuild ||
|
||||
target instanceof Drill.DrillBuild ||
|
||||
target instanceof GenericCrafter.GenericCrafterBuild){
|
||||
//region = SIcons.progress;
|
||||
} else if(target instanceof PowerNode.PowerNodeBuild ||
|
||||
target instanceof PowerGenerator.GeneratorBuild){
|
||||
region = SIcons.power;
|
||||
}
|
||||
{
|
||||
int i = 1;
|
||||
bars.add(new SBar(
|
||||
() -> strings.get(i),
|
||||
() -> {
|
||||
if (colors.get(i) != Color.clear) lastColors.set(i, colors.get(i));
|
||||
return lastColors.get(i);
|
||||
},
|
||||
() -> numbers.get(i)
|
||||
));
|
||||
} else if(i == 2){
|
||||
if(target instanceof ItemTurret.ItemTurretBuild){
|
||||
region = SIcons.ammo;
|
||||
} else if(target instanceof LiquidTurret.LiquidTurretBuild){
|
||||
region = SIcons.liquid;
|
||||
} else if(target instanceof PowerTurret.PowerTurretBuild ||
|
||||
target instanceof PowerNode.PowerNodeBuild){
|
||||
region = SIcons.power;
|
||||
} else if((target instanceof Building b && b.block.hasItems) ||
|
||||
(target instanceof Unit unit && unit.type != null)){
|
||||
region = SIcons.item;
|
||||
}
|
||||
bars.add(new Stack(){{
|
||||
} else if(i == 3){
|
||||
if(target instanceof Unit unit && unit.type != null ||
|
||||
target instanceof UnitFactory.UnitFactoryBuild ||
|
||||
target instanceof Reconstructor.ReconstructorBuild){
|
||||
region = Icon.units.getRegion();
|
||||
} else if(target instanceof AttributeCrafter.AttributeCrafterBuild ||
|
||||
target instanceof SolidPump.SolidPumpBuild ||
|
||||
target instanceof ThermalGenerator.ThermalGeneratorBuild){
|
||||
//region = SIcons.attr;
|
||||
} else if(target instanceof PowerNode.PowerNodeBuild){
|
||||
region = SIcons.power;
|
||||
} else if(target instanceof OverdriveProjector.OverdriveBuild){
|
||||
//region = SIcons.boost;
|
||||
}
|
||||
} else if(i == 4){
|
||||
if(target instanceof Unit unit && target instanceof Payloadc && unit.type != null){
|
||||
|
||||
} else if(target instanceof PowerNode.PowerNodeBuild){
|
||||
region = SIcons.power;
|
||||
} else if(target instanceof Building b && b.block.hasLiquids){
|
||||
region = SIcons.liquid;
|
||||
}
|
||||
} else if(i == 5){
|
||||
if(target instanceof Unit unit && state.rules.unitAmmo && unit.type != null){
|
||||
region = SIcons.ammo;
|
||||
}else if(target instanceof PowerNode.PowerNodeBuild ||
|
||||
(target instanceof Building b && b.block.consumes.hasPower())){
|
||||
region = SIcons.power;
|
||||
}
|
||||
}
|
||||
|
||||
return region;
|
||||
}
|
||||
public Element addBar(int i){
|
||||
return new Stack(){{
|
||||
add(new Table(t -> {
|
||||
t.top().defaults().width(Scl.scl(modUiScale) * 23 * 8f).height(Scl.scl(modUiScale) * 4f * 8f);
|
||||
int i = 2;
|
||||
t.add(new SBar(
|
||||
() -> BarInfo.strings.get(i),
|
||||
() -> {
|
||||
if(BarInfo.colors.get(i) != Color.clear) lastColors.set(i, BarInfo.colors.get(i));
|
||||
if (BarInfo.colors.get(i) != Color.clear) lastColors.set(i, BarInfo.colors.get(i));
|
||||
return lastColors.get(i);
|
||||
},
|
||||
() -> BarInfo.numbers.get(i)
|
||||
)).growX().left();
|
||||
)).width(Scl.scl(modUiScale) * 24 * 8f).height(Scl.scl(modUiScale) * 4 * 8f).growX().left();
|
||||
}));
|
||||
add(new Table(){{
|
||||
left();
|
||||
update(() -> {
|
||||
if(!Core.settings.getBool("infoui")) return;
|
||||
Element image = new Element();
|
||||
if(getTarget() instanceof ItemTurret.ItemTurretBuild turret){
|
||||
if(turret.hasAmmo()) image = new Image(((ItemTurret)turret.block).ammoTypes.findKey(turret.peekAmmo(), true).uiIcon);
|
||||
else {MultiReqImage itemReq = new MultiReqImage();
|
||||
for(Item item : ((ItemTurret) turret.block).ammoTypes.keys())
|
||||
itemReq.add(new ReqImage(item.uiIcon, turret::hasAmmo));
|
||||
image = itemReq;
|
||||
}
|
||||
}
|
||||
else if(getTarget() instanceof LiquidTurret.LiquidTurretBuild turret){
|
||||
MultiReqImage liquidReq = new MultiReqImage();
|
||||
for(Liquid liquid : ((LiquidTurret) turret.block).ammoTypes.keys())
|
||||
liquidReq.add(new ReqImage(liquid.uiIcon, turret::hasAmmo));
|
||||
image = liquidReq;
|
||||
|
||||
if(((LiquidTurret.LiquidTurretBuild) getTarget()).hasAmmo())
|
||||
image = new Image(turret.liquids.current().uiIcon).setScaling(Scaling.fit);
|
||||
}
|
||||
else if(getTarget() instanceof PowerTurret.PowerTurretBuild){
|
||||
image = new Image(Icon.power.getRegion()){
|
||||
add(new Table(t -> {
|
||||
t.right();
|
||||
t.add(new Image(){
|
||||
@Override
|
||||
public void draw(){
|
||||
Building entity = getTarget();
|
||||
float max = entity.block.consumes.getPower().usage;
|
||||
float v = entity.power.status * entity.power.graph.getLastScaledPowerIn();
|
||||
public void draw() {
|
||||
validate();
|
||||
|
||||
super.draw();
|
||||
Lines.stroke(Scl.scl(modUiScale) * 2f, Pal.removeBack);
|
||||
Draw.alpha(1 - v/max);
|
||||
Lines.line(x, y - 2f + height, x + width, y - 2f);
|
||||
Draw.color(Pal.remove);
|
||||
Draw.alpha(1 - v/max);
|
||||
Lines.line(x, y + height, x + width, y);
|
||||
float x = this.x;
|
||||
float y = this.y;
|
||||
float scaleX = this.scaleX;
|
||||
float scaleY = this.scaleY;
|
||||
Draw.color(Color.white);
|
||||
Draw.alpha(parentAlpha * color.a);
|
||||
|
||||
TextureRegionDrawable region = new TextureRegionDrawable(getRegions(i));
|
||||
float rotation = getRotation();
|
||||
if(scaleX != 1 || scaleY != 1 || rotation != 0){
|
||||
region.draw(x + imageX, y + imageY, originX - imageX, originY - imageY,
|
||||
imageWidth, imageHeight, scaleX, scaleY, rotation);
|
||||
return;
|
||||
}
|
||||
region.draw(x + imageX, y + imageY, imageWidth * scaleX, imageHeight * scaleY);
|
||||
|
||||
Draw.color(colors.get(i));
|
||||
if(ScissorStack.push(scissor.set(x, y, imageWidth * scaleX, imageHeight * scaleY * numbers.get(i)))){
|
||||
region.draw(x, y, imageWidth * scaleX, imageHeight * scaleY);
|
||||
ScissorStack.pop();
|
||||
}
|
||||
Draw.reset();
|
||||
}
|
||||
};
|
||||
}
|
||||
clearChildren();
|
||||
add(image).size(iconSmall * Scl.scl(modUiScale)).padBottom(2 * 8f).padRight(3 * 8f);
|
||||
});
|
||||
pack();
|
||||
}});
|
||||
add(new Table(t -> {
|
||||
t.left();
|
||||
t.add(new Image(){{
|
||||
update(() -> {
|
||||
if(!Core.settings.getBool("infoui")) return;
|
||||
if(getTarget() instanceof Unit u && u.stack.item != null && u.stack.amount > 0)
|
||||
setDrawable(u.stack.item.uiIcon);
|
||||
else setDrawable(clear);
|
||||
});
|
||||
visibility = () -> getTarget() instanceof Unit;
|
||||
}}.setScaling(Scaling.fit)).size(Scl.scl(modUiScale) * 30f).padBottom(Scl.scl(modUiScale) * 4 * 8f).padRight(Scl.scl(modUiScale) * 6 * 8f);
|
||||
t.pack();
|
||||
}).size(iconMed * Scl.scl(modUiScale)).padRight(Scl.scl(modUiScale) * 8f);
|
||||
}));
|
||||
}});
|
||||
|
||||
|
||||
{
|
||||
int i = 3;
|
||||
bars.add(new SBar(
|
||||
() -> strings.get(i),
|
||||
() -> {
|
||||
if(colors.get(i) != Color.clear) lastColors.set(i, colors.get(i));
|
||||
return lastColors.get(i);
|
||||
},
|
||||
() -> numbers.get(i)
|
||||
));
|
||||
}};
|
||||
}
|
||||
public void addBars(){
|
||||
bars.clear();
|
||||
|
||||
|
||||
{
|
||||
int i = 4;
|
||||
bars.add(new SBar(
|
||||
() -> strings.get(i),
|
||||
() -> {
|
||||
if(colors.get(i) != Color.clear) lastColors.set(i, colors.get(i));
|
||||
return lastColors.get(i);
|
||||
},
|
||||
() -> numbers.get(i)
|
||||
));
|
||||
}
|
||||
|
||||
bars.add(new Stack(){{
|
||||
add(new Table(t -> {
|
||||
t.top().defaults().width(Scl.scl(modUiScale) * 23 * 8f).height(Scl.scl(modUiScale) * 4 * 8f);
|
||||
|
||||
int i = 5;
|
||||
t.add(new SBar(
|
||||
() -> strings.get(i),
|
||||
() -> {
|
||||
if(colors.get(i) != Color.clear) lastColors.set(i, colors.get(i));
|
||||
return lastColors.get(i);
|
||||
},
|
||||
() -> numbers.get(i)
|
||||
)).growX().left();
|
||||
}));
|
||||
add(new Table(t -> {
|
||||
t.left();
|
||||
t.add(new Image(){{
|
||||
update(() -> {
|
||||
if(!Core.settings.getBool("infoui")) return;
|
||||
TextureRegion region = clear;
|
||||
|
||||
if(Vars.state.rules.unitAmmo && getTarget() instanceof Unit u && u.type != null){
|
||||
UnitType type = u.type;
|
||||
if(type.ammoType instanceof ItemAmmoType ammo) region = ammo.item.uiIcon;
|
||||
else if(type.ammoType instanceof PowerAmmoType) region = Icon.powerSmall.getRegion();
|
||||
}
|
||||
setDrawable(region);
|
||||
});
|
||||
}}.setScaling(Scaling.fit)).size(Scl.scl(modUiScale) * 30f).padBottom(Scl.scl(modUiScale) * 4 * 8f).padRight(Scl.scl(modUiScale) * 6 * 8f);
|
||||
t.pack();
|
||||
}));
|
||||
}});
|
||||
bars.add(addBar(0));
|
||||
bars.add(addBar(1));
|
||||
bars.add(addBar(2));
|
||||
bars.add(addBar(3));
|
||||
bars.add(addBar(4));
|
||||
bars.add(addBar(5));
|
||||
}
|
||||
|
||||
public void addWeaponTable(Table table){
|
||||
@@ -775,7 +757,7 @@ public class HudUi {
|
||||
for(StatusEffect effect : content.statusEffects()){
|
||||
if(applied.get(effect.id) && !effect.isHidden()){
|
||||
t.image(effect.uiIcon).size(iconSmall).get().addListener(new Tooltip(l -> l.label(() ->
|
||||
effect.localizedName + " [lightgray]" + UI.formatTime(st.getDuration(effect))).style(Styles.outlineLabel)){{allowMobile = true;}});
|
||||
effect.localizedName + " [lightgray]" + UI.formatTime(st.getDuration(effect))).style(Styles.outlineLabel)));
|
||||
}
|
||||
}
|
||||
statuses.set(applied);
|
||||
@@ -894,7 +876,7 @@ public class HudUi {
|
||||
});
|
||||
t.row();
|
||||
t.table(tt -> {
|
||||
tt.defaults().height(Scl.scl(modUiScale) * 4f * 8f).pad(0,4,0,4).top();
|
||||
tt.defaults().width(Scl.scl(modUiScale) * 30f * 8f).height(Scl.scl(modUiScale) * 4f * 8f).pad(0,4,0,4).top();
|
||||
for(Element bar : bars){
|
||||
bar.setScale(Scl.scl(modUiScale));
|
||||
tt.add(bar).growX().left();
|
||||
|
||||
@@ -4,7 +4,6 @@ import UnitInfo.ui.*;
|
||||
import arc.*;
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.input.KeyCode;
|
||||
import arc.math.*;
|
||||
import arc.scene.ui.layout.*;
|
||||
import arc.util.*;
|
||||
@@ -12,10 +11,7 @@ import mindustry.*;
|
||||
import mindustry.ai.Pathfinder;
|
||||
import mindustry.ai.types.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.core.Logic;
|
||||
import mindustry.entities.units.AIController;
|
||||
import mindustry.entities.units.UnitCommand;
|
||||
import mindustry.entities.units.UnitController;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
@@ -75,7 +75,7 @@ public class SettingS {
|
||||
t.add(new Label(title + ": ")).left().padRight(5)
|
||||
.update(a -> a.setColor(condition.get() ? Color.white : Color.gray));
|
||||
|
||||
t.field(value[0] + str[0], s -> {
|
||||
t.field((integer ? String.valueOf(value[0]).split("[.]")[0] : value[0]) + str[0], s -> {
|
||||
value[0] = Strings.parseFloat(s);
|
||||
str[0] = h.get(s);
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ public class CoresItemsDisplay {
|
||||
t.clear();
|
||||
|
||||
t.update(() -> {
|
||||
if(!Core.settings.getBool("infoui")) return;
|
||||
core = team.core();
|
||||
heat += Time.delta;
|
||||
|
||||
@@ -109,7 +108,6 @@ public class CoresItemsDisplay {
|
||||
HandCursorListener listener1 = new HandCursorListener();
|
||||
image.addListener(listener1);
|
||||
image.update(() -> {
|
||||
if(!Core.settings.getBool("infoui")) return;
|
||||
image.color.lerp(!listener1.isOver() ? Color.lightGray : Color.white, Mathf.clamp(0.4f * Time.delta));
|
||||
});
|
||||
}
|
||||
@@ -136,7 +134,6 @@ public class CoresItemsDisplay {
|
||||
});
|
||||
t.row();
|
||||
t.table().update(itemTable -> {
|
||||
if(!Core.settings.getBool("infoui")) return;
|
||||
itemTable.clear();
|
||||
final int[] i = {0};
|
||||
for(Item item : content.items()){
|
||||
@@ -165,7 +162,6 @@ public class CoresItemsDisplay {
|
||||
});
|
||||
t.row();
|
||||
t.table().update(unitTable -> {
|
||||
if(!Core.settings.getBool("infoui")) return;
|
||||
unitTable.clear();
|
||||
final int[] i = {0};
|
||||
for(UnitType unit : content.units()){
|
||||
|
||||
14
src/UnitInfo/ui/SIcons.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package UnitInfo.ui;
|
||||
|
||||
import arc.Core;
|
||||
import arc.graphics.g2d.TextureRegion;
|
||||
|
||||
public class SIcons {
|
||||
public static TextureRegion health = Core.atlas.find("unitinfo-health");
|
||||
public static TextureRegion shield = Core.atlas.find("unitinfo-shield");
|
||||
public static TextureRegion item = Core.atlas.find("unitinfo-item");
|
||||
public static TextureRegion liquid = Core.atlas.find("unitinfo-liquid");
|
||||
public static TextureRegion power = Core.atlas.find("unitinfo-power");
|
||||
public static TextureRegion ammo = Core.atlas.find("unitinfo-ammo");
|
||||
public static TextureRegion reload = Core.atlas.find("unitinfo-reload");
|
||||
}
|
||||