From 4f5b456ce7657ee4c78ebc21933f1c7d77d24f1d Mon Sep 17 00:00:00 2001 From: sharlottes Date: Tue, 5 Apr 2022 20:55:57 +0900 Subject: [PATCH] fixed issue: https://github.com/Sharlottes/UnitInfo/issues/51 (add schem hud setting) --- assets/bundles/bundle.properties | 2 ++ assets/bundles/bundle_ko.properties | 2 ++ src/UnitInfo/core/HudUi.java | 8 +++++--- src/UnitInfo/core/SettingS.java | 1 + src/UnitInfo/ui/SchemDisplay.java | 3 ++- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/assets/bundles/bundle.properties b/assets/bundles/bundle.properties index a6f292e..c0cfce3 100644 --- a/assets/bundles/bundle.properties +++ b/assets/bundles/bundle.properties @@ -35,6 +35,8 @@ setting.emptywave.name = Wave UI: Display Empty Wave setting.emptywave.description = Displays empty waves in the wave list. setting.itemcal.name = Resource UI: Calculate item inc/dec speed. setting.itemcal.description = Calculate increase/decrease speed of core item and display results. +setting.schem.name = Display Schematic HUD +setting.schem.description = Displays schem hud on right-side, which helps quick select. setting.rangeRadius.name = Near Range Margin setting.rangeRadius.description = Sets the range detection distance. diff --git a/assets/bundles/bundle_ko.properties b/assets/bundles/bundle_ko.properties index fdbef06..5b94b20 100644 --- a/assets/bundles/bundle_ko.properties +++ b/assets/bundles/bundle_ko.properties @@ -32,6 +32,8 @@ setting.emptywave.name = 빈 단계 표시 setting.emptywave.description = 단계 탭에서 빈 단계를 표시합니다. setting.itemcal.name = 자원 탭: 입출력 속도 계산 setting.itemcal.description = 아이템의 증가/감소 속도를 계산하여 표시합니다. +setting.schem.name = 설계도 HUD 표시 +setting.schem.description = 빠른 설계도 선택을 보조해주는 설계도 HUD를 화면 우측에 표시합니다. setting.rangeRadius.name = 사거리 접근 거리 setting.rangeRadius.description = 사거리 감지 거리를 설정합니다. diff --git a/src/UnitInfo/core/HudUi.java b/src/UnitInfo/core/HudUi.java index f923345..ab6c2f6 100644 --- a/src/UnitInfo/core/HudUi.java +++ b/src/UnitInfo/core/HudUi.java @@ -37,6 +37,7 @@ public class HudUi { public UnitDisplay unitTable; public WaveDisplay waveTable; public CoreDisplay itemTable; + public SchemDisplay schemTable; public Teamc shotTarget; public Teamc lockedTarget; @@ -73,6 +74,7 @@ public class HudUi { return Vars.world.tileWorld(input.mouseWorldX(), input.mouseWorldY()); } + float heat = 0; public void setEvents() { Events.on(EventType.WaveEvent.class, e -> waveTable.rebuild()); Events.on(EventType.WorldLoadEvent.class, e -> itemTable.rebuild()); @@ -85,6 +87,8 @@ public class HudUi { lockedTarget = null; locked = false; } + heat+=Time.delta; + if(heat>60) schemTable.setSchemTable(); if(Scl.scl(modUiScale) != settings.getInt("infoUiScale") / 100f){ modUiScale = settings.getInt("infoUiScale") / 100f; @@ -218,11 +222,9 @@ public class HudUi { } public void addSchemTable() { - if(mobile) return; - Table table = (Table) scene.find("minimap/position"); table.row(); - table.add(new SchemDisplay()); + table.add(schemTable=new SchemDisplay()); } public void addWaveInfoTable() { diff --git a/src/UnitInfo/core/SettingS.java b/src/UnitInfo/core/SettingS.java index 5f7b896..3c5f3c9 100644 --- a/src/UnitInfo/core/SettingS.java +++ b/src/UnitInfo/core/SettingS.java @@ -114,6 +114,7 @@ public class SettingS { addGraphicCheckSetting("pastwave", false, tapSeq); addGraphicCheckSetting("emptywave", true, tapSeq); addGraphicCheckSetting("itemcal", false, tapSeq); + addGraphicCheckSetting("schem", !mobile, tapSeq); Seq rangeSeq = new Seq<>(); addGraphicTypeSetting("rangeRadius", 0, 500, 70, true, () -> true, s -> s + "tiles", rangeSeq); diff --git a/src/UnitInfo/ui/SchemDisplay.java b/src/UnitInfo/ui/SchemDisplay.java index f38c399..159d0ab 100644 --- a/src/UnitInfo/ui/SchemDisplay.java +++ b/src/UnitInfo/ui/SchemDisplay.java @@ -37,8 +37,9 @@ public class SchemDisplay extends Table { } - void setSchemTable() { + public void setSchemTable() { clear(); + if(!settings.getBool(("schem"))) return; right(); button(bundle.get("hud.schematic-list"), Icon.downOpen, Styles.squareTogglet, () -> schemShown = !schemShown).width(160f).height(60f).checked(b -> { Image image = (Image)b.getCells().first().get();