From d0cdd351c0e0b7d4212e9b9e77f5e87cd06d0757 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 23 Sep 2023 15:50:32 +0200 Subject: disabled translator --- .../hannibal2/skyhanni/config/features/ChatConfig.java | 16 +++++++++++----- .../at/hannibal2/skyhanni/features/chat/Translator.kt | 13 ++++++++++--- 2 files changed, 21 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/ChatConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/ChatConfig.java index 97d933ad6..4c68e8a3f 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/ChatConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/ChatConfig.java @@ -161,9 +161,15 @@ public class ChatConfig { @FeatureToggle public boolean hideArachneMessages = false; - @Expose - @ConfigOption(name = "Translator", desc = "Click on a message to translate it into English. Use /shcopytranslation to get the translation from English. Translation is not guaranteed to be 100% accurate.") - @ConfigEditorBoolean - @FeatureToggle - public boolean translator = false; + // TODO reenable once the translator is working again +// @Expose +// @ConfigOption( +// name = "Translator", +// desc = "Click on a message to translate it into English. " + +// "Use /shcopytranslation to get the translation from English. " + +// "Translation is not guaranteed to be 100% accurate." +// ) +// @ConfigEditorBoolean +// @FeatureToggle +// public boolean translator = false; } diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt index 851adb45d..e7f3ea46f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt @@ -30,7 +30,7 @@ class Translator { @SubscribeEvent(priority = EventPriority.LOWEST) fun onGuiChat(event: LorenzChatEvent) { - if (!SkyHanniMod.feature.chat.translator) return + if (!isEnabled()) return val message = event.message if (message.getPlayerName() == "-") return @@ -60,6 +60,8 @@ class Translator { companion object { + private val config get() = SkyHanniMod.feature.chat + // Using my own getJSONResponse because of 1 line of difference. private val parser = JsonParser() private val builder: HttpClientBuilder = @@ -183,7 +185,7 @@ class Translator { } fun toEnglish(args: Array) { - if (!SkyHanniMod.feature.chat.translator) return + if (!isEnabled()) return var message = "" for (i in args) { message = "$message$i " @@ -196,7 +198,7 @@ class Translator { } fun fromEnglish(args: Array) { - if (!SkyHanniMod.feature.chat.translator) return + if (!isEnabled()) return if (args.size < 2 || args[0].length != 2) { // args[0] is the language code LorenzUtils.chat("§cUsage: /shcopytranslation ") return @@ -211,5 +213,10 @@ class Translator { LorenzUtils.chat("§e[SkyHanni] Copied translation to clipboard: $translation") OSUtils.copyToClipboard(translation) } + + + // TODO reenable once the translator is working again +// fun isEnabled() = config.translator + fun isEnabled() = false } } \ No newline at end of file -- cgit