mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-10 03:59:26 +02:00
added scanner, scaling
This commit is contained in:
@@ -13,17 +13,28 @@ shar-stat.power = Power: {0} / {1}
|
||||
|
||||
# Settings
|
||||
setting.wavemax.name = Wave Amount to display
|
||||
setting.rangemax.name = Block Scan Range
|
||||
setting.scan.name = Display block scanner
|
||||
setting.range.name = Display turret range by block scanner
|
||||
setting.select.name = Display select Arrow
|
||||
setting.coreui.name = Display core info UI
|
||||
setting.waveui.name = Display wave info UI
|
||||
setting.unitui.name = Display unit info UI
|
||||
setting.weaponui.name = Display weapon info UI
|
||||
setting.commandedunitui.name = Display command info UI
|
||||
setting.unithealthui.name = Display Unit Bar
|
||||
setting.selectopacity.name = Select Arrow Opacity
|
||||
setting.coreuiopacity.name = Core UI background Opacity
|
||||
setting.waveuiopacity.name = Wave UI background Opacity
|
||||
setting.uiopacity.name = UI background Opacity
|
||||
setting.baropacity.name = Health Bar Opacity
|
||||
setting.coreuiscaling.name = Core UI Scaling [lightgray](need re-load the world)[]
|
||||
setting.waveuiscaling.name = Wave UI Scaling [lightgray](need re-load the world)[]
|
||||
setting.uiscaling.name = UI Scaling [lightgray](need re-load the world)[]
|
||||
|
||||
#Dialog
|
||||
editmaxwave = edit waves
|
||||
invalid = invalid number format or number is too large (<= 2147483647). number will be default(100).
|
||||
editmaxwave = edit waves(int)
|
||||
editrange = edit scan range(int)
|
||||
invalid = invalid number format or number is too large (<= 2147483647). number will be default(100).
|
||||
warn = [red]Warning[]
|
||||
warning = displayed wave amount is too high! it may cause lags.
|
||||
@@ -13,17 +13,28 @@ shar-stat.power = 전력: {0} / {1}
|
||||
|
||||
# Settings
|
||||
setting.wavemax.name = 표시할 단계 수
|
||||
setting.rangemax.name = 블록 스캔 사거리
|
||||
setting.scan.name = 블록 스캐너 표시
|
||||
setting.range.name = 블록 스캐너로 포탑 사거리 표시
|
||||
setting.select.name = 선택 화살표 표시
|
||||
setting.coreui.name = 코어 정보 UI 표시
|
||||
setting.waveui.name = 단계 정보 UI 표시
|
||||
setting.unitui.name = 유닛 정보 UI 표시
|
||||
setting.weaponui.name = 무기 정보 UI 표시
|
||||
setting.commandedunitui.name = 지휘 정보 UI 표시
|
||||
setting.unithealthui.name = 유닛 바 표시
|
||||
setting.selectopacity.name = 선택 화살표 투명도
|
||||
setting.coreuiopacity.name = 코어 UI 배경 투명도
|
||||
setting.waveuiopacity.name = 단계 UI 배경 투명도
|
||||
setting.uiopacity.name = UI 배경 투명도
|
||||
setting.baropacity.name = 유닛 바 투명도
|
||||
setting.coreuiscaling.name = 코어 정보 UI 스케일링 [lightgray](월드를 다시 로드해야 합니다)[]
|
||||
setting.waveuiscaling.name = 단계 정보 UI 스케일링 [lightgray](월드를 다시 로드해야 합니다)[]
|
||||
setting.uiscaling.name = UI 스케일링 [lightgray](월드를 다시 로드해야 합니다)[]
|
||||
|
||||
#Dialog
|
||||
editmaxwave = 최대 단계 수정하기
|
||||
invalid = 잘못된 숫자 형식이거나 최대값(2147483647)을 넘겼습니다. 기본값으로 돌아갑니다(25).
|
||||
editmaxwave = 최대 단계 수정하기(정수)
|
||||
editrange = 스캔 사거리 수정하기(정수)
|
||||
invalid = 잘못된 숫자 형식이거나 최대값(2147483647)을 넘겼습니다. 기본값으로 돌아갑니다(25).
|
||||
warn = [red]경고![]
|
||||
warning = 표시될 웨이브 수가 너무 많습니다! 많은 랙이 걸릴 수 있습니다.
|
||||
@@ -1,6 +1,5 @@
|
||||
package UnitInfo.core;
|
||||
|
||||
import UnitInfo.ui.FreeBar;
|
||||
import UnitInfo.ui.SBar;
|
||||
import arc.Core;
|
||||
import arc.Events;
|
||||
@@ -9,7 +8,6 @@ import arc.graphics.Color;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.Angles;
|
||||
import arc.math.Mathf;
|
||||
import arc.math.geom.Vec2;
|
||||
import arc.scene.Element;
|
||||
import arc.scene.style.TransformDrawable;
|
||||
import arc.scene.ui.*;
|
||||
@@ -112,8 +110,8 @@ public class HudUi {
|
||||
|
||||
bars.add(new Stack(){{
|
||||
add(new Table(t -> {
|
||||
t.defaults().width(Scl.scl(23 * 8f));
|
||||
t.defaults().height(Scl.scl(4f * 8f));
|
||||
t.defaults().width(Scl.scl(23 * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
t.defaults().height(Scl.scl(4f * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
t.top();
|
||||
t.add(new SBar(
|
||||
() -> {
|
||||
@@ -272,7 +270,7 @@ public class HudUi {
|
||||
if(getUnit() instanceof BlockUnitUnit && ((BlockUnitUnit)getUnit()).tile() instanceof ItemTurret.ItemTurretBuild) return;
|
||||
super.draw();
|
||||
}
|
||||
}).size(Scl.scl(30f)).scaling(Scaling.bounded).padBottom(Scl.scl(4 * 8f)).padRight(Scl.scl(6 * 8f));
|
||||
}).size(Scl.scl(30f * (settings.getInt("uiscaling") / 100f))).scaling(Scaling.bounded).padBottom(Scl.scl(4 * 8f * (settings.getInt("uiscaling") / 100f))).padRight(Scl.scl(6 * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
t.pack();
|
||||
}));
|
||||
}});
|
||||
@@ -309,8 +307,8 @@ public class HudUi {
|
||||
));
|
||||
bars.add(new Stack(){{
|
||||
add(new Table(t -> {
|
||||
t.defaults().width(Scl.scl(23 * 8f));
|
||||
t.defaults().height(Scl.scl(4f * 8f));
|
||||
t.defaults().width(Scl.scl(23 * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
t.defaults().height(Scl.scl(4f * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
t.top();
|
||||
t.add(new SBar(
|
||||
() -> Core.bundle.format("shar-stat.ammos", getUnit().ammo, getUnit().type.ammoCapacity),
|
||||
@@ -336,7 +334,7 @@ public class HudUi {
|
||||
}
|
||||
setDrawable(region);
|
||||
});
|
||||
}}).size(Scl.scl(30f)).scaling(Scaling.bounded).padBottom(Scl.scl(4 * 8f)).padRight(Scl.scl(6 * 8f));
|
||||
}}).size(Scl.scl(30f * (settings.getInt("uiscaling") / 100f))).scaling(Scaling.bounded).padBottom(Scl.scl(4 * 8f * (settings.getInt("uiscaling") / 100f))).padRight(Scl.scl(6 * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
t.pack();
|
||||
}));
|
||||
}});
|
||||
@@ -344,13 +342,13 @@ public class HudUi {
|
||||
|
||||
public void addWeapon(){
|
||||
weapon = new Table(tx -> {
|
||||
tx.defaults().minSize(Scl.scl(12 * 8f));
|
||||
tx.defaults().minSize(Scl.scl(12 * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
tx.left();
|
||||
|
||||
if(settings.getBool("commandedunitui") && Groups.unit.count(u -> u.controller() instanceof FormationAI && ((FormationAI)u.controller()).leader == getUnit()) != 0)
|
||||
tx.add(new Table(scene.getStyle(Button.ButtonStyle.class).up, t1 -> t1.table(tt -> {
|
||||
tt.defaults().width(Scl.scl(24/3f * 8f));
|
||||
tt.defaults().minHeight(Scl.scl(12/3f * 8f));
|
||||
tt.defaults().width(Scl.scl(24/3f * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
tt.defaults().minHeight(Scl.scl(12/3f * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
tt.left();
|
||||
tt.top();
|
||||
|
||||
@@ -368,13 +366,13 @@ public class HudUi {
|
||||
unittable.add(new Stack(){{
|
||||
add(new Table(o -> {
|
||||
o.left();
|
||||
o.image(region).size(Scl.scl(30)).scaling(Scaling.bounded);
|
||||
o.image(region).size(Scl.scl(30 * (settings.getInt("uiscaling") / 100f))).scaling(Scaling.bounded);
|
||||
}));
|
||||
|
||||
add(new Table(h -> {
|
||||
h.add(new Stack(){{
|
||||
add(new Table(e -> {
|
||||
e.defaults().growX().height(Scl.scl(9)).width(Scl.scl(42f)).padRight(Scl.scl(2*8)).padTop(Scl.scl(8*2f));
|
||||
e.defaults().growX().height(Scl.scl(9 * (settings.getInt("uiscaling") / 100f))).width(Scl.scl(42f * (settings.getInt("uiscaling") / 100f))).padRight(Scl.scl(2*8 * (settings.getInt("uiscaling") / 100f))).padTop(Scl.scl(8*2f * (settings.getInt("uiscaling") / 100f)));
|
||||
e.left();
|
||||
Bar healthBar = new Bar(
|
||||
() -> "",
|
||||
@@ -385,7 +383,7 @@ public class HudUi {
|
||||
}));
|
||||
add(new Table(e -> e.add(new Stack(){{
|
||||
add(new Table(t -> {
|
||||
t.defaults().growX().height(Scl.scl(9)).width(Scl.scl(42f)).padRight(Scl.scl(2*8)).padTop(Scl.scl(8*5f));
|
||||
t.defaults().growX().height(Scl.scl(9 * (settings.getInt("uiscaling") / 100f))).width(Scl.scl(42f * (settings.getInt("uiscaling") / 100f))).padRight(Scl.scl(2*8 * (settings.getInt("uiscaling") / 100f))).padTop(Scl.scl(8*5f * (settings.getInt("uiscaling") / 100f)));
|
||||
t.left();
|
||||
t.add(new Bar(
|
||||
() -> "",
|
||||
@@ -402,12 +400,12 @@ public class HudUi {
|
||||
if(!Core.settings.getBool("weaponui")) return;
|
||||
setDrawable(unit.stack.item == null || unit.stack.amount <= 0 ? Core.atlas.find("clear") : unit.stack.item.icon(Cicon.small));
|
||||
});
|
||||
}}).size(Scl.scl(2.5f * 8f)).scaling(Scaling.bounded).padBottom(Scl.scl(4 * 8f)).padLeft(Scl.scl(2 * 8f))
|
||||
}}).size(Scl.scl(2.5f * 8f * (settings.getInt("uiscaling") / 100f))).scaling(Scaling.bounded).padBottom(Scl.scl(4 * 8f * (settings.getInt("uiscaling") / 100f))).padLeft(Scl.scl(2 * 8f * (settings.getInt("uiscaling") / 100f)))
|
||||
));
|
||||
Table table = new Table(tt -> {
|
||||
Label label = new Label(() -> unit.stack.item == null || unit.stack.amount <= 0 ? "" : unit.stack.amount + "");
|
||||
|
||||
tt.add(label).padBottom(Scl.scl(1 * 8f)).padLeft(Scl.scl(2 * 8f));
|
||||
label.setFontScale(Scl.scl() * (settings.getInt("uiscaling") / 100f));
|
||||
tt.add(label).padBottom(Scl.scl(1 * 8f * (settings.getInt("uiscaling") / 100f))).padLeft(Scl.scl(2 * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
tt.pack();
|
||||
});
|
||||
add(table);
|
||||
@@ -415,7 +413,7 @@ public class HudUi {
|
||||
t.pack();
|
||||
}));
|
||||
}})));
|
||||
}}).padTop(Scl.scl(2*8)).padRight(Scl.scl(2*8));
|
||||
}}).padTop(Scl.scl(2*8 * (settings.getInt("uiscaling") / 100f))).padRight(Scl.scl(2*8 * (settings.getInt("uiscaling") / 100f)));
|
||||
h.pack();
|
||||
}));
|
||||
}}).left();
|
||||
@@ -430,12 +428,12 @@ public class HudUi {
|
||||
Draw.color(color.r, color.g, color.b, (settings.getInt("uiopacity") / 100f) * this.parentAlpha);
|
||||
getBackground().draw(x, y, width, height);
|
||||
}
|
||||
}).padRight(Scl.scl(24 * 8f));
|
||||
}).padRight(Scl.scl(24 * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
tx.row();
|
||||
if(settings.getBool("weaponui") && type != null && type.weapons.size != 0) tx.add(new Table(scene.getStyle(Button.ButtonStyle.class).up, tt -> {
|
||||
|
||||
tt.defaults().width(Scl.scl(24/3f * 8f));
|
||||
tt.defaults().minHeight(Scl.scl(12/3f * 8f));
|
||||
tt.defaults().width(Scl.scl(24/3f * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
tt.defaults().minHeight(Scl.scl(12/3f * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
tt.left();
|
||||
tt.top();
|
||||
|
||||
@@ -478,13 +476,13 @@ public class HudUi {
|
||||
y += recoil;
|
||||
if(getDrawable() != null) getDrawable().draw(x + imageX, y + imageY, imageWidth * scaleX, imageHeight * scaleY);
|
||||
}
|
||||
}).size(Scl.scl(6 * 8f)).scaling(Scaling.bounded);
|
||||
}).size(Scl.scl(6 * 8f * (settings.getInt("uiscaling") / 100f))).scaling(Scaling.bounded);
|
||||
}));
|
||||
|
||||
add(new Table(h -> {
|
||||
h.add(new Stack(){{
|
||||
add(new Table(e -> {
|
||||
e.defaults().growX().height(Scl.scl(9)).width(Scl.scl(31.5f)).padTop(Scl.scl(9*2f));
|
||||
e.defaults().growX().height(Scl.scl(9 * (settings.getInt("uiscaling") / 100f))).width(Scl.scl(31.5f * (settings.getInt("uiscaling") / 100f))).padTop(Scl.scl(9*2f * (settings.getInt("uiscaling") / 100f)));
|
||||
Bar reloadBar = new Bar(
|
||||
() -> "",
|
||||
() -> Pal.accent.cpy().lerp(Color.orange, mount.reload / weapon.reload),
|
||||
@@ -492,7 +490,7 @@ public class HudUi {
|
||||
e.add(reloadBar);
|
||||
e.pack();
|
||||
}));
|
||||
}}).padLeft(Scl.scl(8f));
|
||||
}}).padLeft(Scl.scl(8f * (settings.getInt("uiscaling") / 100f)));
|
||||
h.pack();
|
||||
}));
|
||||
}}).left();
|
||||
@@ -507,7 +505,7 @@ public class HudUi {
|
||||
Draw.color(color.r, color.g, color.b, (settings.getInt("uiopacity") / 100f) * this.parentAlpha);
|
||||
getBackground().draw(x, y, width, height);
|
||||
}
|
||||
}).padRight(Scl.scl(24 * 8f));
|
||||
}).padRight(Scl.scl(24 * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
tx.setColor(tx.color.cpy().a(1f));
|
||||
});
|
||||
}
|
||||
@@ -516,6 +514,7 @@ public class HudUi {
|
||||
float hh;
|
||||
public void addTable(){
|
||||
Events.run(EventType.Trigger.draw, () -> {
|
||||
if(!Core.settings.getBool("select")) return;
|
||||
Unit unit = getUnit();
|
||||
unitFade = Mathf.lerpDelta(unitFade, Mathf.num(unit != null), 0.1f);
|
||||
if(unit == null) return;
|
||||
@@ -530,7 +529,7 @@ public class HudUi {
|
||||
for(int i = 0; i < 4; i++){
|
||||
float rot = i * 90f + 45f + (-Time.time) % 360f;
|
||||
float length = unit.hitSize * 1.5f + (unitFade * 2.5f);
|
||||
Draw.color(Tmp.c1.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time, 2f, 1f)));
|
||||
Draw.color(Tmp.c1.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time, 2f, 1f)).a(settings.getInt("coreuiopacity") / 100f));
|
||||
Draw.rect("select-arrow", Tmp.v1.x + Angles.trnsx(rot, length), Tmp.v1.y + Angles.trnsy(rot, length), length / 1.9f, length / 1.9f, rot - 135f);
|
||||
Draw.reset();
|
||||
}
|
||||
@@ -540,7 +539,7 @@ public class HudUi {
|
||||
table.left();
|
||||
addBars();
|
||||
table.add(new Table(scene.getStyle(Button.ButtonStyle.class).up, t -> {
|
||||
t.defaults().width(Scl.scl(25 * 8f));
|
||||
t.defaults().width(Scl.scl(25 * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
|
||||
t.table(Tex.underline2, tt -> {
|
||||
Stack stack = new Stack(){{
|
||||
@@ -571,7 +570,8 @@ public class HudUi {
|
||||
Label label = new Label(() -> (int)(getUnit().type == null ? 0 : getUnit().type.armor) + "");
|
||||
label.setColor(Pal.surge);
|
||||
label.setSize(0.6f);
|
||||
temp.add(label).center().padLeft(getUnit().type == null || getUnit().type.armor < Scl.scl(10) ? Scl.scl(-4f) : Scl.scl(0f));
|
||||
label.setFontScale(Scl.scl() * (settings.getInt("uiscaling") / 100f));
|
||||
temp.add(label).center().padLeft(getUnit().type == null || getUnit().type.armor < Scl.scl(10 * (settings.getInt("uiscaling") / 100f)) ? Scl.scl(-4f * (settings.getInt("uiscaling") / 100f)) : Scl.scl(0f * (settings.getInt("uiscaling") / 100f)));
|
||||
temp.pack();
|
||||
}){
|
||||
@Override
|
||||
@@ -580,7 +580,7 @@ public class HudUi {
|
||||
super.draw();
|
||||
}
|
||||
});
|
||||
}}).growX().left().padLeft(Scl.scl(5 * 8f));
|
||||
}}).growX().left().padLeft(Scl.scl(5 * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
}));
|
||||
}};
|
||||
|
||||
@@ -591,7 +591,7 @@ public class HudUi {
|
||||
|
||||
return name;
|
||||
});
|
||||
|
||||
label.setFontScale(Scl.scl() * (settings.getInt("uiscaling") / 100f));
|
||||
TextButton button = Elem.newButton("?", Styles.clearPartialt, () -> {
|
||||
if(getUnit().type != null && getUnit() instanceof BlockUnitUnit && ((BlockUnitUnit)getUnit()).tile() instanceof Turret.TurretBuild) ui.content.show(((BlockUnitUnit)getUnit()).tile().block);
|
||||
else if(getUnit().type != null) ui.content.show(getUnit().type);
|
||||
@@ -602,17 +602,17 @@ public class HudUi {
|
||||
ttt.add(stack);
|
||||
}).left();
|
||||
tt.table(ttt -> { //unit name
|
||||
ttt.defaults().width(Scl.scl(12 * 8f));
|
||||
ttt.add(label).padLeft(Scl.scl(24f));
|
||||
ttt.defaults().width(Scl.scl(12 * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
ttt.add(label).padLeft(Scl.scl(24f * (settings.getInt("uiscaling") / 100f)));
|
||||
}).center();
|
||||
tt.table(ttt -> { //unit info
|
||||
ttt.defaults().size(Scl.scl(5 * 8f));
|
||||
ttt.add(button).padLeft(Scl.scl(-24f));
|
||||
ttt.defaults().size(Scl.scl(5 * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
ttt.add(button).padLeft(Scl.scl(-24f * (settings.getInt("uiscaling") / 100f)));
|
||||
}).right();
|
||||
});
|
||||
t.row();
|
||||
t.table(tt -> {
|
||||
tt.defaults().width(Scl.scl(23 * 8f)).height(Scl.scl(4f * 8f)).top();
|
||||
tt.defaults().width(Scl.scl(23 * 8f * (settings.getInt("uiscaling") / 100f))).height(Scl.scl(4f * 8f * (settings.getInt("uiscaling") / 100f))).top();
|
||||
for(Element bar : bars){
|
||||
tt.add(bar).growX().left();
|
||||
tt.row();
|
||||
@@ -627,7 +627,7 @@ public class HudUi {
|
||||
Draw.color(color.r, color.g, color.b, (settings.getInt("uiopacity") / 100f) * this.parentAlpha);
|
||||
getBackground().draw(x, y, width, height);
|
||||
}
|
||||
}).padRight(Scl.scl(24 * 8f));
|
||||
}).padRight(Scl.scl(24 * 8f * (settings.getInt("uiscaling") / 100f)));
|
||||
table.row();
|
||||
Unit unittemp = getUnit();
|
||||
table.update(() -> {
|
||||
@@ -665,7 +665,7 @@ public class HudUi {
|
||||
core = new Table(tx -> {
|
||||
tx.left();
|
||||
tx.add(new Table(tt -> {
|
||||
tt.defaults().maxWidth(Scl.scl(24/3f * 3f)).left().top();
|
||||
tt.defaults().maxWidth(Scl.scl(24/3f * 3f * (settings.getInt("coreuiscaling") / 100f))).left().top();
|
||||
|
||||
int row = 0;
|
||||
if(Vars.player.unit() == null) return;
|
||||
@@ -687,13 +687,13 @@ public class HudUi {
|
||||
coretable.add(new Stack(){{
|
||||
add(new Table(o -> {
|
||||
o.left();
|
||||
o.add(new Image(region)).size(Scl.scl(6 * 8f)).scaling(Scaling.bounded);
|
||||
o.add(new Image(region)).size(Scl.scl(6 * 8f * (settings.getInt("coreuiscaling") / 100f))).scaling(Scaling.bounded);
|
||||
}));
|
||||
|
||||
add(new Table(h -> {
|
||||
h.add(new Stack(){{
|
||||
add(new Table(e -> {
|
||||
e.defaults().growX().height(Scl.scl(9)).width(Scl.scl(6f * 8f)).padTop(Scl.scl(6 * 8f));
|
||||
e.defaults().growX().height(Scl.scl(9 * (settings.getInt("coreuiscaling") / 100f))).width(Scl.scl(6f * 8f * (settings.getInt("coreuiscaling") / 100f))).padTop(Scl.scl(6 * 8f * (settings.getInt("coreuiscaling") / 100f)));
|
||||
Bar healthBar = new Bar(
|
||||
() -> "",
|
||||
() -> Pal.health,
|
||||
@@ -707,7 +707,9 @@ public class HudUi {
|
||||
}}).center();
|
||||
coretable.row();
|
||||
coretable.center();
|
||||
coretable.label(() -> "(" + (int)core.x / 8 + ", " + (int)core.y / 8 + ")");
|
||||
Label label = new Label(() -> "(" + (int)core.x / 8 + ", " + (int)core.y / 8 + ")");
|
||||
label.setFontScale(Scl.scl());
|
||||
coretable.add(label);
|
||||
}).left();
|
||||
tt.center();
|
||||
}
|
||||
@@ -719,7 +721,7 @@ public class HudUi {
|
||||
Draw.color(color.r, color.g, color.b, (settings.getInt("coreuiopacity") / 100f) * this.parentAlpha);
|
||||
getBackground().draw(x, y, width, height);
|
||||
}
|
||||
}).padLeft(Scl.scl(6 * 8f));
|
||||
}).padLeft(Scl.scl(6 * 8f * (settings.getInt("coreuiscaling") / 100f)));
|
||||
tx.setColor(tx.color.cpy().a(1f));
|
||||
});
|
||||
}
|
||||
@@ -753,7 +755,7 @@ public class HudUi {
|
||||
t.update(() -> {
|
||||
if(coreamount == Vars.player.unit().team().cores().size || !Core.settings.getBool("coreui")) return;
|
||||
t.clearChildren();
|
||||
t.add(pane).maxHeight(Scl.scl(24 * 8f));
|
||||
t.add(pane).maxHeight(Scl.scl(24 * 8f * (settings.getInt("coreuiscaling") / 100f)));
|
||||
});
|
||||
}){
|
||||
@Override
|
||||
@@ -763,7 +765,7 @@ public class HudUi {
|
||||
Draw.color(color.r, color.g, color.b, (settings.getInt("coreuiopacity") / 100f) * this.parentAlpha);
|
||||
getBackground().draw(x, y, width, height);
|
||||
}
|
||||
}).padRight(24 * 8f);
|
||||
}).padRight(Scl.scl(24 * 8f * (settings.getInt("coreuiscaling") / 100f)));
|
||||
|
||||
|
||||
table.fillParent = true;
|
||||
@@ -783,8 +785,10 @@ public class HudUi {
|
||||
if(state.rules.spawns.find(g -> g.getSpawned(j) > 0) != null) table.table(Tex.underline, t -> {
|
||||
t.add(new Table(tt -> {
|
||||
tt.left();
|
||||
tt.add(new Label(() -> "[#" + Pal.accent.toString() + "]" + (j + 1) + "[]"));
|
||||
})).width(32f);
|
||||
Label label = new Label(() -> "[#" + Pal.accent.toString() + "]" + (j + 1) + "[]");
|
||||
label.setFontScale(Scl.scl() * (settings.getInt("waveuiscaling") / 100f));
|
||||
tt.add(label);
|
||||
})).width(Scl.scl(32f * (settings.getInt("waveuiscaling") / 100f)));
|
||||
|
||||
t.table(tx -> {
|
||||
int row = 0;
|
||||
@@ -795,12 +799,16 @@ public class HudUi {
|
||||
tt.right();
|
||||
tt.add(new Stack(){{
|
||||
add(new Table(ttt -> {
|
||||
ttt.center();
|
||||
ttt.add(new Image(group.type.icon(Cicon.large)));
|
||||
ttt.pack();
|
||||
}));
|
||||
|
||||
add(new Table(ttt -> {
|
||||
ttt.bottom().left();
|
||||
ttt.add(new Label(() -> group.getSpawned(j) + ""));
|
||||
Label label = new Label(() -> group.getSpawned(j) + "");
|
||||
label.setFontScale(Scl.scl() * (settings.getInt("waveuiscaling") / 100f));
|
||||
ttt.add(label);
|
||||
ttt.pack();
|
||||
}));
|
||||
|
||||
@@ -808,14 +816,13 @@ public class HudUi {
|
||||
ttt.top().right();
|
||||
Image image = new Image(Icon.warning.getRegion());
|
||||
image.update(() -> image.setColor(Tmp.c2.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time, 2f, 1f))));
|
||||
ttt.add(image).size(12f);
|
||||
ttt.check("h", c->{});
|
||||
ttt.pack();
|
||||
ttt.add(image).size(Scl.scl(12f * (settings.getInt("waveuiscaling") / 100f)));
|
||||
ttt.visible(() -> group.effect == StatusEffects.boss && group.getSpawned(j) > 0);
|
||||
ttt.pack();
|
||||
}));
|
||||
}});
|
||||
|
||||
})).width(Cicon.large.size + 8f);
|
||||
})).width(Scl.scl((Cicon.large.size + 8f) * (settings.getInt("waveuiscaling") / 100f)));
|
||||
if(row % 4 == 0) tx.row();
|
||||
}
|
||||
});
|
||||
@@ -843,7 +850,7 @@ public class HudUi {
|
||||
Draw.color(color.r, color.g, color.b, (settings.getInt("waveuiopacity") / 100f) * this.parentAlpha);
|
||||
getBackground().draw(x, y, width, height);
|
||||
}
|
||||
}).padLeft(6 * 8f);
|
||||
}).padLeft(Scl.scl(6 * 8f * (settings.getInt("waveuiscaling") / 100f)));
|
||||
tx.setColor(tx.color.cpy().a(1f));
|
||||
});
|
||||
}
|
||||
@@ -881,7 +888,7 @@ public class HudUi {
|
||||
}
|
||||
if(maxwave == settings.getInt("wavemax") || !Core.settings.getBool("waveui")) return;
|
||||
t.clearChildren();
|
||||
if(t.getChildren().size < 1) t.add(pane).maxHeight(Scl.scl(24 * 8f));
|
||||
if(t.getChildren().size < 1) t.add(pane).maxHeight(Scl.scl(24 * 8f * (settings.getInt("waveuiscaling") / 100f)));
|
||||
|
||||
if(t.getChildren().size > 1) {
|
||||
while(t.getChildren().size == 1) t.getChildren().pop();
|
||||
@@ -895,11 +902,11 @@ public class HudUi {
|
||||
Draw.color(color.r, color.g, color.b, (settings.getInt("waveuiopacity") / 100f) * this.parentAlpha);
|
||||
getBackground().draw(x, y, width, height);
|
||||
}
|
||||
}).padLeft(56 * 8f);
|
||||
}).padTop(Scl.scl(16 * 8f * (settings.getInt("waveuiscaling") / 100f)));
|
||||
|
||||
|
||||
table.fillParent = true;
|
||||
table.visibility = () ->Core.settings.getBool("waveui") && (
|
||||
table.visibility = () -> Core.settings.getBool("waveui") && (
|
||||
ui.hudfrag.shown && !ui.minimapfrag.shown()
|
||||
&& (!Vars.mobile ||
|
||||
!(Vars.control.input.block != null || !Vars.control.input.selectRequests.isEmpty()
|
||||
|
||||
@@ -3,11 +3,24 @@ package UnitInfo.core;
|
||||
import UnitInfo.ui.FreeBar;
|
||||
import arc.Core;
|
||||
import arc.Events;
|
||||
import arc.graphics.Color;
|
||||
import arc.graphics.g2d.Draw;
|
||||
import arc.graphics.g2d.Lines;
|
||||
import arc.math.Mathf;
|
||||
import arc.struct.Seq;
|
||||
import arc.util.Time;
|
||||
import arc.util.Tmp;
|
||||
import mindustry.Vars;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.game.Team;
|
||||
import mindustry.gen.Building;
|
||||
import mindustry.gen.Groups;
|
||||
import mindustry.graphics.Pal;
|
||||
import mindustry.mod.Mod;
|
||||
|
||||
import static arc.Core.settings;
|
||||
import static mindustry.Vars.indexer;
|
||||
|
||||
public class Main extends Mod {
|
||||
public static Setting settingAdder = new Setting();
|
||||
public static HudUi hud = new HudUi();
|
||||
@@ -36,8 +49,22 @@ public class Main extends Mod {
|
||||
if(Core.settings.getBool("unithealthui"))
|
||||
Groups.unit.each(unit -> new FreeBar().draw(unit));
|
||||
|
||||
});
|
||||
if(Core.settings.getBool("scan")){
|
||||
float range = settings.getInt("wavemax");
|
||||
|
||||
for(Team team : Team.all) {
|
||||
indexer.eachBlock(team, Core.input.mouseWorldX(), Core.input.mouseWorldY(), range, b -> true, b -> new FreeBar().draw(b));
|
||||
}
|
||||
for(int i : Mathf.signs) {
|
||||
Draw.color(Tmp.c1.set(Pal.accent).lerp(Pal.surge, Mathf.absin(4 + i, 1f)).a(0.5f + Mathf.absin(3 + i, 0.5f)));
|
||||
Lines.swirl(Core.input.mouseWorldX(), Core.input.mouseWorldY(), range, 0.1f, i * Time.time % 360);
|
||||
Lines.swirl(Core.input.mouseWorldX(), Core.input.mouseWorldY(), range, 0.1f, 90 + i * Time.time % 360);
|
||||
Lines.swirl(Core.input.mouseWorldX(), Core.input.mouseWorldY(), range, 0.1f, 180 + i * Time.time % 360);
|
||||
Lines.swirl(Core.input.mouseWorldX(), Core.input.mouseWorldY(), range, 0.1f, 270 + i * Time.time % 360);
|
||||
}
|
||||
Draw.reset();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,25 +2,26 @@ package UnitInfo.core;
|
||||
|
||||
import arc.Core;
|
||||
import arc.Input;
|
||||
import arc.graphics.Color;
|
||||
import arc.scene.ui.Dialog;
|
||||
import arc.scene.ui.Label;
|
||||
import arc.scene.ui.SettingsDialog;
|
||||
import arc.scene.ui.TextArea;
|
||||
import arc.scene.ui.layout.Scl;
|
||||
import arc.scene.ui.layout.Table;
|
||||
import arc.util.Align;
|
||||
import arc.util.Log;
|
||||
import mindustry.Vars;
|
||||
import mindustry.gen.Icon;
|
||||
import mindustry.ui.dialogs.BaseDialog;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import static mindustry.Vars.ui;
|
||||
|
||||
public class Setting {
|
||||
public void addGraphicSetting(String key){
|
||||
ui.settings.graphics.checkPref(key, Core.settings.getBool(key));
|
||||
}
|
||||
public void addGraphicTypeSetting(String key, int defs, String dialogs, String invalid){
|
||||
public void addGraphicTypeSetting(String key, int defs, String dialogs, String invalid, int warnMax){
|
||||
ui.settings.graphics.pref(new SettingsDialog.SettingsTable.Setting() {
|
||||
public final int def;
|
||||
{
|
||||
@@ -46,10 +47,38 @@ public class Setting {
|
||||
accepted = str -> {
|
||||
|
||||
try {
|
||||
int number = 0;
|
||||
if(!str.isEmpty() || !(Objects.equals(str, ""))) number = Integer.parseInt(str);
|
||||
Core.settings.put(name, number);
|
||||
label.setText(title + ": " + number);
|
||||
int number = Integer.parseInt(str);
|
||||
if(number >= warnMax){
|
||||
String name1 = name;
|
||||
String title1 = title;
|
||||
new Dialog(""){{
|
||||
setFillParent(true);
|
||||
cont.margin(15f);
|
||||
cont.add("@warn");
|
||||
cont.row();
|
||||
cont.image().width(300f).pad(2).height(4f).color(Color.scarlet);
|
||||
cont.row();
|
||||
cont.add("@warning").pad(2f).growX().wrap().get().setAlignment(Align.center);
|
||||
cont.row();
|
||||
cont.table(t -> {
|
||||
t.button("@yes", () -> {
|
||||
this.hide();
|
||||
Core.settings.put(name1, number);
|
||||
label.setText(title1 + ": " + number);
|
||||
}).size(120, 50);
|
||||
t.button("@no", () -> {
|
||||
this.hide();
|
||||
Core.settings.put(name1, def);
|
||||
label.setText(title1 + ": " + Core.settings.getInt(name1));
|
||||
}).size(120, 50);
|
||||
}).pad(5);
|
||||
closeOnBack();
|
||||
}}.show();
|
||||
}
|
||||
else {
|
||||
Core.settings.put(name, number);
|
||||
label.setText(title + ": " + number);
|
||||
}
|
||||
} catch(Throwable e) {
|
||||
Log.info(e);
|
||||
ui.showErrorMessage("@invalid");
|
||||
@@ -66,8 +95,37 @@ public class Setting {
|
||||
a.setMaxLength(String.valueOf(Integer.MAX_VALUE).length());
|
||||
dialog.buttons.button("@ok", () -> {
|
||||
try {
|
||||
Core.settings.put(name, Integer.parseInt(a.getText()));
|
||||
label.setText(title + ": " + Integer.parseInt(a.getText()));
|
||||
int number = Integer.parseInt(a.getText());
|
||||
if(number >= warnMax){
|
||||
String name1 = name;
|
||||
String title1 = title;
|
||||
new Dialog(""){{
|
||||
setFillParent(true);
|
||||
cont.margin(15f);
|
||||
cont.add("@warn");
|
||||
cont.row();
|
||||
cont.image().width(300f).pad(2).height(4f).color(Color.scarlet);
|
||||
cont.row();
|
||||
cont.add("@warning").pad(2f).growX().wrap().get().setAlignment(Align.center);
|
||||
cont.row();
|
||||
cont.table(t -> {
|
||||
t.button("@yes", () -> {
|
||||
this.hide();
|
||||
Core.settings.put(name1, number);
|
||||
label.setText(title1 + ": " + number);
|
||||
}).size(120, 50);
|
||||
t.button("@no", () -> {
|
||||
this.hide();
|
||||
Core.settings.put(name1, def);
|
||||
label.setText(title1 + ": " + Core.settings.getInt(name1));
|
||||
}).size(120, 50);
|
||||
}).pad(5);
|
||||
closeOnBack();
|
||||
}}.show();
|
||||
}else {
|
||||
Core.settings.put(name, number);
|
||||
label.setText(title + ": " + number);
|
||||
}
|
||||
} catch(Throwable e) {
|
||||
Log.info(e);
|
||||
ui.showErrorMessage(invalid);
|
||||
@@ -97,20 +155,31 @@ public class Setting {
|
||||
boolean tmp = Core.settings.getBool("uiscalechanged", false);
|
||||
Core.settings.put("uiscalechanged", false);
|
||||
|
||||
addGraphicSetting("scan");
|
||||
addGraphicSetting("range");
|
||||
addGraphicSetting("select");
|
||||
addGraphicSetting("coreui");
|
||||
addGraphicSetting("waveui");
|
||||
addGraphicSetting("unitui");
|
||||
addGraphicSetting("weaponui");
|
||||
addGraphicSetting("commandedunitui");
|
||||
addGraphicSetting("unithealthui");
|
||||
addGraphicTypeSetting("wavemax", 100, "@editmaxwave","@invalid");
|
||||
addGraphicTypeSetting("wavemax", 100, "@editmaxwave","@invalid", 200);
|
||||
addGraphicTypeSetting("rangemax", 10, "@editrange","@invalid", 1000);
|
||||
|
||||
ui.settings.graphics.sliderPref("coreuiscaling", 100, 0, 100, 5, s -> s + "%");
|
||||
ui.settings.graphics.sliderPref("waveuiscaling", 100, 0, 100, 5, s -> s + "%");
|
||||
ui.settings.graphics.sliderPref("uiscaling", 100, 0, 100, 5, s -> s + "%");
|
||||
ui.settings.graphics.sliderPref("selectopacity", 50, 0, 100, 5, s -> s + "%");
|
||||
ui.settings.graphics.sliderPref("coreuiopacity", 50, 0, 100, 5, s -> s + "%");
|
||||
ui.settings.graphics.sliderPref("waveuiopacity", 50, 0, 100, 5, s -> s + "%");
|
||||
ui.settings.graphics.sliderPref("uiopacity", 50, 0, 100, 5, s -> s + "%");
|
||||
ui.settings.graphics.sliderPref("baropacity", 100, 0, 100, 5, s -> s + "%");
|
||||
|
||||
Core.settings.defaults("coreui", !Vars.mobile);
|
||||
Core.settings.defaults("scan", true);
|
||||
Core.settings.defaults("range", false);
|
||||
Core.settings.defaults("select", true);
|
||||
Core.settings.defaults("coreui", false);
|
||||
Core.settings.defaults("waveui", true);
|
||||
Core.settings.defaults("unitui", true);
|
||||
Core.settings.defaults("weaponui", true);
|
||||
|
||||
@@ -1,15 +1,33 @@
|
||||
package UnitInfo.ui;
|
||||
|
||||
import UnitInfo.core.PrograssedReqImage;
|
||||
import arc.Core;
|
||||
import arc.func.Func;
|
||||
import arc.graphics.Color;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import arc.scene.ui.Image;
|
||||
import arc.struct.FloatSeq;
|
||||
import arc.util.Log;
|
||||
import arc.util.Tmp;
|
||||
import mindustry.Vars;
|
||||
import mindustry.content.Liquids;
|
||||
import mindustry.entities.abilities.ForceFieldAbility;
|
||||
import mindustry.entities.abilities.ShieldRegenFieldAbility;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.Drawf;
|
||||
import mindustry.graphics.Layer;
|
||||
import mindustry.graphics.Pal;
|
||||
import mindustry.type.Item;
|
||||
import mindustry.type.Liquid;
|
||||
import mindustry.ui.Cicon;
|
||||
import mindustry.ui.MultiReqImage;
|
||||
import mindustry.ui.ReqImage;
|
||||
import mindustry.world.blocks.defense.Wall;
|
||||
import mindustry.world.blocks.defense.turrets.*;
|
||||
import mindustry.world.blocks.power.ConditionalConsumePower;
|
||||
import mindustry.world.consumers.ConsumePower;
|
||||
import mindustry.world.consumers.ConsumeType;
|
||||
|
||||
import static arc.Core.settings;
|
||||
import static mindustry.Vars.content;
|
||||
@@ -101,4 +119,96 @@ public class FreeBar {
|
||||
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
public void draw(Building build){
|
||||
if(build.dead()
|
||||
|| (!(build instanceof BaseTurret.BaseTurretBuild) && !(build instanceof Wall.WallBuild))) return;
|
||||
|
||||
float height = 2f;
|
||||
|
||||
if(Float.isNaN(value)) value = 0;
|
||||
if(Float.isInfinite(value)) value = 1f;
|
||||
value = Mathf.lerpDelta(value, Mathf.clamp(build.healthf()), 0.15f);
|
||||
|
||||
Draw.z(Layer.flyingUnit + 1);
|
||||
Draw.color(0.1f, 0.1f, 0.1f, (settings.getInt("baropacity") / 100f));
|
||||
float width = build.block.size * 8 / 2f + 4f;
|
||||
|
||||
float x = build.x;
|
||||
float y = build.y - 8;
|
||||
for(int i : Mathf.signs) {
|
||||
for(int ii = 0; ii < 2; ii++){
|
||||
float shadowx = x + ii * 0.25f;
|
||||
float shadowy = y - ii * 0.5f;
|
||||
Fill.poly(FloatSeq.with(
|
||||
shadowx - (width / 2 + height), shadowy,
|
||||
shadowx - width / 2, shadowy + i * height,
|
||||
shadowx + width / 2, shadowy + i * height,
|
||||
shadowx + (width / 2 + height), shadowy,
|
||||
shadowx + width / 2, shadowy + i * -height,
|
||||
shadowx - width / 2, shadowy + i * -height));
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
Draw.color(Pal.health.cpy().a((settings.getInt("baropacity") / 100f)));
|
||||
float topWidth = - width / 2 + width * Mathf.clamp(build.healthf());
|
||||
float moser = topWidth + height;
|
||||
if(build.health <= 0) moser = (width / 2 + height) * (2 * Mathf.clamp(build.healthf()) - 1);
|
||||
|
||||
for(int i : Mathf.signs) {
|
||||
Fill.poly(FloatSeq.with(
|
||||
x - (width / 2 + height), y,
|
||||
x - width / 2, y + i * height,
|
||||
x + topWidth, y + i * height,
|
||||
x + moser, y,
|
||||
x + topWidth, y + i * -height,
|
||||
x - width / 2, y + i * -height));
|
||||
}
|
||||
}
|
||||
float h = 0;
|
||||
Color color = Pal.ammo;
|
||||
if(build instanceof ItemTurret.ItemTurretBuild) {
|
||||
h = ((ItemTurret.ItemTurretBuild) build).totalAmmo / (((ItemTurret) build.block).maxAmmo * 1f);
|
||||
if(((ItemTurret.ItemTurretBuild) build).hasAmmo()) color = ((ItemTurret) build.block).ammoTypes.findKey(((ItemTurret.ItemTurretBuild) build).peekAmmo(), true).color;
|
||||
}
|
||||
else if(build instanceof LiquidTurret.LiquidTurretBuild){
|
||||
LiquidTurret.LiquidTurretBuild entity = (LiquidTurret.LiquidTurretBuild) build;
|
||||
Func<Building, Liquid> current;
|
||||
current = entity1 -> entity1.liquids == null ? Liquids.water : entity1.liquids.current();
|
||||
|
||||
h = entity.liquids == null ? 0f : entity.liquids.get(current.get(entity)) / entity.block.liquidCapacity;
|
||||
color = current.get(entity).color;
|
||||
}
|
||||
else if(build instanceof PowerTurret.PowerTurretBuild){
|
||||
PowerTurret.PowerTurretBuild entity = (PowerTurret.PowerTurretBuild) build;
|
||||
ConsumePower cons = entity.block.consumes.getPower();
|
||||
|
||||
double max = (Math.round(cons.usage * 10) / 10.0) * 60;
|
||||
double v = (Math.round(((ConditionalConsumePower)entity.block.consumes.get(ConsumeType.power)).requestedPower(entity) * 10) / 10.0);
|
||||
|
||||
h = entity.power.status;
|
||||
color = Pal.powerBar;
|
||||
}
|
||||
|
||||
if(Core.settings.getBool("range") && build instanceof BaseTurret.BaseTurretBuild) {
|
||||
Drawf.dashCircle(build.x, build.y, ((BaseTurret.BaseTurretBuild) build).range(), build.team.color);
|
||||
}
|
||||
|
||||
if(build instanceof Turret.TurretBuild) {
|
||||
float topWidth = - width / 2 + width * Mathf.clamp(h);
|
||||
float moser = topWidth + height;
|
||||
if(h <= 0) moser = (width / 2 + height) * (2 * h - 1);
|
||||
|
||||
Draw.color(Tmp.c1.set(color).a(settings.getInt("baropacity") / 100f));
|
||||
Fill.poly(FloatSeq.with(
|
||||
x - (width / 2 + height), y,
|
||||
x - width / 2, y + height,
|
||||
x + topWidth, y + height,
|
||||
x + moser, y,
|
||||
x + topWidth, y - height,
|
||||
x - width / 2, y - height));
|
||||
}
|
||||
Draw.reset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.scene.*;
|
||||
import arc.scene.style.*;
|
||||
import arc.scene.ui.layout.Scl;
|
||||
import arc.util.pooling.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.ui.Fonts;
|
||||
@@ -149,7 +150,7 @@ public class SBar extends Element{
|
||||
Font font = Fonts.outline;
|
||||
GlyphLayout lay = Pools.obtain(GlyphLayout.class, GlyphLayout::new);
|
||||
lay.setText(font, name);
|
||||
|
||||
font.getData().setScale(Scl.scl());
|
||||
font.setColor(Color.white);
|
||||
font.draw(name, x + width / 2f - lay.width / 2f, y + height / 2f + lay.height / 2f + 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user