aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-10 14:33:20 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-10 14:33:20 +0200
commit698ebfb1a5673e52f97c681d41a1eb4becf92df7 (patch)
tree42bcd3a46d2e6814940a0924593d642a2982c15b /src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
parent90b7eba90154668696d69766aed7be1aae61b9a6 (diff)
downloadskyhanni-698ebfb1a5673e52f97c681d41a1eb4becf92df7.tar.gz
skyhanni-698ebfb1a5673e52f97c681d41a1eb4becf92df7.tar.bz2
skyhanni-698ebfb1a5673e52f97c681d41a1eb4becf92df7.zip
+ Changed Slayer Profit Tracker
+ Option to change price between npc/instant sell and sell offer + Save data in config + Added option to hide an item from the display + Showing the profit per boss = Different tiers of same slayer type no longer gets merged together
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
index fc043e26b..90dcddf9b 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
@@ -93,4 +93,16 @@ object StringUtils {
fun encodeBase64(input: String) = Base64.getEncoder().encodeToString(input.toByteArray())
fun decodeBase64(input: String) = Base64.getDecoder().decode(input).decodeToString()
+
+ fun addFormat(text: String, format: String): String {
+ if (text.length < 2) return text
+
+ val rawText = text.substring(2)
+ return if (rawText == text.removeColor()) {
+ val originalColor = text.substring(0, 2)
+ "$originalColor$format$rawText"
+ } else {
+ "$format$text"
+ }
+ }
} \ No newline at end of file