diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-16 12:34:18 +0200 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-16 12:34:18 +0200 |
| commit | 4293cfd919c3c93d4532534f722c407d7ad1370d (patch) | |
| tree | f9f612f021ef7f4283d74312edfaca30badc6749 /src/main/java/at/hannibal2/skyhanni/features/chat | |
| parent | 538e3ceb76f8e0b590291ce9aa90aa94896cdcb6 (diff) | |
| parent | 024ba52fb69b6cd44b4e31542867f802de656f15 (diff) | |
| download | SkyHanni-cum.tar.gz SkyHanni-cum.tar.bz2 SkyHanni-cum.zip | |
Merge branch 'beta' into cumcum
# Conflicts:
# src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt
# src/main/java/at/hannibal2/skyhanni/config/features/AshfangConfig.java
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/chat')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt | 8 |
1 files changed, 3 insertions, 5 deletions
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 f39905876..1274fbdf2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt @@ -34,13 +34,11 @@ class Translator { if (e.type != 0.toByte()) return // If this is not a player-sent message, return val chatComponent = e.message - // If you want to help me debug, experience the bug while this line is uncommented (spams logs) -// consoleLog(chatComponent.toString()) val message = chatComponent.unformattedText if (!messageContentRegex.matches(message.removeColor())) return val clickStyle = createClickStyle(message) - chatComponent.setChatStyle(clickStyle) + chatComponent.siblings.last().setChatStyle(clickStyle) } private fun createClickStyle(message: String): ChatStyle { @@ -180,7 +178,7 @@ class Translator { val sentenceWithoutQuotes = sentence.substring(1, sentence.length - 1) messageToSend = "$messageToSend$sentenceWithoutQuotes" } // The first translated sentence only has 1 extra char at the end, but sentences after it need 1 at the front and 1 at the end removed in the substring - messageToSend = messageToSend.substring(1, messageToSend.length - 1) + messageToSend = messageToSend.substring(1, messageToSend.length) return URLDecoder.decode(messageToSend, "UTF-8").replace("\\", "") } @@ -210,7 +208,7 @@ class Translator { } val translation = getTranslationFromEnglish(message, language) - LorenzUtils.chat("§6[SkyHanni] §eCopied translation to clipboard: $translation") + LorenzUtils.chat("§e[SkyHanni] Copied translation to clipboard: $translation") OSUtils.copyToClipboard(translation) } } |
