aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt12
1 files changed, 9 insertions, 3 deletions
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 73bba2b51..fe2553c7f 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt
@@ -23,6 +23,7 @@ class SkyHanniTracker<Data : TrackerData>(
private val currentSessions = mutableMapOf<Storage.ProfileSpecific, Data>()
private var display = emptyList<List<Any>>()
private var sessionResetTime = SimpleTimeMark.farPast()
+ private var dirty = false
fun isInventoryOpen() = inventoryOpen
@@ -52,13 +53,18 @@ class SkyHanniTracker<Data : TrackerData>(
update()
}
+ if (dirty) {
+ display = getSharedTracker()?.let {
+ buildFinalDisplay(drawDisplay(it.get(displayMode)))
+ } ?: emptyList()
+ dirty = false
+ }
+
position.renderStringsAndItems(display, posLabel = name)
}
fun update() {
- display = getSharedTracker()?.let {
- buildFinalDisplay(drawDisplay(it.get(displayMode)))
- } ?: emptyList()
+ dirty = true
}
private fun buildFinalDisplay(rawList: List<List<Any>>) = rawList.toMutableList().also {