aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-25 12:55:04 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-25 12:55:04 +0100
commit0861581f3d173e6129bfed6988dcb371a6927af4 (patch)
treef1345c298591602fc300722b3833aac5c679af46 /src/main
parenta2ff9d256b85e68b59c2c5f8a871d63b3e65d143 (diff)
downloadskyhanni-0861581f3d173e6129bfed6988dcb371a6927af4.tar.gz
skyhanni-0861581f3d173e6129bfed6988dcb371a6927af4.tar.bz2
skyhanni-0861581f3d173e6129bfed6988dcb371a6927af4.zip
The hidden flag for items in Item Trackers is now shared between total view and session view.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt2
2 files changed, 11 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt
index 66357e1c0..85d623fa1 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt
@@ -38,6 +38,11 @@ class SkyHanniItemTracker<Data : ItemTrackerData>(
modify {
it.additem(internalName, stackSize)
}
+ getSharedTracker()?.let {
+ val hidden = it.get(DisplayMode.TOTAL).items[internalName]!!.hidden
+ it.get(DisplayMode.SESSION).items[internalName]!!.hidden = hidden
+ }
+
}
fun addPriceFromButton(lists: MutableList<List<Any>>) {
@@ -95,8 +100,9 @@ class SkyHanniItemTracker<Data : ItemTrackerData>(
LorenzUtils.chat("§e[SkyHanni] Removed $cleanName §efrom Fishing Frofit Tracker.")
lastClickDelay = System.currentTimeMillis() + 500
} else {
- itemProfit.hidden = !hidden
-
+ modify {
+ it.items[internalName]?.hidden = !hidden
+ }
lastClickDelay = System.currentTimeMillis()
}
update()
@@ -133,6 +139,8 @@ class SkyHanniItemTracker<Data : ItemTrackerData>(
}
add("§eClick to " + (if (hidden) "show" else "hide") + "!")
add("§eControl + Click to remove this item!")
+ add("")
+ add("§7${internalName}")
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt
index 3d68b8316..331be034b 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt
@@ -122,7 +122,7 @@ open class SkyHanniTracker<Data : TrackerData>(
}
)
- private fun getSharedTracker() = ProfileStorageData.profileSpecific?.let {
+ protected fun getSharedTracker() = ProfileStorageData.profileSpecific?.let {
SharedTracker(getStorage(it), currentSessions.getOrPut(it) { createNewSession() })
}