diff --git a/assets/bundles/bundle.properties b/assets/bundles/bundle.properties index 7888f6c..766e093 100644 --- a/assets/bundles/bundle.properties +++ b/assets/bundles/bundle.properties @@ -10,6 +10,8 @@ shar-stat.charge = Charge: {0}% shar-stat.itemAmmo = Ammo : {0} / {1} shar-stat.liquidAmmo = Liquid: {0} shar-stat.power = Power: {0} / {1} +shar-stat.break = [red] broke [orange]{0}.[][] +shar-stat.build = [green] built [orange]{0}.[][] # Settings setting.select.name = Display select Arrow @@ -38,4 +40,5 @@ warning = displayed wave amount is too high! it may cause lags. hud.unit = Unit Info hud.wave = Wave Info hud.core = Core Info +hud.tile = Tile Info hud.cancel = Hidden \ No newline at end of file diff --git a/assets/bundles/bundle_ko.properties b/assets/bundles/bundle_ko.properties index 5ef0368..899bd09 100644 --- a/assets/bundles/bundle_ko.properties +++ b/assets/bundles/bundle_ko.properties @@ -10,6 +10,8 @@ shar-stat.charge = 충전: {0}% shar-stat.itemAmmo = 탄약 : {0} / {1} shar-stat.liquidAmmo = 액체: {0} shar-stat.power = 전력: {0} / {1} +shar-stat.break = [lightgray] 가 [orange]{0}[]를 [red]철거[]했습니다.[] +shar-stat.build = [lightgray] 가 [orange]{0}[]를 [green]건설[]했습니다.[] # Settings setting.select.name = 선택 화살표 표시 @@ -38,4 +40,5 @@ warning = 표시될 웨이브 수가 너무 많습니다! 많은 랙이 걸릴 hud.unit = 유닛 정보 hud.wave = 단계 정보 hud.core = 코어 정보 +hud.tile = 타일 정보 hud.cancel = 닫음 \ No newline at end of file diff --git a/src/UnitInfo/core/HudUi.java b/src/UnitInfo/core/HudUi.java index f055adf..d331a81 100644 --- a/src/UnitInfo/core/HudUi.java +++ b/src/UnitInfo/core/HudUi.java @@ -15,7 +15,9 @@ import arc.scene.ui.layout.Scl; import arc.scene.ui.layout.Stack; import arc.scene.ui.layout.Table; import arc.scene.utils.Elem; +import arc.struct.IntMap; import arc.struct.ObjectIntMap; +import arc.struct.ObjectMap; import arc.struct.Seq; import arc.util.*; import mindustry.Vars; @@ -33,6 +35,9 @@ import mindustry.graphics.Pal; import mindustry.input.DesktopInput; import mindustry.type.*; import mindustry.ui.*; +import mindustry.world.Block; +import mindustry.world.Tile; +import mindustry.world.blocks.ConstructBlock; import mindustry.world.blocks.defense.turrets.ItemTurret; import mindustry.world.blocks.defense.turrets.LiquidTurret; import mindustry.world.blocks.defense.turrets.PowerTurret; @@ -42,6 +47,8 @@ import mindustry.world.blocks.storage.CoreBlock; import mindustry.world.consumers.ConsumePower; import mindustry.world.consumers.ConsumeType; +import java.time.LocalTime; + import static arc.Core.scene; import static arc.Core.settings; import static mindustry.Vars.*; @@ -54,22 +61,23 @@ public class HudUi { Table unitTable = new Table(); Table waveTable = new Table(); Table coreTable = new Table(); + Table tileTable = new Table(); + float waveScrollPos; + float coreScrollPos; + float tileScrollPos, historyScrollPos; + IntMap> tileHistory = new IntMap<>(); + @Nullable UnitType type; @Nullable Unit unit; Element image; - Color lastItemColor = Pal.items; - - int uiIndex = 0; - float heat; float heat2; - float coreScrollPos; - float waveScrollPos; + float a; int maxwave; int coreamount; - float a; + int uiIndex = 0; boolean panFix = false; @@ -81,7 +89,11 @@ public class HudUi { else return unit; } - public void setDraw(){ + public @Nullable Tile getTile(){ + return Vars.world.tileWorld(Core.input.mouseWorldX(), Core.input.mouseWorldY()); + }; + + public void setEvent(){ Events.run(EventType.Trigger.draw, () -> { if(!Core.settings.getBool("select")) return; Unit unit = getUnit(); @@ -94,6 +106,28 @@ public class HudUi { Draw.reset(); } }); + + + Events.on(EventType.BlockBuildBeginEvent.class, e -> { + if(!tileHistory.containsKey(e.tile.pos())) { + if(e.tile.build instanceof ConstructBlock.ConstructBuild) tileHistory.put(e.tile.pos(), ObjectMap.of(e, ((ConstructBlock.ConstructBuild) e.tile.build).cblock)); + else tileHistory.put(e.tile.pos(), ObjectMap.of(e, e.tile.block())); + return; + } + ObjectMap map = tileHistory.get(e.tile.pos()); + if(e.breaking) { + if(e.tile.build instanceof ConstructBlock.ConstructBuild) map.put(e, ((ConstructBlock.ConstructBuild) e.tile.build).cblock); + else map.put(e, e.tile.block()); + tileHistory.put(e.tile.pos(), map); + } + else Time.run(10, () -> { + if (e.tile.build instanceof ConstructBlock.ConstructBuild) + map.put(e, ((ConstructBlock.ConstructBuild) e.tile.build).cblock); + else map.put(e, e.tile.block()); + tileHistory.put(e.tile.pos(), map); + }); + }); + } public void addTable(){ @@ -116,22 +150,24 @@ public class HudUi { Table labelTable = new Table(t -> t.add(label).scaling(Scaling.fit).left().padRight(40 * 8f)); table.table(t -> { - Seq