diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-23 15:50:32 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-23 15:50:32 +0200 |
commit | d0cdd351c0e0b7d4212e9b9e77f5e87cd06d0757 (patch) | |
tree | 37c0766cdf39b7c9f2afbd38cea2e7378063f665 /src | |
parent | a7b17939cca46fc5b0bdcd859df6da25caa143f2 (diff) | |
download | skyhanni-d0cdd351c0e0b7d4212e9b9e77f5e87cd06d0757.tar.gz skyhanni-d0cdd351c0e0b7d4212e9b9e77f5e87cd06d0757.tar.bz2 skyhanni-d0cdd351c0e0b7d4212e9b9e77f5e87cd06d0757.zip |
disabled translator
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/ChatConfig.java | 16 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt | 13 |
2 files changed, 21 insertions, 8 deletions
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<String>) { - 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<String>) { - 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 <two letter language code (at the end of a translation)> <message>") 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 |