aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-29 17:08:20 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-29 17:08:20 +0200
commit238085dd49de8bca06ed816bc7a8d369390cdf30 (patch)
tree8bac9b5d8fb399af45aa21343f00c450274b9ff0 /src/main/java
parente34960c5ef84807d7f610641e4ff6b9a58f4d714 (diff)
downloadskyhanni-238085dd49de8bca06ed816bc7a8d369390cdf30.tar.gz
skyhanni-238085dd49de8bca06ed816bc7a8d369390cdf30.tar.bz2
skyhanni-238085dd49de8bca06ed816bc7a8d369390cdf30.zip
code cleanup
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/events/SackChangeEvent.kt8
2 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt
index 4efb30727..3990e13d6 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt
@@ -17,8 +17,6 @@ class SackAPI {
fun onChat(event: LorenzChatEvent) {
if (!event.message.removeColor().startsWith("[Sacks]")) return
- val sackChanges = ArrayList<SackChange>()
-
val sackAddText = event.chatComponent.siblings.firstNotNullOfOrNull { sibling ->
sibling.chatStyle?.chatHoverEvent?.value?.formattedText?.removeColor()?.takeIf {
it.startsWith("Added")
@@ -36,6 +34,7 @@ class SackAPI {
val otherItemsAdded = sackAddText.contains("other items")
val otherItemsRemoved = sackRemoveText.contains("other items")
+ val sackChanges = ArrayList<SackChange>()
for (match in sackChangeRegex.findAll(sackChangeText)) {
val delta = match.groups[1]!!.value.replace(",", "").toInt()
val item = match.groups[2]!!.value
diff --git a/src/main/java/at/hannibal2/skyhanni/events/SackChangeEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/SackChangeEvent.kt
index 797605e80..b2006bc0d 100644
--- a/src/main/java/at/hannibal2/skyhanni/events/SackChangeEvent.kt
+++ b/src/main/java/at/hannibal2/skyhanni/events/SackChangeEvent.kt
@@ -2,6 +2,8 @@ package at.hannibal2.skyhanni.events
import at.hannibal2.skyhanni.data.SackAPI
-class SackChangeEvent(val sackChanges: List<SackAPI.SackChange>,
- val otherItemsAdded: Boolean,
- val otherItemsRemoved: Boolean) : LorenzEvent()
+class SackChangeEvent(
+ val sackChanged: List<SackAPI.SackChange>,
+ val otherItemsAdded: Boolean,
+ val otherItemsRemoved: Boolean
+) : LorenzEvent()