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: Excavator Tooltip Hider #2539

Merged
merged 2 commits into from
Sep 21, 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 @@ -36,4 +36,12 @@ public class FossilExcavatorConfig {
@FeatureToggle
public boolean glacitePowderStack = false;

@Expose
@ConfigOption(
name = "Hide Excavator Tooltips",
desc = "Hides tooltips of items inside of the Fossil Excavator."
)
@ConfigEditorBoolean
@FeatureToggle
public boolean hideExcavatorTooltips = true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,6 @@ object HarpFeatures {
if (!config.hideMelodyTooltip) return
if (!isHarpGui(InventoryUtils.openInventoryName())) return
if (event.slot.inventory !is ContainerLocalMenu) return
event.cancel()
event.cancel()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package at.hannibal2.skyhanni.features.mining.fossilexcavator

import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.LorenzToolTipEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import net.minecraft.client.player.inventory.ContainerLocalMenu
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent

@SkyHanniModule
object ExcavatorTooltipHider {

private val config get() = SkyHanniMod.feature.mining.fossilExcavator

@SubscribeEvent
fun onTooltip(event: LorenzToolTipEvent) {
if (!isEnabled()) return
if (event.slot.inventory !is ContainerLocalMenu) return
event.cancel()
}

fun isEnabled() = FossilExcavatorAPI.inInventory && !FossilExcavatorAPI.inExcavatorMenu && config.hideExcavatorTooltips
}
Loading