aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-14 14:07:56 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-14 14:07:56 +0200
commit5f220707f4b0a12addaef0ec80cc389f07d9ffcc (patch)
treeb81533637c810c25bd5ccff54b9bc88dd967aec7 /src/main/java/at/hannibal2/skyhanni/features
parentd1a9b5b3ea2a4a140fc1aa34db3ad8a79822391c (diff)
downloadskyhanni-5f220707f4b0a12addaef0ec80cc389f07d9ffcc.tar.gz
skyhanni-5f220707f4b0a12addaef0ec80cc389f07d9ffcc.tar.bz2
skyhanni-5f220707f4b0a12addaef0ec80cc389f07d9ffcc.zip
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/InGameDateDisplay.kt20
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt4
2 files changed, 9 insertions, 15 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/InGameDateDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/InGameDateDisplay.kt
index 8c33566d8..24ccef545 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/InGameDateDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/InGameDateDisplay.kt
@@ -1,42 +1,36 @@
package at.hannibal2.skyhanni.features.misc
import at.hannibal2.skyhanni.SkyHanniMod
-import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.LorenzUtils.getFormattedSkyblockTime
+import at.hannibal2.skyhanni.utils.LorenzUtils.formatted
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
-import at.hannibal2.skyhanni.features.misc.discordrpc.DiscordStatus
import io.github.moulberry.notenoughupdates.util.SkyBlockTime
-import net.minecraftforge.fml.common.eventhandler.EventPriority
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
-import kotlin.concurrent.fixedRateTimer
class InGameDateDisplay {
- private val config get() = SkyHanniMod.feature.gui
+ private val config get() = SkyHanniMod.feature.gui.inGameDateConfig
private var display = ""
@SubscribeEvent
fun onTick(event: LorenzTickEvent) {
if (!isEnabled()) return
- if (!event.repeatSeconds(config.inGameDateDisplayRefreshSeconds)) return
+ if (!event.repeatSeconds(config.RefreshSeconds)) return
checkDate()
}
private fun checkDate() {
- if (!isEnabled()) return
-
- display = SkyBlockTime.now().getFormattedSkyblockTime()
+ display = SkyBlockTime.now().formatted()
}
@SubscribeEvent
- fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) {
+ fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) {
if (!isEnabled()) return
- config.inGameDateDisplayPosition.renderString(display, posLabel = "In-game Date Display")
+ config.position.renderString(display, posLabel = "In-game Date Display")
}
- fun isEnabled() = LorenzUtils.inSkyBlock && config.inGameDateDisplay
+ fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt
index fed77fd39..d459200e0 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt
@@ -18,7 +18,7 @@ import at.hannibal2.skyhanni.features.rift.RiftAPI
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.colorCodeToRarity
-import at.hannibal2.skyhanni.utils.LorenzUtils.getFormattedSkyblockTime
+import at.hannibal2.skyhanni.utils.LorenzUtils.formatted
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.StringUtils.firstLetterUppercase
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
@@ -180,7 +180,7 @@ enum class DiscordStatus(private val displayMessageSupplier: Supplier<String>?)
}),
TIME({
- SkyBlockTime.now().getFormattedSkyblockTime()
+ SkyBlockTime.now().formatted()
}),
PROFILE({