From 7fe3bd2bafad3b50e425020774c538dbb9e13fc1 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 1 Dec 2023 10:46:15 +0100 Subject: Hide hidden bingo tips in display. Show the duration until the next hidden personal goal gets a tip revealed. --- .../features/event/bingo/BingoCardConfig.java | 5 ++ .../skyhanni/features/bingo/BingoCardDisplay.kt | 66 +++++++++++++++++++++- .../skyhanni/features/bingo/BingoNextStepHelper.kt | 8 ++- 3 files changed, 75 insertions(+), 4 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/bingo/BingoCardConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/bingo/BingoCardConfig.java index 44dd23ec4..2bc7e1f8f 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/bingo/BingoCardConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/bingo/BingoCardConfig.java @@ -42,4 +42,9 @@ public class BingoCardConfig { @Expose public Position bingoCardPos = new Position(10, 10, false, true); + + @Expose + @ConfigOption(name = "Next Tip Duration", desc = "Show the duration until the next hidden personal goal gets a tip revealed.") + @ConfigEditorBoolean + public Property nextTipDuration = Property.of(true); } diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt index ee1fc5874..268f12fb8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt @@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.features.bingo.card.CommunityGoal import at.hannibal2.skyhanni.features.bingo.card.PersonalGoal import at.hannibal2.skyhanni.utils.InventoryUtils @@ -15,11 +16,15 @@ import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.onToggle import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings +import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor +import at.hannibal2.skyhanni.utils.TimeUtils +import at.hannibal2.skyhanni.utils.TimeUtils.format import net.minecraft.client.Minecraft import net.minecraft.client.gui.GuiChat import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import kotlin.time.Duration.Companion.days class BingoCardDisplay { @@ -28,6 +33,9 @@ class BingoCardDisplay { // TODO USE SH-REPO private val goalCompletePattern = "§6§lBINGO GOAL COMPLETE! §r§e(?.*)".toPattern() + private var lastBingoCardOpenTime = SimpleTimeMark.farPast() + private var hasHiddenPersonalGoals = false + init { update() } @@ -36,6 +44,9 @@ class BingoCardDisplay { private const val MAX_PERSONAL_GOALS = 20 private const val MAX_COMMUNITY_GOALS = 5 + val personalHiddenGoalPattern = ("§7This goal is currently §7§chidden§7! " + + "It will be revealed §7to you when you complete it. §7 §7§eThe next hint will unlock in (?