From 0861581f3d173e6129bfed6988dcb371a6927af4 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 25 Nov 2023 12:55:04 +0100 Subject: The hidden flag for items in Item Trackers is now shared between total view and session view. --- .../hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt | 12 ++++++++++-- .../at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2') 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( 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>) { @@ -95,8 +100,9 @@ class SkyHanniItemTracker( 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( } 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( } ) - private fun getSharedTracker() = ProfileStorageData.profileSpecific?.let { + protected fun getSharedTracker() = ProfileStorageData.profileSpecific?.let { SharedTracker(getStorage(it), currentSessions.getOrPut(it) { createNewSession() }) } -- cgit