From 95cb1d7c7be44a6b7f9611e6420ff6b50146a830 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Fri, 15 Mar 2024 23:25:29 +0100 Subject: Backend: Storage Config Moving (#1171) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt | 4 ++-- .../at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/utils') 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 e8045d70a..d6f888bad 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt @@ -1,8 +1,8 @@ package at.hannibal2.skyhanni.utils.tracker import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.config.Storage import at.hannibal2.skyhanni.config.features.misc.TrackerConfig.PriceFromEntry +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.SlayerAPI import at.hannibal2.skyhanni.test.PriceSource import at.hannibal2.skyhanni.utils.ChatUtils @@ -22,7 +22,7 @@ import kotlin.time.Duration.Companion.seconds class SkyHanniItemTracker( name: String, createNewSession: () -> Data, - getStorage: (Storage.ProfileSpecific) -> Data, + getStorage: (ProfileSpecificStorage) -> Data, drawDisplay: (Data) -> List>, ) : SkyHanniTracker(name, createNewSession, getStorage, drawDisplay) { 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 226e00dfa..8f477ae59 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt @@ -1,9 +1,9 @@ package at.hannibal2.skyhanni.utils.tracker import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.config.Storage import at.hannibal2.skyhanni.config.core.config.Position import at.hannibal2.skyhanni.config.features.misc.TrackerConfig.PriceFromEntry +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.TrackerManager import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi.Companion.getBazaarData @@ -24,13 +24,13 @@ import kotlin.time.Duration.Companion.seconds open class SkyHanniTracker( val name: String, private val createNewSession: () -> Data, - private val getStorage: (Storage.ProfileSpecific) -> Data, + private val getStorage: (ProfileSpecificStorage) -> Data, private val drawDisplay: (Data) -> List>, ) { private var inventoryOpen = false private var displayMode: DisplayMode? = null - private val currentSessions = mutableMapOf() + private val currentSessions = mutableMapOf() private var display = emptyList>() private var sessionResetTime = SimpleTimeMark.farPast() private var dirty = false @@ -144,9 +144,9 @@ open class SkyHanniTracker( SharedTracker(it.getTotal(), it.getCurrentSession()) } - private fun Storage.ProfileSpecific.getCurrentSession() = currentSessions.getOrPut(this) { createNewSession() } + private fun ProfileSpecificStorage.getCurrentSession() = currentSessions.getOrPut(this) { createNewSession() } - private fun Storage.ProfileSpecific.getTotal(): Data = getStorage(this) + private fun ProfileSpecificStorage.getTotal(): Data = getStorage(this) private fun reset(displayMode: DisplayMode, message: String) { getSharedTracker()?.let { -- cgit