diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-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 |