From fccea080f5b8eaf561e83dc62b84a3cd5ded5a8f Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 7 Nov 2023 22:54:04 +0100 Subject: Added more Armor Drop Tracker features. Added command /shresetarmordroptracker to reset the full data, added session support and added button to reset the current session. --- src/main/java/at/hannibal2/skyhanni/utils/tracker/DisplayMode.kt | 2 +- src/main/java/at/hannibal2/skyhanni/utils/tracker/SharedTracker.kt | 4 +--- src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt | 5 ++--- src/main/java/at/hannibal2/skyhanni/utils/tracker/TrackerUtils.kt | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/utils/tracker') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/DisplayMode.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/DisplayMode.kt index 6c0e14439..55441953c 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/DisplayMode.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/DisplayMode.kt @@ -2,6 +2,6 @@ package at.hannibal2.skyhanni.utils.tracker enum class DisplayMode(val displayName: String) { TOTAL("Total"), - CURRENT("This Session"), + SESSION("This Session"), ; } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SharedTracker.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SharedTracker.kt index 341600467..9b5ae1d90 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SharedTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SharedTracker.kt @@ -11,8 +11,6 @@ class SharedTracker( fun get(displayMode: DisplayMode) = when (displayMode) { DisplayMode.TOTAL -> total - DisplayMode.CURRENT -> currentSession + DisplayMode.SESSION -> currentSession } - - fun getCurrent() = get(TrackerUtils.currentDisplayMode) } 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 6ff8febc7..e1b4c42ad 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt @@ -26,7 +26,7 @@ class SkyHanniTracker( } fun addSessionResetButton(list: MutableList>) { - if (inventoryOpen && TrackerUtils.currentDisplayMode == DisplayMode.CURRENT) { + if (inventoryOpen && TrackerUtils.currentDisplayMode == DisplayMode.SESSION) { list.addSessionResetButton(name, getSharedTracker()) { update() } @@ -45,8 +45,7 @@ class SkyHanniTracker( } } - // rename - fun currentDisplay() = getSharedTracker()?.getCurrent() + fun currentDisplay() = getSharedTracker()?.get(TrackerUtils.currentDisplayMode) fun resetCommand(args: Array, command: String) { TrackerUtils.resetCommand(name, command, args, getSharedTracker()) { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/TrackerUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/TrackerUtils.kt index cc2dab37f..ec527c9e5 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/TrackerUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/TrackerUtils.kt @@ -30,7 +30,7 @@ object TrackerUtils { "§c$name" ), ) { - data?.get(DisplayMode.CURRENT)?.let { + data?.get(DisplayMode.SESSION)?.let { reset(it) { update() } -- cgit