This commit is contained in:
sharlotte
2021-09-12 13:51:26 +09:00
parent 9ff5e0b5d4
commit 259db4a1b3
4 changed files with 35 additions and 6 deletions

View File

@@ -51,8 +51,8 @@ setting.baropacity.name = Health Bar Opacity
setting.baropacity.description = set opacity of unit bar.
setting.uiopacity.name = UI Background Opacity
setting.uiopacity.description = set opacity of ui background.
setting.softRangeOpacity.name = Soft Range Opacity
setting.softRangeOpacity.description = set opacity of soft range.
setting.softRangeOpacity.name = Range Opacity
setting.softRangeOpacity.description = set opacity of range circle.
setting.pathlinelimit.name = PathLines limit
setting.pathlinelimit.description = many lines may cause significant device lag.\nIt must be adjusted to the device environment.

View File

@@ -50,8 +50,8 @@ setting.baropacity.name = 유닛 바 투명도
setting.baropacity.description = 유닛 바의 투명도를 조절합니다.
setting.uiopacity.name = UI 배경 투명도
setting.uiopacity.description = UI 배경 투명도를 조절합니다.
setting.softRangeOpacity.name = 부드러운 사거리 투명도
setting.softRangeOpacity.description = 부드러운 사거리 투명도를 조절합니다.
setting.softRangeOpacity.name = 포탑 사거리 투명도
setting.softRangeOpacity.description = 포탑 사거리 투명도를 조절합니다.
setting.pathlinelimit.name = 단계 경로선 제한
setting.pathlinelimit.description = 다수의 선들은 기기 부하를 크게 일으킵니다.\n기기 환경에 맞추어 조절해야 합니다.

View File

@@ -620,7 +620,7 @@ public class HudUi {
if(getTarget() instanceof ConstructBlock.ConstructBuild cb) name = cb.current.localizedName;
else name = b.block.localizedName;
}
return "[accent]" + (name.length() > 10 ? name.substring(0, 10) + "..." : name) + "[]";
return "[accent]" + (name.length() > 13 ? name.substring(0, 13) + "..." : name) + "[]";
});
label.setFontScale(Scl.scl(modUiScale) * 0.75f);

View File

@@ -22,15 +22,19 @@ import mindustry.logic.LUnitControl;
import mindustry.ui.Fonts;
import mindustry.world.Block;
import mindustry.world.Tile;
import mindustry.world.blocks.defense.ForceProjector;
import mindustry.world.blocks.defense.turrets.*;
import mindustry.world.blocks.distribution.MassDriver;
import mindustry.world.blocks.payloads.PayloadMassDriver;
import mindustry.world.blocks.power.PowerNode;
import mindustry.world.blocks.storage.CoreBlock;
import mindustry.world.blocks.units.CommandCenter;
import mindustry.world.blocks.units.Reconstructor;
import mindustry.world.blocks.units.UnitFactory;
import java.util.Objects;
import static UnitInfo.SUtils.floatFormat;
import static UnitInfo.SVars.*;
import static arc.Core.*;
import static mindustry.Vars.*;
@@ -126,7 +130,32 @@ public class OverDrawer {
if(Core.settings.getBool("unithealthui")) {
Groups.unit.each(FreeBar::draw);
indexer.eachBlock(null, camera.position.x, camera.position.y, 400, b -> true, b -> {
if(b instanceof ForceProjector.ForceBuild force) {
ForceProjector forceBlock = (ForceProjector) force.block;
float max = forceBlock.shieldHealth + forceBlock.phaseShieldBoost * force.phaseHeat;
Fonts.outline.draw((int)b.health + " / " + (int)b.maxHealth,
b.x, b.y - b.block.size * 8 * 0.25f - 2,
Tmp.c1.set(Pal.items).lerp(Pal.health, 1-b.healthf()), (b.block.size == 1 ? 0.3f : 0.25f) * 0.25f * b.block.size, false, Align.center);
Fonts.outline.draw((int)(max-force.buildup) + " / " + (int)max,
b.x, b.y - b.block.size * 8 * 0.25f + 2,
Tmp.c1.set(Pal.shield).lerp(Pal.gray, 1-((max-force.buildup) / max)), (b.block.size == 1 ? 0.3f : 0.25f) * 0.25f * b.block.size, false, Align.center);
}
else if(b instanceof ReloadTurret.ReloadTurretBuild || b instanceof UnitFactory.UnitFactoryBuild || b instanceof Reconstructor.ReconstructorBuild) {
float progress = 0f;
if(b instanceof ReloadTurret.ReloadTurretBuild turret) progress = turret.reload / ((ReloadTurret)turret.block).reloadTime * 100;
if(b instanceof UnitFactory.UnitFactoryBuild factory) progress = factory.fraction() * 100;
if(b instanceof Reconstructor.ReconstructorBuild reconstructor) progress = reconstructor.fraction() * 100;
Fonts.outline.draw((int)b.health + " / " + (int)b.maxHealth,
b.x, b.y - b.block.size * 8 * 0.25f - 2,
Tmp.c1.set(Pal.items).lerp(Pal.health, 1-b.healthf()), (b.block.size == 1 ? 0.3f : 0.25f) * 0.25f * b.block.size, false, Align.center);
Fonts.outline.draw((int)progress + "%",
b.x, b.y - b.block.size * 8 * 0.25f + 2,
Tmp.c1.set(Color.lightGray).lerp(Pal.accent, progress/100), (b.block.size == 1 ? 0.3f : 0.25f) * 0.25f * b.block.size, false, Align.center);
}
else Fonts.outline.draw((int)b.health + " / " + (int)b.maxHealth,
b.x, b.y - b.block.size * 8 * 0.25f,
Tmp.c1.set(Pal.items).lerp(Pal.health, 1-b.healthf()), (b.block.size == 1 ? 0.3f : 0.25f) * 0.25f * b.block.size, false, Align.center);
});