diff options
author | inglettronald <inglettronald@gmail.com> | 2023-01-30 13:15:34 -0600 |
---|---|---|
committer | inglettronald <inglettronald@gmail.com> | 2023-01-30 13:15:34 -0600 |
commit | 3c820cd5c1933d1d6a131203be5766b543613d5d (patch) | |
tree | f23aca35d8377f3395214e83677f0f3f2d21ebec | |
parent | d87f25e4b82bd7bd2c15943c23c685cafefad20f (diff) | |
download | DulkirMod-3c820cd5c1933d1d6a131203be5766b543613d5d.tar.gz DulkirMod-3c820cd5c1933d1d6a131203be5766b543613d5d.tar.bz2 DulkirMod-3c820cd5c1933d1d6a131203be5766b543613d5d.zip |
versioning, remove print statement, and fix some scrolling func
-rw-r--r-- | build.gradle.kts | 2 | ||||
-rw-r--r-- | src/main/kotlin/dulkirmod/DulkirMod.kt | 2 | ||||
-rw-r--r-- | src/main/kotlin/dulkirmod/features/ScalableTooltips.kt | 47 | ||||
-rw-r--r-- | src/main/resources/mcmod.info | 2 |
4 files changed, 28 insertions, 25 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index 0330507..be3788e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ plugins { } group = "com.example.archloomtemplate" -version = "1.1.4" +version = "1.1.5" // Toolchains: java { diff --git a/src/main/kotlin/dulkirmod/DulkirMod.kt b/src/main/kotlin/dulkirmod/DulkirMod.kt index 7022105..ab11e9e 100644 --- a/src/main/kotlin/dulkirmod/DulkirMod.kt +++ b/src/main/kotlin/dulkirmod/DulkirMod.kt @@ -121,7 +121,7 @@ class DulkirMod { companion object { const val MOD_ID = "dulkirmod" const val MOD_NAME = "Dulkir Mod" - const val MOD_VERSION = "1.1.4" + const val MOD_VERSION = "1.1.5" const val CHAT_PREFIX = "§f<§3DulkirMod§f>" val mc: Minecraft = Minecraft.getMinecraft() diff --git a/src/main/kotlin/dulkirmod/features/ScalableTooltips.kt b/src/main/kotlin/dulkirmod/features/ScalableTooltips.kt index e471849..7d1d623 100644 --- a/src/main/kotlin/dulkirmod/features/ScalableTooltips.kt +++ b/src/main/kotlin/dulkirmod/features/ScalableTooltips.kt @@ -1,8 +1,10 @@ package dulkirmod.features +import dulkirmod.DulkirMod.Companion.mc import dulkirmod.config.Config import net.minecraft.client.Minecraft import net.minecraft.client.gui.FontRenderer +import net.minecraft.client.gui.GuiChat import net.minecraft.client.renderer.GlStateManager import net.minecraft.client.renderer.RenderHelper import net.minecraft.item.ItemStack @@ -30,30 +32,31 @@ object ScalableTooltips { if(textLines.isEmpty()) return true // Calculate the amount of translation that should be applied based on how much the user has scrolled + // Only allows the user to scroll if you are NOT inside a chat GUI. val eventDWheel = Mouse.getDWheel() - if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - if (eventDWheel < 0) { - scrollX += Minecraft.getMinecraft().displayWidth/192 - } else if (eventDWheel > 0) { - //Scrolling to access higher stuff - scrollX -= Minecraft.getMinecraft().displayWidth/192 + if (mc.currentScreen !is GuiChat) { + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + if (eventDWheel < 0) { + scrollX += Minecraft.getMinecraft().displayWidth / 192 + } else if (eventDWheel > 0) { + scrollX -= Minecraft.getMinecraft().displayWidth / 192 + } + } else if (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)) { + if (eventDWheel < 0) { + scaleScale -= .1f + } else if (eventDWheel > 0) { + scaleScale += .1f + } + } else { + if (eventDWheel < 0) { + scrollY -= Minecraft.getMinecraft().displayHeight / 108 + } else if (eventDWheel > 0) { + scrollY += Minecraft.getMinecraft().displayHeight / 108 + } } - } else if (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)) { - if (eventDWheel < 0) { - scaleScale -= .1f - } else if (eventDWheel > 0) { - scaleScale += .1f + if (Mouse.isButtonDown(2)) { + scaleScale = 0f } - } else { - if (eventDWheel < 0) { - scrollY -= Minecraft.getMinecraft().displayHeight/108 - } else if (eventDWheel > 0) { - //Scrolling to access higher stuff - scrollY += Minecraft.getMinecraft().displayHeight/108 - } - } - if (Mouse.isButtonDown(2)) { - scaleScale = 0f } val scale = (Config.tooltipSize + scaleScale).coerceAtLeast(0f) @@ -115,7 +118,7 @@ object ScalableTooltips { snapFlag = false } - //updates the position of x and y if it has been modified. + // updates the position of x and y if it has been modified. x = ((mouseX + 12 + scrollX) / scale).toInt() y = ((mouseY - 12 + scrollY) / scale).toInt() diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 50c00dd..c9e7bf6 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "dulkirmod", "name": "Dulkir Mod", "description": "The worst skyblock mod.", - "version": "1.1.4", + "version": "1.1.5", "mcversion": "1.8.9", "authorList": [ "Dulkir" |