diff options
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/gui/TextBoxConfig.java | 5 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/CustomTextBox.kt | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/gui/TextBoxConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/gui/TextBoxConfig.java index 134732465..2089fc88e 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/gui/TextBoxConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/gui/TextBoxConfig.java @@ -15,6 +15,11 @@ public class TextBoxConfig { public boolean enabled = false; @Expose + @ConfigOption(name = "Only in GUI", desc = "Only show the textbox while an Inventory is open.") + @ConfigEditorBoolean + public boolean onlyInGUI = false; + + @Expose @ConfigOption(name = "Text", desc = "Enter text you want to display here.\n" + "§eUse '&' as the colour code character.\n" + "§eUse '\\n' as the line break character.") diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CustomTextBox.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CustomTextBox.kt index ffe6a79ae..a2369fc38 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CustomTextBox.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CustomTextBox.kt @@ -26,8 +26,18 @@ class CustomTextBox { private fun String.format() = replace("&", "§").split("\\n").toList() @SubscribeEvent + fun onRenderGUIOverlay(event: GuiRenderEvent.ChestGuiOverlayRenderEvent) { + if (!config.enabled) return + if (!config.onlyInGUI) return + if (!LorenzUtils.inSkyBlock) return + + config.position.renderStrings(display, posLabel = "Custom Text Box") + } + + @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (!config.enabled) return + if (config.onlyInGUI) return if (!LorenzUtils.inSkyBlock) return config.position.renderStrings(display, posLabel = "Custom Text Box") |