From 65b5c9b1f7f7bf351027fefd7a4cad685e6c4282 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 28 Oct 2023 21:08:03 +0200 Subject: Fixed the attribute Vitality getting wrongly labelled as Mending on Attribute Shards. --- .../hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt index 6300b0cfd..b92bc8f0a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt @@ -249,7 +249,7 @@ object EstimatedItemValue { if (price != null) { list.add( "§7Attribute §9${ - attributes[0].first.split("_").joinToString(" ") { it.firstLetterUppercase() } + attributes[0].first.fixMending().split("_").joinToString(" ") { it.firstLetterUppercase() } } ${attributes[0].second}§7: (§6${NumberUtil.format(price)}§7)" ) return price @@ -272,8 +272,7 @@ object EstimatedItemValue { if (price != null) { subTotal += price } - var displayName = attr.first - if (displayName == ("MENDING")) displayName = "VITALITY" + val displayName = attr.first.fixMending() list.add( " §9${ displayName.split("_").joinToString(" ") { it.firstLetterUppercase() } @@ -283,6 +282,8 @@ object EstimatedItemValue { return subTotal } + private fun String.fixMending() = if (this == "MENDING") "VITALITY" else this + private fun getPriceOrCompositePriceForAttribute(attributeName: String, level: Int): Double? { return (1..10).mapNotNull { lowerLevel -> "$attributeName;$lowerLevel".asInternalName().getPriceOrNull() -- cgit