Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Toggle for limbo in detailed /playtime #1863

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,14 @@ public class MiscConfig {
@ConfigLink(owner = MiscConfig.class, field = "showTimeInLimbo")
public Position showTimeInLimboPosition = new Position(400, 200, 1.3f);

@Expose
@ConfigOption(
name = "Limbo Playtime Detailed",
desc = "Show your total time in limbo in the detailed /playtime.")
@ConfigEditorBoolean
@FeatureToggle
public boolean showLimboTimeInPlaytimeDetailed = true;

@Expose
@ConfigOption(
name = "Lesser Orb of Healing Hider",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package at.hannibal2.skyhanni.features.misc.limbo

import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.ProfileStorageData
import at.hannibal2.skyhanni.events.InventoryOpenEvent
import at.hannibal2.skyhanni.events.LorenzToolTipEvent
Expand Down Expand Up @@ -35,6 +36,7 @@ class LimboPlaytime {
private var hoursString: String = ""

private val storage get() = ProfileStorageData.playerSpecific?.limbo
private val enabled get() = SkyHanniMod.feature.misc.showLimboTimeInPlaytimeDetailed

private val itemID = "ENDER_PEARL".asInternalName()
private val itemName = "§aLimbo"
Expand All @@ -43,6 +45,7 @@ class LimboPlaytime {

@SubscribeEvent
fun replaceItem(event: ReplaceItemEvent) {
if (!enabled) return
if (event.inventory !is ContainerLocalMenu) return
if (event.inventory.name != "Detailed /playtime") return
if (event.slotNumber != 43) return
Expand Down Expand Up @@ -74,6 +77,7 @@ class LimboPlaytime {
@SubscribeEvent
fun onTooltip(event: LorenzToolTipEvent) {
if (!LorenzUtils.inSkyBlock) return
if (!enabled) return
if (!event.slot.inventory.name.startsWith("Detailed /playtime")) return
if (event.slot.slotIndex != 4) return
val playtime = storage?.playtime ?: 0
Expand Down
Loading