mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-10 03:59:26 +02:00
clean up
This commit is contained in:
@@ -74,6 +74,7 @@ setting.allTeam.name = Display all teams' info on item tap
|
|||||||
setting.deadTarget.name = save locked target even if it's dead
|
setting.deadTarget.name = save locked target even if it's dead
|
||||||
setting.linkedMass.name = Display mass driver link line
|
setting.linkedMass.name = Display mass driver link line
|
||||||
setting.linkedNode.name = Display node link line
|
setting.linkedNode.name = Display node link line
|
||||||
|
setting.distanceLine.name = Display distance line from info target
|
||||||
|
|
||||||
#Dialog
|
#Dialog
|
||||||
editmaxwave = Edit Waves(int)
|
editmaxwave = Edit Waves(int)
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ setting.allTeam.name = 자원 탭에 모든 팀 표시
|
|||||||
setting.deadTarget.name = 고정 목표물이 죽더라도 계속 고정하기
|
setting.deadTarget.name = 고정 목표물이 죽더라도 계속 고정하기
|
||||||
setting.linkedMass.name = 매스 드라이버 연결선 표시
|
setting.linkedMass.name = 매스 드라이버 연결선 표시
|
||||||
setting.linkedNode.name = 노드 연결선 표시
|
setting.linkedNode.name = 노드 연결선 표시
|
||||||
|
setting.distanceLine.name = 목표물과의 거리선 표시
|
||||||
|
|
||||||
#Dialog
|
#Dialog
|
||||||
editmaxwave = 최대 단계 수정하기(정수)
|
editmaxwave = 최대 단계 수정하기(정수)
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
"name": "unitinfo",
|
"name": "unitinfo",
|
||||||
"displayName": "Unit Infomation",
|
"displayName": "Unit Infomation",
|
||||||
"author": "Sharlotte",
|
"author": "Sharlotte",
|
||||||
"description": "The mod displays more information for unit, such as health, armor, shield, weapon/weapon reload etc",
|
"description": "The mod displays more information ingame, such as unit/building, wave, core, tile, item/unit total info etc",
|
||||||
"version": "1.3",
|
"version": "1.3",
|
||||||
"main": "UnitInfo.core.Main",
|
"main": "UnitInfo.core.Main",
|
||||||
"minGameVersion": "129",
|
"minGameVersion": "129.2",
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"hidden": true,
|
"hidden": true,
|
||||||
"java": true
|
"java": true
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ pArtifactFilename = UnitInfo.jar
|
|||||||
# Group of project (should line up with dirs in src/)
|
# Group of project (should line up with dirs in src/)
|
||||||
pGroup = sharlotte
|
pGroup = sharlotte
|
||||||
# Version of Mindustry to use (if not working, consult jitpack.io)
|
# Version of Mindustry to use (if not working, consult jitpack.io)
|
||||||
pMindustryVersion = v129.1
|
pMindustryVersion = v129.2
|
||||||
# Minimum API level for d8 (if you don't know what this is, leave it unless d8 yells at you)
|
# Minimum API level for d8 (if you don't know what this is, leave it unless d8 yells at you)
|
||||||
pMinApi = 26
|
pMinApi = 26
|
||||||
@@ -17,7 +17,7 @@ import arc.struct.*;
|
|||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.*;
|
import mindustry.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.core.Renderer;
|
import mindustry.core.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.entities.units.*;
|
import mindustry.entities.units.*;
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
@@ -32,6 +32,7 @@ import mindustry.world.*;
|
|||||||
import mindustry.world.blocks.*;
|
import mindustry.world.blocks.*;
|
||||||
import mindustry.world.blocks.defense.turrets.*;
|
import mindustry.world.blocks.defense.turrets.*;
|
||||||
import mindustry.world.blocks.distribution.MassDriver;
|
import mindustry.world.blocks.distribution.MassDriver;
|
||||||
|
import mindustry.world.blocks.payloads.PayloadMassDriver;
|
||||||
import mindustry.world.blocks.power.PowerNode;
|
import mindustry.world.blocks.power.PowerNode;
|
||||||
import mindustry.world.blocks.storage.*;
|
import mindustry.world.blocks.storage.*;
|
||||||
|
|
||||||
@@ -75,6 +76,7 @@ public class HudUi {
|
|||||||
@Nullable Teamc target;
|
@Nullable Teamc target;
|
||||||
|
|
||||||
public Seq<MassDriver.MassDriverBuild> linkedMasses = new Seq<>();
|
public Seq<MassDriver.MassDriverBuild> linkedMasses = new Seq<>();
|
||||||
|
public Seq<PayloadMassDriver.PayloadDriverBuild> linkedPayloadMasses = new Seq<>();
|
||||||
public Seq<Building> linkedNodes = new Seq<>();
|
public Seq<Building> linkedNodes = new Seq<>();
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -88,7 +90,7 @@ public class HudUi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Seq<Unit> units = Groups.unit.intersect(Core.input.mouseWorldX(), Core.input.mouseWorldY(), 4, 4); // well, 0.5tile is enough to search them
|
Seq<Unit> units = Groups.unit.intersect(input.mouseWorldX(), input.mouseWorldY(), 4, 4); // well, 0.5tile is enough to search them
|
||||||
if(units.size > 0)
|
if(units.size > 0)
|
||||||
return (T) units.peek(); //if there is unit, return it.
|
return (T) units.peek(); //if there is unit, return it.
|
||||||
else if(getTile() != null && getTile().build != null)
|
else if(getTile() != null && getTile().build != null)
|
||||||
@@ -99,9 +101,49 @@ public class HudUi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public @Nullable Tile getTile(){
|
public @Nullable Tile getTile(){
|
||||||
return Vars.world.tileWorld(Core.input.mouseWorldX(), Core.input.mouseWorldY());
|
return Vars.world.tileWorld(input.mouseWorldX(), input.mouseWorldY());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void drawMassPayloadLink(PayloadMassDriver.PayloadDriverBuild from){
|
||||||
|
Groups.build.each(b -> b instanceof PayloadMassDriver.PayloadDriverBuild fromMass &&
|
||||||
|
world.build(fromMass.link) == from &&
|
||||||
|
from.within(fromMass.x, fromMass.y, ((PayloadMassDriver)fromMass.block).range) &&
|
||||||
|
!linkedPayloadMasses.contains(from), b -> {
|
||||||
|
linkedPayloadMasses.add((PayloadMassDriver.PayloadDriverBuild) b);
|
||||||
|
drawMassPayloadLink((PayloadMassDriver.PayloadDriverBuild) b);
|
||||||
|
});
|
||||||
|
|
||||||
|
if(world.build(from.link) instanceof PayloadMassDriver.PayloadDriverBuild to && from != to &&
|
||||||
|
to.within(from.x, from.y, ((PayloadMassDriver)from.block).range)){
|
||||||
|
float sin = Mathf.absin(Time.time, 6f, 1f);
|
||||||
|
Tmp.v1.set(from.x + from.block.offset, from.y + from.block.offset).sub(to.x, to.y).limit(from.block.size * tilesize + sin + 0.5f);
|
||||||
|
float x2 = from.x - Tmp.v1.x, y2 = from.y - Tmp.v1.y,
|
||||||
|
x1 = to.x + Tmp.v1.x, y1 = to.y + Tmp.v1.y;
|
||||||
|
int segs = (int)(to.dst(from.x, from.y)/tilesize);
|
||||||
|
|
||||||
|
Lines.stroke(4f, Pal.gray);
|
||||||
|
Lines.dashLine(x1, y1, x2, y2, segs);
|
||||||
|
Lines.stroke(2f, Pal.placing);
|
||||||
|
Lines.dashLine(x1, y1, x2, y2, segs);
|
||||||
|
Lines.stroke(1f, Pal.accent);
|
||||||
|
Drawf.circles(from.x, from.y, (from.tile.block().size / 2f + 1) * tilesize + sin - 2f, Pal.accent);
|
||||||
|
|
||||||
|
for(var shooter : from.waitingShooters){
|
||||||
|
Drawf.circles(shooter.x, shooter.y, (from.tile.block().size / 2f + 1) * tilesize + sin - 2f);
|
||||||
|
Drawf.arrow(shooter.x, shooter.y, from.x, from.y, from.block.size * tilesize + sin, 4f + sin);
|
||||||
|
}
|
||||||
|
if(from.link != -1 && world.build(from.link) instanceof PayloadMassDriver.PayloadDriverBuild other && other.block == from.block && other.team == from.team && from.within(other, ((PayloadMassDriver)from.block).range)){
|
||||||
|
Building target = world.build(from.link);
|
||||||
|
Drawf.circles(target.x, target.y, (target.block().size / 2f + 1) * tilesize + sin - 2f);
|
||||||
|
Drawf.arrow(from.x, from.y, target.x, target.y, from.block.size * tilesize + sin, 4f + sin);
|
||||||
|
}
|
||||||
|
if(world.build(to.link) instanceof PayloadMassDriver.PayloadDriverBuild newTo && to != newTo &&
|
||||||
|
newTo.within(to.x, to.y, ((PayloadMassDriver)to.block).range) && !linkedPayloadMasses.contains(to)){
|
||||||
|
linkedPayloadMasses.add(to);
|
||||||
|
drawMassPayloadLink(to);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void drawMassLink(MassDriver.MassDriverBuild from){
|
public void drawMassLink(MassDriver.MassDriverBuild from){
|
||||||
Groups.build.each(b -> b instanceof MassDriver.MassDriverBuild fromMass &&
|
Groups.build.each(b -> b instanceof MassDriver.MassDriverBuild fromMass &&
|
||||||
@@ -114,7 +156,6 @@ public class HudUi {
|
|||||||
|
|
||||||
if(world.build(from.link) instanceof MassDriver.MassDriverBuild to && from != to &&
|
if(world.build(from.link) instanceof MassDriver.MassDriverBuild to && from != to &&
|
||||||
to.within(from.x, from.y, ((MassDriver)from.block).range)){
|
to.within(from.x, from.y, ((MassDriver)from.block).range)){
|
||||||
|
|
||||||
float sin = Mathf.absin(Time.time, 6f, 1f);
|
float sin = Mathf.absin(Time.time, 6f, 1f);
|
||||||
Tmp.v1.set(from.x + from.block.offset, from.y + from.block.offset).sub(to.x, to.y).limit(from.block.size * tilesize + sin + 0.5f);
|
Tmp.v1.set(from.x + from.block.offset, from.y + from.block.offset).sub(to.x, to.y).limit(from.block.size * tilesize + sin + 0.5f);
|
||||||
float x2 = from.x - Tmp.v1.x, y2 = from.y - Tmp.v1.y,
|
float x2 = from.x - Tmp.v1.x, y2 = from.y - Tmp.v1.y,
|
||||||
@@ -138,8 +179,7 @@ public class HudUi {
|
|||||||
Drawf.arrow(from.x, from.y, target.x, target.y, from.block.size * tilesize + sin, 4f + sin);
|
Drawf.arrow(from.x, from.y, target.x, target.y, from.block.size * tilesize + sin, 4f + sin);
|
||||||
}
|
}
|
||||||
if(world.build(to.link) instanceof MassDriver.MassDriverBuild newTo && to != newTo &&
|
if(world.build(to.link) instanceof MassDriver.MassDriverBuild newTo && to != newTo &&
|
||||||
newTo.within(to.x, to.y, ((MassDriver)to.block).range) &&
|
newTo.within(to.x, to.y, ((MassDriver)to.block).range) && !linkedMasses.contains(to)){
|
||||||
!linkedMasses.contains(to)){
|
|
||||||
linkedMasses.add(to);
|
linkedMasses.add(to);
|
||||||
drawMassLink(to);
|
drawMassLink(to);
|
||||||
}
|
}
|
||||||
@@ -180,16 +220,23 @@ public class HudUi {
|
|||||||
locked = false;
|
locked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(settings.getBool("linkedMass") && getTarget() instanceof MassDriver.MassDriverBuild mass){
|
if(settings.getBool("linkedMass")){
|
||||||
|
if(getTarget() instanceof MassDriver.MassDriverBuild mass) {
|
||||||
linkedMasses.clear();
|
linkedMasses.clear();
|
||||||
drawMassLink(mass);
|
drawMassLink(mass);
|
||||||
}
|
}
|
||||||
|
else if(getTarget() instanceof PayloadMassDriver.PayloadDriverBuild mass) {
|
||||||
|
linkedPayloadMasses.clear();
|
||||||
|
drawMassPayloadLink(mass);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(settings.getBool("linkedNode") && getTarget() instanceof Building node){
|
if(settings.getBool("linkedNode") && getTarget() instanceof Building node){
|
||||||
linkedNodes.clear();
|
linkedNodes.clear();
|
||||||
drawNodeLink(node);
|
drawNodeLink(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Core.settings.getBool("select") && getTarget() != null) {
|
if(settings.getBool("select") && getTarget() != null) {
|
||||||
Posc entity = getTarget();
|
Posc entity = getTarget();
|
||||||
for(int i = 0; i < 4; i++){
|
for(int i = 0; i < 4; i++){
|
||||||
float rot = i * 90f + 45f + (-Time.time) % 360f;
|
float rot = i * 90f + 45f + (-Time.time) % 360f;
|
||||||
@@ -197,7 +244,7 @@ public class HudUi {
|
|||||||
Draw.color(Tmp.c1.set(locked ? Color.orange : Color.darkGray).lerp(locked ? Color.scarlet : Color.gray, Mathf.absin(Time.time, 2f, 1f)).a(settings.getInt("selectopacity") / 100f));
|
Draw.color(Tmp.c1.set(locked ? Color.orange : Color.darkGray).lerp(locked ? Color.scarlet : Color.gray, Mathf.absin(Time.time, 2f, 1f)).a(settings.getInt("selectopacity") / 100f));
|
||||||
Draw.rect("select-arrow", entity.x() + Angles.trnsx(rot, length), entity.y() + Angles.trnsy(rot, length), length / 1.9f, length / 1.9f, rot - 135f);
|
Draw.rect("select-arrow", entity.x() + Angles.trnsx(rot, length), entity.y() + Angles.trnsy(rot, length), length / 1.9f, length / 1.9f, rot - 135f);
|
||||||
}
|
}
|
||||||
if(player.unit() != null && getTarget() != player.unit()) {
|
if(settings.getBool("distanceLine") && player.unit() != null && !player.unit().dead && getTarget() != player.unit()) { //need selected other unit with living player
|
||||||
Teamc from = player.unit();
|
Teamc from = player.unit();
|
||||||
Teamc to = getTarget();
|
Teamc to = getTarget();
|
||||||
float sin = Mathf.absin(Time.time, 6f, 1f);
|
float sin = Mathf.absin(Time.time, 6f, 1f);
|
||||||
@@ -208,9 +255,9 @@ public class HudUi {
|
|||||||
x1 = to.x() + Tmp.v1.x, y1 = to.y() + Tmp.v1.y;
|
x1 = to.x() + Tmp.v1.x, y1 = to.y() + Tmp.v1.y;
|
||||||
int segs = (int) (to.dst(from.x(), from.y()) / tilesize);
|
int segs = (int) (to.dst(from.x(), from.y()) / tilesize);
|
||||||
|
|
||||||
Lines.stroke(4f, Pal.gray);
|
Lines.stroke(2.5f, Pal.gray);
|
||||||
Lines.dashLine(x1, y1, x2, y2, segs);
|
Lines.dashLine(x1, y1, x2, y2, segs);
|
||||||
Lines.stroke(2f, Pal.placing);
|
Lines.stroke(1f, Pal.placing);
|
||||||
Lines.dashLine(x1, y1, x2, y2, segs);
|
Lines.dashLine(x1, y1, x2, y2, segs);
|
||||||
|
|
||||||
Fonts.outline.draw(Strings.fixed(to.dst(from.x(), from.y()), 2) + " (" + segs + "tiles)",
|
Fonts.outline.draw(Strings.fixed(to.dst(from.x(), from.y()), 2) + " (" + segs + "tiles)",
|
||||||
@@ -246,7 +293,7 @@ public class HudUi {
|
|||||||
if(!player.unit().activelyBuilding() && player.unit().mineTile == null) {
|
if(!player.unit().activelyBuilding() && player.unit().mineTile == null) {
|
||||||
if(input.keyDown(KeyCode.mouseLeft)) {
|
if(input.keyDown(KeyCode.mouseLeft)) {
|
||||||
player.shooting = !boosted;
|
player.shooting = !boosted;
|
||||||
unit.aim(player.mouseX = Core.input.mouseWorldX(), player.mouseY = Core.input.mouseWorldY());
|
unit.aim(player.mouseX = input.mouseWorldX(), player.mouseY = input.mouseWorldY());
|
||||||
} else if(target == null) {
|
} else if(target == null) {
|
||||||
player.shooting = false;
|
player.shooting = false;
|
||||||
if(unit instanceof BlockUnitUnit b) {
|
if(unit instanceof BlockUnitUnit b) {
|
||||||
@@ -290,7 +337,7 @@ public class HudUi {
|
|||||||
public void reset(int index, Seq<Button> buttons, Label label, Table table, Table labelTable, String hud){
|
public void reset(int index, Seq<Button> buttons, Label label, Table table, Table labelTable, String hud){
|
||||||
uiIndex = index;
|
uiIndex = index;
|
||||||
buttons.each(b -> b.setChecked(buttons.indexOf(b) == index));
|
buttons.each(b -> b.setChecked(buttons.indexOf(b) == index));
|
||||||
label.setText(Core.bundle.get(hud));
|
label.setText(bundle.get(hud));
|
||||||
addBars();
|
addBars();
|
||||||
addWeapon();
|
addWeapon();
|
||||||
addUnitTable();
|
addUnitTable();
|
||||||
@@ -770,8 +817,8 @@ public class HudUi {
|
|||||||
}));
|
}));
|
||||||
}}).pad(2f);
|
}}).pad(2f);
|
||||||
tt.clicked(() -> {
|
tt.clicked(() -> {
|
||||||
if(Core.input.keyDown(KeyCode.shiftLeft) && Fonts.getUnicode(group.type.name) != 0){
|
if(input.keyDown(KeyCode.shiftLeft) && Fonts.getUnicode(group.type.name) != 0){
|
||||||
Core.app.setClipboardText((char)Fonts.getUnicode(group.type.name) + "");
|
app.setClipboardText((char)Fonts.getUnicode(group.type.name) + "");
|
||||||
ui.showInfoFade("@copied");
|
ui.showInfoFade("@copied");
|
||||||
}else{
|
}else{
|
||||||
ui.content.show(group.type);
|
ui.content.show(group.type);
|
||||||
@@ -840,9 +887,9 @@ public class HudUi {
|
|||||||
wavePane.setScrollYForce(waveScrollPos);
|
wavePane.setScrollYForce(waveScrollPos);
|
||||||
wavePane.update(() -> {
|
wavePane.update(() -> {
|
||||||
if(wavePane.hasScroll()){
|
if(wavePane.hasScroll()){
|
||||||
Element result = Core.scene.hit(Core.input.mouseX(), Core.input.mouseY(), true);
|
Element result = scene.hit(input.mouseX(), input.mouseY(), true);
|
||||||
if(result == null || !result.isDescendantOf(wavePane)){
|
if(result == null || !result.isDescendantOf(wavePane)){
|
||||||
Core.scene.setScrollFocus(null);
|
scene.setScrollFocus(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
waveScrollPos = wavePane.getScrollY();
|
waveScrollPos = wavePane.getScrollY();
|
||||||
@@ -931,9 +978,9 @@ public class HudUi {
|
|||||||
corePane.setScrollYForce(coreScrollPos);
|
corePane.setScrollYForce(coreScrollPos);
|
||||||
corePane.update(() -> {
|
corePane.update(() -> {
|
||||||
if(corePane.hasScroll()){
|
if(corePane.hasScroll()){
|
||||||
Element result = Core.scene.hit(Core.input.mouseX(), Core.input.mouseY(), true);
|
Element result = scene.hit(input.mouseX(), input.mouseY(), true);
|
||||||
if(result == null || !result.isDescendantOf(corePane)){
|
if(result == null || !result.isDescendantOf(corePane)){
|
||||||
Core.scene.setScrollFocus(null);
|
scene.setScrollFocus(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
coreScrollPos = corePane.getScrollY();
|
coreScrollPos = corePane.getScrollY();
|
||||||
@@ -967,9 +1014,9 @@ public class HudUi {
|
|||||||
head.table(image -> {
|
head.table(image -> {
|
||||||
image.left();
|
image.left();
|
||||||
if(tile == null) return;
|
if(tile == null) return;
|
||||||
if(tile.floor().uiIcon != Core.atlas.find("error")) image.image(tile.floor().uiIcon);
|
if(tile.floor().uiIcon != atlas.find("error")) image.image(tile.floor().uiIcon);
|
||||||
if(tile.overlay().uiIcon != Core.atlas.find("error")) image.image(tile.overlay().uiIcon);
|
if(tile.overlay().uiIcon != atlas.find("error")) image.image(tile.overlay().uiIcon);
|
||||||
if(tile.block().uiIcon != Core.atlas.find("error")) image.image(tile.block().uiIcon);
|
if(tile.block().uiIcon != atlas.find("error")) image.image(tile.block().uiIcon);
|
||||||
});
|
});
|
||||||
head.label(() -> tile == null ? "(null, null)" : "(" + tile.x + ", " + tile.y + ")").center();
|
head.label(() -> tile == null ? "(null, null)" : "(" + tile.x + ", " + tile.y + ")").center();
|
||||||
});
|
});
|
||||||
@@ -983,9 +1030,9 @@ public class HudUi {
|
|||||||
tilePane.setScrollYForce(tileScrollPos);
|
tilePane.setScrollYForce(tileScrollPos);
|
||||||
tilePane.update(() -> {
|
tilePane.update(() -> {
|
||||||
if(tilePane.hasScroll()){
|
if(tilePane.hasScroll()){
|
||||||
Element result = Core.scene.hit(Core.input.mouseX(), Core.input.mouseY(), true);
|
Element result = scene.hit(input.mouseX(), input.mouseY(), true);
|
||||||
if(result == null || !result.isDescendantOf(tilePane)){
|
if(result == null || !result.isDescendantOf(tilePane)){
|
||||||
Core.scene.setScrollFocus(null);
|
scene.setScrollFocus(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tileScrollPos = tilePane.getScrollY();
|
tileScrollPos = tilePane.getScrollY();
|
||||||
@@ -1032,9 +1079,9 @@ public class HudUi {
|
|||||||
tilePane.setScrollYForce(tileScrollPos);
|
tilePane.setScrollYForce(tileScrollPos);
|
||||||
tilePane.update(() -> {
|
tilePane.update(() -> {
|
||||||
if(tilePane.hasScroll()){
|
if(tilePane.hasScroll()){
|
||||||
Element result = Core.scene.hit(Core.input.mouseX(), Core.input.mouseY(), true);
|
Element result = scene.hit(input.mouseX(), input.mouseY(), true);
|
||||||
if(result == null || !result.isDescendantOf(tilePane)){
|
if(result == null || !result.isDescendantOf(tilePane)){
|
||||||
Core.scene.setScrollFocus(null);
|
scene.setScrollFocus(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
itemScrollPos = tilePane.getScrollY();
|
itemScrollPos = tilePane.getScrollY();
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ import arc.math.*;
|
|||||||
import arc.scene.ui.layout.*;
|
import arc.scene.ui.layout.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.*;
|
import mindustry.*;
|
||||||
|
import mindustry.ai.types.BuilderAI;
|
||||||
|
import mindustry.ai.types.MinerAI;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
|
import mindustry.entities.units.AIController;
|
||||||
import mindustry.game.EventType.*;
|
import mindustry.game.EventType.*;
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
@@ -123,8 +126,9 @@ public class Main extends Mod {
|
|||||||
// Unit Ranges (Only works when turret ranges are enabled)
|
// Unit Ranges (Only works when turret ranges are enabled)
|
||||||
if(settings.getBool("unitRange") || (settings.getBool("allTeamRange") && player.unit() != null)) {
|
if(settings.getBool("unitRange") || (settings.getBool("allTeamRange") && player.unit() != null)) {
|
||||||
Groups.unit.each(u -> {
|
Groups.unit.each(u -> {
|
||||||
if(!settings.getBool("unitRange") && settings.getBool("allTeamRange") && player.unit() != u) return;
|
if(!settings.getBool("unitRange") && settings.getBool("allTeamRange") && player.unit() != u) return; //player unit rule
|
||||||
if(!settings.getBool("allTeamRange") && u.team == team) return; // Don't draw own units
|
if(!settings.getBool("allTeamRange") && u.team == team) return; // Don't draw own units
|
||||||
|
if(u.controller() instanceof AIController ai && (ai instanceof BuilderAI || ai instanceof MinerAI)) return; //don't draw poly and mono
|
||||||
boolean canHit = unit.isFlying() ? u.type.targetAir : u.type.targetGround;
|
boolean canHit = unit.isFlying() ? u.type.targetAir : u.type.targetGround;
|
||||||
float range = u.range();
|
float range = u.range();
|
||||||
float max = range + settings.getInt("rangeRadius") * tilesize;
|
float max = range + settings.getInt("rangeRadius") * tilesize;
|
||||||
|
|||||||
@@ -321,5 +321,6 @@ public class SettingS {
|
|||||||
addGraphicCheckSetting("deadTarget", false);
|
addGraphicCheckSetting("deadTarget", false);
|
||||||
addGraphicCheckSetting("linkedMass", true);
|
addGraphicCheckSetting("linkedMass", true);
|
||||||
addGraphicCheckSetting("linkedNode", false);
|
addGraphicCheckSetting("linkedNode", false);
|
||||||
|
addGraphicCheckSetting("distanceLine", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user