diff options
author | syeyoung <cyoung06@naver.com> | 2023-02-08 21:55:09 +0900 |
---|---|---|
committer | syeyoung <cyoung06@naver.com> | 2023-02-08 21:55:09 +0900 |
commit | 634c97f91c1fc52fb3cc980c3a5b8ccaf942eb17 (patch) | |
tree | fc87236885a7aff39b1d08a0bc92c07c10e89b64 | |
parent | 24cf65abae9303fe01dca72be9881f8af7f131f4 (diff) | |
download | Skyblock-Dungeons-Guide-634c97f91c1fc52fb3cc980c3a5b8ccaf942eb17.tar.gz Skyblock-Dungeons-Guide-634c97f91c1fc52fb3cc980c3a5b8ccaf942eb17.tar.bz2 Skyblock-Dungeons-Guide-634c97f91c1fc52fb3cc980c3a5b8ccaf942eb17.zip |
- TextStyles hierarchy
Signed-off-by: syeyoung <cyoung06@naver.com>
17 files changed, 62 insertions, 41 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomCoordDisplay.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomCoordDisplay.java index 1e1b622b..13492c81 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomCoordDisplay.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomCoordDisplay.java @@ -25,6 +25,8 @@ import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; import kr.syeyoung.dungeonsguide.mod.config.types.AColor; import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.text.DefaultTextHUDFeatureStyleFeature; import kr.syeyoung.dungeonsguide.mod.features.text.DefaultingDelegatingTextStyle; import kr.syeyoung.dungeonsguide.mod.features.text.NullTextStyle; import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; @@ -39,7 +41,8 @@ public class FeatureRoomCoordDisplay extends TextHUDFeature { public FeatureRoomCoordDisplay() { super("Debug", "Display Coordinate Relative to the Dungeon Room and room's rotation", "X: 0 Y: 3 Z: 5 Facing: Z+" , "advanced.coords"); this.setEnabled(false); - registerDefaultStyle("coord", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(Color.yellow.getRGB(),true)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("coord", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.DEFAULT)) + .setTextShader(new AColor(Color.yellow.getRGB(),true))); } SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomDebugInfo.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomDebugInfo.java index 3ecea83b..d02d863c 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomDebugInfo.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomDebugInfo.java @@ -24,6 +24,7 @@ import kr.syeyoung.dungeonsguide.mod.config.types.AColor; import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.text.DefaultTextHUDFeatureStyleFeature; import kr.syeyoung.dungeonsguide.mod.features.text.DefaultingDelegatingTextStyle; import kr.syeyoung.dungeonsguide.mod.features.text.NullTextStyle; import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; @@ -39,7 +40,8 @@ public class FeatureRoomDebugInfo extends TextHUDFeature { public FeatureRoomDebugInfo() { super("Debug", "Display Room Debug Info", "ONLY WORKS WITH SECRET SETTING", "advanced.debug.roominfo"); this.setEnabled(false); - registerDefaultStyle("info", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(Color.white.getRGB(),true)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("info", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.DEFAULT)) + .setTextShader(new AColor(Color.white.getRGB(),true))); } SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureBossHealth.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureBossHealth.java index 83fe2932..0d5e1f56 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureBossHealth.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureBossHealth.java @@ -46,8 +46,8 @@ public class FeatureBossHealth extends TextHUDFeature { registerDefaultStyle("title", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.NAME))); registerDefaultStyle("separator", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.SEPARATOR))); registerDefaultStyle("health", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); - registerDefaultStyle("separator2", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.SEPARATOR))); - registerDefaultStyle("maxHealth", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0x55, 0x55,0xFF,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("separator2", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.FRACTION))); + registerDefaultStyle("maxHealth", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.TOTAL))); } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java index a3d435c1..df1492f3 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java @@ -38,8 +38,8 @@ public class FeatureDungeonCurrentRoomSecrets extends TextHUDFeature { registerDefaultStyle("title", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.NAME))); registerDefaultStyle("separator", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.SEPARATOR))); registerDefaultStyle("currentSecrets", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); - registerDefaultStyle("separator2", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.SEPARATOR))); - registerDefaultStyle("totalSecrets", DefaultingDelegatingTextStyle.ofDefault().setTextShader( new AColor(0x55, 0xFF,0xFF,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("separator2", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.FRACTION))); + registerDefaultStyle("totalSecrets", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.TOTAL))); } SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRealTime.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRealTime.java index c282a975..d45f0276 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRealTime.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRealTime.java @@ -36,7 +36,7 @@ public class FeatureDungeonRealTime extends TextHUDFeature { super("Dungeon.HUDs", "Display Real Time-Dungeon Time", "Display how much real time has passed since dungeon run started", "dungeon.stats.realtime"); this.setEnabled(false); registerDefaultStyle("title", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.NAME))); - registerDefaultStyle("discriminator", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0xAA,0xAA,0xAA,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("discriminator", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.EXTRA_INFO))); registerDefaultStyle("separator", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.SEPARATOR))); registerDefaultStyle("number", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSBTime.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSBTime.java index 5b0ae9ac..7265b20d 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSBTime.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSBTime.java @@ -44,7 +44,7 @@ public class FeatureDungeonSBTime extends TextHUDFeature { super("Dungeon.HUDs", "Display Ingame Dungeon Time", "Display how much time skyblock thinks has passed since dungeon run started", "dungeon.stats.igtime"); this.setEnabled(false); registerDefaultStyle("title", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.NAME))); - registerDefaultStyle("discriminator", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0xAA,0xAA,0xAA,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("discriminator", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.EXTRA_INFO))); registerDefaultStyle("separator", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.SEPARATOR))); registerDefaultStyle("number", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonScore.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonScore.java index 2a3913db..cd37a1a6 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonScore.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonScore.java @@ -55,12 +55,14 @@ public class FeatureDungeonScore extends TextHUDFeature { registerDefaultStyle("scorename", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.NAME))); registerDefaultStyle("separator", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.SEPARATOR))); registerDefaultStyle("score", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); - registerDefaultStyle("brackets", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.SEPARATOR))); - registerDefaultStyle("etc", DefaultingDelegatingTextStyle.ofDefault().setTextShader( new AColor(0xAA,0xAA,0xAA,255)).setBackgroundShader(new AColor(0, 0,0,0))); - registerDefaultStyle("currentScore", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0xFF, 0xAA,0x00,255)).setBackgroundShader(new AColor(0, 0,0,0))); - registerDefaultStyle("arrow", DefaultingDelegatingTextStyle.ofDefault().setTextShader( new AColor(0xAA,0xAA,0xAA,255)).setBackgroundShader(new AColor(0, 0,0,0))); - registerDefaultStyle("nextScore", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0xFF, 0xAA,0x00,255)).setBackgroundShader(new AColor(0, 0,0,0))); - registerDefaultStyle("required", DefaultingDelegatingTextStyle.ofDefault().setTextShader( new AColor(0xAA,0xAA,0xAA,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("brackets", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.BRACKET))); + registerDefaultStyle("etc", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.EXTRA_INFO))); + registerDefaultStyle("currentScore", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.DEFAULT)) + .setTextShader(new AColor(0xFF, 0xAA,0x00,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("arrow", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.EXTRA_INFO))); + registerDefaultStyle("nextScore", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.DEFAULT)) + .setTextShader(new AColor(0xFF, 0xAA,0x00,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("required", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.EXTRA_INFO))); } SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSecrets.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSecrets.java index 63b4071b..93622f2f 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSecrets.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSecrets.java @@ -41,9 +41,10 @@ public class FeatureDungeonSecrets extends TextHUDFeature { registerDefaultStyle("title", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.NAME))); registerDefaultStyle("separator", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.SEPARATOR))); registerDefaultStyle("currentSecrets", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); - registerDefaultStyle("separator2", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.SEPARATOR))); - registerDefaultStyle("totalSecrets", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); - registerDefaultStyle("unknown", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0xFF, 0xFF,0x55,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("separator2", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.FRACTION))); + registerDefaultStyle("totalSecrets", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.TOTAL))); + registerDefaultStyle("unknown", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.DEFAULT)) + .setTextShader(new AColor(0xFF, 0xFF,0x55,255))); } SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWarnLowHealth.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWarnLowHealth.java index e873e76c..3e6d17d8 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWarnLowHealth.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWarnLowHealth.java @@ -42,8 +42,8 @@ public class FeatureWarnLowHealth extends TextHUDFeature { addParameter("threshold", new FeatureParameter<Integer>("threshold", "Health Threshold", "Health Threshold for this feature to be toggled. default to 500", 500, TCInteger.INSTANCE)); registerDefaultStyle("title", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.NAME))); registerDefaultStyle("separator", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.SEPARATOR))); - registerDefaultStyle("number", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0xFF, 0x55,0x55,255)).setBackgroundShader(new AColor(0, 0,0,0))); - registerDefaultStyle("unit", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0xFF, 0x55,0x55,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("number", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.DEFAULT)) + .setTextShader(new AColor(0xFF, 0x55,0x55,255))); setEnabled(false); } @@ -62,7 +62,6 @@ public class FeatureWarnLowHealth extends TextHUDFeature { dummyText.addChild(new TextSpan(getStyle("title"), "DungeonsGuide")); dummyText.addChild(new TextSpan(getStyle("separator"), ": ")); dummyText.addChild(new TextSpan(getStyle("number"), "500")); - dummyText.addChild(new TextSpan(getStyle("unit"), "hp")); return dummyText; } @@ -90,7 +89,6 @@ public class FeatureWarnLowHealth extends TextHUDFeature { actualBit.addChild(new TextSpan(getStyle("title"), lowestHealthName)); actualBit.addChild(new TextSpan(getStyle("separator"), ": ")); actualBit.addChild(new TextSpan(getStyle("number"), lowestHealth+"")); - actualBit.addChild(new TextSpan(getStyle("unit"), "hp")); return actualBit; } } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWatcherWarning.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWatcherWarning.java index fe2c28d5..8371c751 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWatcherWarning.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWatcherWarning.java @@ -26,6 +26,8 @@ import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; import kr.syeyoung.dungeonsguide.mod.events.annotations.DGEventHandler; import kr.syeyoung.dungeonsguide.mod.events.impl.DungeonLeftEvent; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.text.DefaultTextHUDFeatureStyleFeature; import kr.syeyoung.dungeonsguide.mod.features.text.DefaultingDelegatingTextStyle; import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; import kr.syeyoung.dungeonsguide.mod.guiv2.elements.richtext.TextSpan; @@ -37,7 +39,7 @@ public class FeatureWatcherWarning extends TextHUDFeature { public FeatureWatcherWarning() { super("Dungeon.Blood Room","Watcher Spawn Alert", "Alert when watcher says 'That will be enough for now'", "dungen.watcherwarn"); - registerDefaultStyle("warning", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0xFF, 0x69,0x17,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("warning", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.WARNING))); setEnabled(false); } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/FeatureAbilityCooldown.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/FeatureAbilityCooldown.java index a0c65a88..ef5151c3 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/FeatureAbilityCooldown.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/ability/FeatureAbilityCooldown.java @@ -52,7 +52,7 @@ public class FeatureAbilityCooldown extends TextHUDFeature { registerDefaultStyle("separator", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.SEPARATOR))); registerDefaultStyle("number", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); registerDefaultStyle("unit",DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.NAME))); - registerDefaultStyle("ready",DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0xDF, 0x00,0x67,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("ready",DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.WARNING))); // kinda warning addParameter("disable", new FeatureParameter<Boolean>("disable", "Disable outside of dungeon", "Disable the feature when out of dungeon", false, TCBoolean.INSTANCE)); addParameter("decimal", new FeatureParameter<Integer>("decimal", "Decimal places", "ex) 2 -> Cooldown: 3.21 3-> Cooldown: 3.210", 0, TCInteger.INSTANCE)); } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeaturePartyList.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeaturePartyList.java index ed689d0b..f888828b 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeaturePartyList.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeaturePartyList.java @@ -35,7 +35,7 @@ public class FeaturePartyList extends TextHUDFeature { registerDefaultStyle("name", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.NAME))); registerDefaultStyle("separator", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.SEPARATOR))); registerDefaultStyle("player", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); - registerDefaultStyle("allinvite", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0xAA,0xAA,0xAA,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("allinvite", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.EXTRA_INFO))); setEnabled(false); } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeaturePartyReady.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeaturePartyReady.java index ff9c5bc4..3294fe84 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeaturePartyReady.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/party/FeaturePartyReady.java @@ -41,8 +41,10 @@ public class FeaturePartyReady extends TextHUDFeature { super("Party","Party Ready List", "Check if your party member have said r or not", "party.readylist"); registerDefaultStyle("player", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.NAME))); registerDefaultStyle("separator", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.SEPARATOR))); - registerDefaultStyle("ready", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); - registerDefaultStyle("notready", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0xFF, 0x55,0x55,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("ready", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.DEFAULT)) + .setTextShader(new AColor(0x55, 0xFF,0xFF,255))); + registerDefaultStyle("notready", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.DEFAULT)) + .setTextShader(new AColor(0xFF, 0x55,0x55,255))); registerDefaultStyle("terminal", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); setEnabled(true); } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureActions.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureActions.java index ca8b9814..8cd2ca55 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureActions.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureActions.java @@ -43,14 +43,16 @@ public class FeatureActions extends TextHUDFeature { super("Dungeon.Secrets", "Action Viewer", "View List of actions that needs to be taken", "secret.actionview"); registerDefaultStyle("pathfinding", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.NAME))); - registerDefaultStyle("mechanic", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0x55, 0xFF,0x55,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("mechanic", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.DEFAULT)) + .setTextShader(new AColor(0x55, 0xFF,0x55,255))); registerDefaultStyle("separator", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.SEPARATOR))); - registerDefaultStyle("state", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0x55, 0xFF,0x55,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("state", DefaultingDelegatingTextStyle.derive(() -> getStyle("mechanic")) + .setTextShader(new AColor(0x55, 0xFF,0x55,255))); registerDefaultStyle("current", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); - registerDefaultStyle("number", DefaultingDelegatingTextStyle.ofDefault().setTextShader( new AColor(0x00, 0xAA,0xAA,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("number", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.NAME))); registerDefaultStyle("dot", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.SEPARATOR))); registerDefaultStyle("action", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); - registerDefaultStyle("afterline", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0xAA, 0xAA,0xAA,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("afterline", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.EXTRA_INFO))); } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureSoulRoomWarning.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureSoulRoomWarning.java index 545f8629..ad5c6b91 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureSoulRoomWarning.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureSoulRoomWarning.java @@ -32,6 +32,8 @@ import kr.syeyoung.dungeonsguide.mod.dungeon.roomprocessor.GeneralRoomProcessor; import kr.syeyoung.dungeonsguide.mod.events.annotations.DGEventHandler; import kr.syeyoung.dungeonsguide.mod.events.impl.DGTickEvent; import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.mod.features.text.DefaultTextHUDFeatureStyleFeature; import kr.syeyoung.dungeonsguide.mod.features.text.DefaultingDelegatingTextStyle; import kr.syeyoung.dungeonsguide.mod.features.text.TextHUDFeature; import kr.syeyoung.dungeonsguide.mod.guiv2.BindableAttribute; @@ -53,7 +55,7 @@ public class FeatureSoulRoomWarning extends TextHUDFeature { public FeatureSoulRoomWarning() { super("Dungeon.HUDs","Secret Soul Alert", "Alert if there is an fairy soul in the room", "secret.fairysoulwarn"); - registerDefaultStyle("warning", DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0xFF, 0x69,0x17,255)).setBackgroundShader(new AColor(0, 0,0,0))); + registerDefaultStyle("warning", DefaultingDelegatingTextStyle.derive(() -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.WARNING))); addParameter("roomuids", new FeatureParameter<>("roomuids", "Disabled room Names", "Disable for these rooms", new ArrayList<>(), TCStringList.INSTANCE) .setWidgetGenerator(RoomConfiguration::new)); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/DefaultTextHUDFeatureStyleFeature.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/DefaultTextHUDFeatureStyleFeature.java index a23047a4..23b31cc9 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/DefaultTextHUDFeatureStyleFeature.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/DefaultTextHUDFeatureStyleFeature.java @@ -30,15 +30,22 @@ import java.util.Set; public class DefaultTextHUDFeatureStyleFeature extends SimpleFeature { public enum Styles { - NAME, VALUE, SEPARATOR + DEFAULT, NAME, VALUE, SEPARATOR, FRACTION, EXTRA_INFO, TOTAL, BRACKET, WARNING } public DefaultTextHUDFeatureStyleFeature() { super("Misc", "Quick HUD Style Settings", "Configure the default hud style", "misc.defaulthud"); - registerDefaultStyle(Styles.NAME, DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0x00, 0xAA,0xAA,255))); - registerDefaultStyle(Styles.VALUE, DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0x55, 0xFF,0xFF,255))); - registerDefaultStyle(Styles.SEPARATOR, DefaultingDelegatingTextStyle.ofDefault().setTextShader(new AColor(0x55, 0x55,0x55,255))); + registerDefaultStyle(Styles.DEFAULT, DefaultingDelegatingTextStyle.ofDefault()); + registerDefaultStyle(Styles.NAME, DefaultingDelegatingTextStyle.derive(() -> getStyle(Styles.DEFAULT)).setTextShader(new AColor(0x00, 0xAA,0xAA,255))); + registerDefaultStyle(Styles.VALUE, DefaultingDelegatingTextStyle.derive(() -> getStyle(Styles.DEFAULT)).setTextShader(new AColor(0x55, 0xFF,0xFF,255))); + registerDefaultStyle(Styles.SEPARATOR, DefaultingDelegatingTextStyle.derive(() -> getStyle(Styles.DEFAULT)).setTextShader(new AColor(0x55, 0x55,0x55,255))); + registerDefaultStyle(Styles.EXTRA_INFO, DefaultingDelegatingTextStyle.derive(() -> getStyle(Styles.DEFAULT)).setTextShader(new AColor(0xAA,0xAA,0xAA,255))); + registerDefaultStyle(Styles.BRACKET, DefaultingDelegatingTextStyle.derive(() -> getStyle(Styles.DEFAULT)).setTextShader(new AColor(0x55, 0x55,0x55,255))); + registerDefaultStyle(Styles.WARNING, DefaultingDelegatingTextStyle.derive(() -> getStyle(Styles.DEFAULT)).setTextShader(new AColor(0xFF, 0x69,0x17,255))); + + registerDefaultStyle(Styles.FRACTION, DefaultingDelegatingTextStyle.derive(() -> getStyle(Styles.SEPARATOR))); + registerDefaultStyle(Styles.TOTAL, DefaultingDelegatingTextStyle.derive(() -> getStyle(Styles.VALUE))); addParameter("newstyle", new FeatureParameter<>("newstyle", "TextStyle", "", styleMap, new TCRTextStyleMap(), this::updateStyle)); } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/DefaultingDelegatingTextStyle.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/DefaultingDelegatingTextStyle.java index c60bb4dd..8aab3304 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/DefaultingDelegatingTextStyle.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/DefaultingDelegatingTextStyle.java @@ -141,32 +141,32 @@ public class DefaultingDelegatingTextStyle implements ITextStyle, Cloneable { @Override public Shader getShadowShader() { - return parent != null && shadowShader == null ? getParent().getShadowShader() : shadowShader.getShader(); + return parent != null && shadowShader == null ? getParent().getShadowShader() : shadowShader == null ? null : shadowShader.getShader(); } @Override public Shader getBackgroundShader() { - return parent != null && backgroundShader == null ? getParent().getBackgroundShader() : backgroundShader.getShader(); + return parent != null && backgroundShader == null ? getParent().getBackgroundShader() : backgroundShader == null ? null : backgroundShader.getShader(); } @Override public Shader getOutlineShader() { - return parent != null && outlineShader == null ? getParent().getOutlineShader() : outlineShader.getShader(); + return parent != null && outlineShader == null ? getParent().getOutlineShader() : outlineShader == null ? null : outlineShader.getShader(); } @Override public Shader getStrikeThroughShader() { - return parent != null && strikeThroughShader == null ? getParent().getStrikeThroughShader() : strikeThroughShader.getShader(); + return parent != null && strikeThroughShader == null ? getParent().getStrikeThroughShader() : strikeThroughShader == null ? null : strikeThroughShader.getShader(); } @Override public Shader getTextShader() { - return parent != null && textShader == null ? getParent().getTextShader() : textShader.getShader(); + return parent != null && textShader == null ? getParent().getTextShader() : textShader == null ? null : textShader.getShader(); } @Override public Shader getUnderlineShader() { - return parent != null && underlineShader == null ? getParent().getUnderlineShader() : underlineShader.getShader(); + return parent != null && underlineShader == null ? getParent().getUnderlineShader() : underlineShader == null ? null : underlineShader.getShader(); } public DefaultingDelegatingTextStyle clone() { |