diff options
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java | 13 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt | 20 |
2 files changed, 30 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java index e04404ed8..a1741affb 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java @@ -112,6 +112,19 @@ public class MiscConfig { public boolean crimsonIsleReputationHelper = true; @Expose + @ConfigOption(name = "Use Hotkey", desc = "Only show the reputation helper while pressing the hotkey.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 6) + public boolean reputationHelperUseHotkey = false; + + @Expose + @ConfigOption(name = "Hotkey", desc = "Press this hotkey to show the reputation helper.") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) + @ConfigAccordionId(id = 6) + public int reputationHelperHotkey = Keyboard.KEY_NONE; + + + @Expose public Position crimsonIsleReputationHelperPos = new Position(10, 10, false, true); @Expose 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() { |