aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-02-19 23:07:07 +1100
committerGitHub <noreply@github.com>2024-02-19 13:07:07 +0100
commit4bb1419b90e424ac824042188f67a371a5c276da (patch)
tree7563d81dd18089612140440ac9f91f666fce3a04
parent82620115882a256d755fbb46e0d51b9521fcdbf1 (diff)
downloadskyhanni-4bb1419b90e424ac824042188f67a371a5c276da.tar.gz
skyhanni-4bb1419b90e424ac824042188f67a371a5c276da.tar.bz2
skyhanni-4bb1419b90e424ac824042188f67a371a5c276da.zip
Fixed tablist footer being uncoloured. #1020
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt
index 659d49e20..07473f9d9 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt
@@ -4,8 +4,8 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.mixins.transformers.AccessorGuiPlayerTabOverlay
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import at.hannibal2.skyhanni.utils.StringUtils.removeResets
+import at.hannibal2.skyhanni.utils.StringUtils.removeSFormattingCode
import at.hannibal2.skyhanni.utils.StringUtils.trimWhiteSpaceAndResets
import at.hannibal2.skyhanni.utils.TabListData
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
@@ -107,7 +107,7 @@ object TabListReader {
val column = TabColumn("§2§lOther")
- var footer = tabList.footer_skyhanni.formattedText.removeColor()
+ var footer = tabList.footer_skyhanni.formattedText.removeSFormattingCode()
var matcher = godPotPattern.matcher(tabList.footer_skyhanni.unformattedText)
if (matcher.find()) {
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
index 001315baf..192073111 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
@@ -18,11 +18,13 @@ object StringUtils {
private val whiteSpaceResetPattern = "^(?:\\s|§r)*|(?:\\s|§r)*$".toPattern()
private val whiteSpacePattern = "^\\s*|\\s*$".toPattern()
private val resetPattern = "(?i)§R".toPattern()
+ private val sFormattingPattern = "(?i)§S".toPattern()
private val stringColourPattern = "§[0123456789abcdef].*".toPattern()
fun String.trimWhiteSpaceAndResets(): String = whiteSpaceResetPattern.matcher(this).replaceAll("")
fun String.trimWhiteSpace(): String = whiteSpacePattern.matcher(this).replaceAll("")
fun String.removeResets(): String = resetPattern.matcher(this).replaceAll("")
+ fun String.removeSFormattingCode(): String = sFormattingPattern.matcher(this).replaceAll("")
fun String.firstLetterUppercase(): String {
if (isEmpty()) return this