aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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