diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-03 17:07:30 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-03 17:07:30 +0200 |
commit | 55aee2c8793c03cf3ba8539535c83897d694ee60 (patch) | |
tree | b0d85e2bf7bf7a83bb9baf067ec1c8337b207d95 /src/main/java/at/hannibal2/skyhanni/features | |
parent | 4aa469feee9592c6c7ded467216c77f5839e7f2e (diff) | |
download | skyhanni-55aee2c8793c03cf3ba8539535c83897d694ee60.tar.gz skyhanni-55aee2c8793c03cf3ba8539535c83897d694ee60.tar.bz2 skyhanni-55aee2c8793c03cf3ba8539535c83897d694ee60.zip |
Added option to only show the reputation helper while pressing a hotkey.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt index 012570add..2efc657bf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt @@ -18,8 +18,10 @@ import at.hannibal2.skyhanni.utils.TabListData import com.google.gson.JsonObject import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import org.lwjgl.input.Keyboard class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { + val config get() = SkyHanniMod.feature.misc val questHelper = DailyQuestHelper(this) val miniBossHelper = DailyMiniBossHelper(this) @@ -62,7 +64,10 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { fun onTick(event: LorenzTickEvent) { if (!LorenzUtils.inSkyBlock) return if (LorenzUtils.skyBlockIsland != IslandType.CRIMSON_ISLE) return - if (!SkyHanniMod.feature.misc.crimsonIsleReputationHelper) return + if (!config.crimsonIsleReputationHelper) return + if (!dirty && display.isEmpty()) { + dirty = true + } if (dirty) { dirty = false updateRender() @@ -101,12 +106,21 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { @SubscribeEvent(priority = EventPriority.LOWEST) fun renderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { - if (!SkyHanniMod.feature.misc.crimsonIsleReputationHelper) return + if (!config.crimsonIsleReputationHelper) return if (!LorenzUtils.inSkyBlock) return if (LorenzUtils.skyBlockIsland != IslandType.CRIMSON_ISLE) return - SkyHanniMod.feature.misc.crimsonIsleReputationHelperPos.renderStringsAndItems(display, posLabel = "Crimson Isle Reputation Helper") + if (config.reputationHelperUseHotkey) { + if (!Keyboard.isKeyDown(config.reputationHelperHotkey)) { + return + } + } + + config.crimsonIsleReputationHelperPos.renderStringsAndItems( + display, + posLabel = "Crimson Isle Reputation Helper" + ) } fun update() { |