aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/rift
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-07 23:37:18 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-07 23:37:18 +0200
commit02ac961b3f1a371302963559e875698de8eb7a1d (patch)
tree6432f510a74cc9381610466442ca023de6498a8a /src/main/java/at/hannibal2/skyhanni/features/rift
parent8b2bc18775d69d4ab854eed7e3e10e36085043fd (diff)
downloadskyhanni-02ac961b3f1a371302963559e875698de8eb7a1d.tar.gz
skyhanni-02ac961b3f1a371302963559e875698de8eb7a1d.tar.bz2
skyhanni-02ac961b3f1a371302963559e875698de8eb7a1d.zip
replace enum.getEntries() to enum.entries and using .addSelector<Enum>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/rift')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt8
2 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt
index aeb73b42d..d58eafd0e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt
@@ -109,7 +109,7 @@ class KloonHacking {
if (!config.waypoints) return
if (!wearingHelmet) return
val hidden = ProfileStorageData.profileSpecific?.rift ?: return
- for (terminal in KloonTerminal.values()) {
+ for (terminal in KloonTerminal.entries) {
if (terminal !in hidden.completedKloonTerminals) {
event.drawWaypointFilled(terminal.location, LorenzColor.DARK_RED.toColor(), true, true)
}
@@ -124,7 +124,7 @@ class KloonHacking {
"You've set the color of this terminal to (?<colour>.*)!".toPattern().matchMatcher(event.message.removeColor()) {
val hidden = ProfileStorageData.profileSpecific?.rift ?: return
val colour = group("colour")
- val completedTerminal = KloonTerminal.values().firstOrNull { it.name == colour } ?: return
+ val completedTerminal = KloonTerminal.entries.firstOrNull { it.name == colour } ?: return
if (completedTerminal != nearestTerminal) return
hidden.completedKloonTerminals.add(completedTerminal)
}
@@ -146,7 +146,7 @@ class KloonHacking {
var closestTerminal: KloonTerminal? = null
var closestDistance = 8.0
- for (terminal in KloonTerminal.values()) {
+ for (terminal in KloonTerminal.entries) {
val distance = terminal.location.distanceToPlayer()
if (distance < closestDistance) {
closestTerminal = terminal
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt
index 1f88a4ad1..25bafb299 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt
@@ -158,15 +158,17 @@ class ShowMotesNpcSellPrice {
}
val total = itemMap.values.fold(0.0) { acc, pair -> acc + pair.second }.formatPrice()
newDisplay.addAsSingletonList("§7Total price: §b$total")
- val name = FormatType.values()[config.inventoryValue.formatType].type
+ val name = FormatType.entries[config.inventoryValue.formatType].type
newDisplay.addAsSingletonList("§7Price format: §c$name")
- newDisplay.addSelector(" ", FormatType.values(),
+ newDisplay.addSelector<FormatType>(
+ " ",
getName = { type -> type.type },
isCurrent = { it.ordinal == config.inventoryValue.formatType },
onChange = {
config.inventoryValue.formatType = it.ordinal
update()
- })
+ }
+ )
return newDisplay
}