From a197d3de1ccedc8a027353d61d028389fa84fc9e Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Fri, 2 Aug 2024 10:58:41 +0200 Subject: Fix: Sack Item Pickup Log delay (#2292) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../java/at/hannibal2/skyhanni/features/inventory/ItemPickupLog.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemPickupLog.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemPickupLog.kt index 825931150..fd2d4623b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemPickupLog.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemPickupLog.kt @@ -65,6 +65,7 @@ object ItemPickupLog { private var itemsAddedToInventory = mutableMapOf() private var itemsRemovedFromInventory = mutableMapOf() private var display: Renderable? = null + private var dirty = false private val patternGroup = RepoPattern.group("itempickuplog") private val shopPattern by patternGroup.pattern( @@ -152,7 +153,8 @@ object ItemPickupLog { val itemsRemovedUpdated = itemsRemovedFromInventory.values.removeIf { it.isExpired() } val itemsAddedUpdated = itemsAddedToInventory.values.removeIf { it.isExpired() } - if (itemsRemovedUpdated || itemsAddedUpdated || itemList != oldItemList) { + if (itemsRemovedUpdated || itemsAddedUpdated || itemList != oldItemList || dirty) { + dirty = false updateDisplay() } } @@ -174,6 +176,7 @@ object ItemPickupLog { } targetInventory[hash] = itemInfo + dirty = true } private fun renderList(prefix: String, entry: PickupEntry) = Renderable.horizontalContainer( -- cgit