From 7b6fef2966838dffcdecb5870204d363811f4b4f Mon Sep 17 00:00:00 2001 From: inglettronald Date: Sat, 28 Jan 2023 15:30:58 -0600 Subject: More tooltip rendering logic and adding vanquisher trigger --- src/main/kotlin/dulkirmod/features/DungeonLeap.kt | 2 +- src/main/kotlin/dulkirmod/features/ScalableTooltips.kt | 2 ++ .../kotlin/dulkirmod/features/chat/VanquisherTrigger.kt | 13 +++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/main/kotlin/dulkirmod/features/chat/VanquisherTrigger.kt (limited to 'src/main/kotlin/dulkirmod/features') diff --git a/src/main/kotlin/dulkirmod/features/DungeonLeap.kt b/src/main/kotlin/dulkirmod/features/DungeonLeap.kt index 901c839..d1be829 100644 --- a/src/main/kotlin/dulkirmod/features/DungeonLeap.kt +++ b/src/main/kotlin/dulkirmod/features/DungeonLeap.kt @@ -19,7 +19,7 @@ class DungeonLeap { val lastInLeap = inLeapMenuBool if (!Config.highlightLeap) return - if (mc.currentScreen == null || !(mc.currentScreen is GuiChest)) { + if (mc.currentScreen == null || mc.currentScreen !is GuiChest) { inLeapMenuBool = false return } diff --git a/src/main/kotlin/dulkirmod/features/ScalableTooltips.kt b/src/main/kotlin/dulkirmod/features/ScalableTooltips.kt index a3ce2f1..e471849 100644 --- a/src/main/kotlin/dulkirmod/features/ScalableTooltips.kt +++ b/src/main/kotlin/dulkirmod/features/ScalableTooltips.kt @@ -5,6 +5,7 @@ import net.minecraft.client.Minecraft import net.minecraft.client.gui.FontRenderer import net.minecraft.client.renderer.GlStateManager import net.minecraft.client.renderer.RenderHelper +import net.minecraft.item.ItemStack import net.minecraftforge.fml.client.config.GuiUtils import org.lwjgl.input.Keyboard import org.lwjgl.input.Mouse @@ -15,6 +16,7 @@ object ScalableTooltips { // Checks to see if large tooltips should be snapped (for larger than can fit on screen code) var snapFlag: Boolean = true var scaleScale: Float = 0f + var previousStack: ItemStack? = null fun drawScaledHoveringText( textLines: List, diff --git a/src/main/kotlin/dulkirmod/features/chat/VanquisherTrigger.kt b/src/main/kotlin/dulkirmod/features/chat/VanquisherTrigger.kt new file mode 100644 index 0000000..c7d4349 --- /dev/null +++ b/src/main/kotlin/dulkirmod/features/chat/VanquisherTrigger.kt @@ -0,0 +1,13 @@ +package dulkirmod.features.chat + +import dulkirmod.DulkirMod +import dulkirmod.config.Config + +object VanquisherTrigger { + fun handle(message: String) { + if (!Config.vanqBroadcast) return + if (message == "A Vanquisher is spawning nearby!") { + DulkirMod.mc.thePlayer.sendChatMessage("/patcher sendcoords") + } + } +} \ No newline at end of file -- cgit