aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/misc
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2023-09-08 19:55:39 +1000
committerGitHub <noreply@github.com>2023-09-08 11:55:39 +0200
commit1447426be65a3ce29cef36395cd47603c9539e00 (patch)
tree482fddcc336a9b09b5e8fad0eb46de723f56f26b /src/main/java/at/hannibal2/skyhanni/features/misc
parent62ebd2a830490ab921c94819e1d24ff4494f00ec (diff)
downloadskyhanni-1447426be65a3ce29cef36395cd47603c9539e00.tar.gz
skyhanni-1447426be65a3ce29cef36395cd47603c9539e00.tar.bz2
skyhanni-1447426be65a3ce29cef36395cd47603c9539e00.zip
Feature: Contest rank Icon (#450)
Contest rank Icon #450
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/PetCandyUsedDisplay.kt25
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt22
2 files changed, 7 insertions, 40 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PetCandyUsedDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PetCandyUsedDisplay.kt
index 5cfcd881d..ea3246ac5 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/PetCandyUsedDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PetCandyUsedDisplay.kt
@@ -3,8 +3,8 @@ package at.hannibal2.skyhanni.features.misc
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.GuiRenderItemEvent
import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.RenderUtils
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPetCandyUsed
-import net.minecraft.client.renderer.GlStateManager
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class PetCandyUsedDisplay {
@@ -20,26 +20,9 @@ class PetCandyUsedDisplay {
if (petCandyUsed == 0) return
val stackTip = "§c$petCandyUsed"
-
- GlStateManager.disableLighting()
- GlStateManager.disableDepth()
- GlStateManager.disableBlend()
-
- val fontRenderer = event.fontRenderer
- val x = event.x + 13 - fontRenderer.getStringWidth(stackTip)
+ val x = event.x + 13
val y = event.y + 1
- val scale = 0.9
- GlStateManager.pushMatrix()
- GlStateManager.translate(x.toFloat(), y.toFloat(), 0f)
- GlStateManager.scale(scale, scale, scale)
- fontRenderer.drawStringWithShadow(stackTip, 0f, 0f, 16777215)
- val reverseScale = 1 / 0.7
- GlStateManager.scale(reverseScale, reverseScale, reverseScale)
- GlStateManager.popMatrix()
-
- GlStateManager.enableLighting()
- GlStateManager.enableDepth()
+ RenderUtils.drawSlotText(x, y, stackTip, .9f)
}
-
-}
+} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt
index 0ed156362..a1c780199 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt
@@ -5,8 +5,8 @@ import at.hannibal2.skyhanni.events.GuiRenderItemEvent
import at.hannibal2.skyhanni.events.LorenzToolTipEvent
import at.hannibal2.skyhanni.utils.ItemUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.RenderUtils
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getAppliedPocketSackInASack
-import net.minecraft.client.renderer.GlStateManager
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class PocketSackInASackDisplay {
@@ -22,26 +22,10 @@ class PocketSackInASackDisplay {
val pocketSackInASackApplied = stack.getAppliedPocketSackInASack() ?: return
val stackTip = "§a$pocketSackInASackApplied"
-
- GlStateManager.disableLighting()
- GlStateManager.disableDepth()
- GlStateManager.disableBlend()
-
- val fontRenderer = event.fontRenderer
- val x = event.x + 13 - fontRenderer.getStringWidth(stackTip)
+ val x = event.x + 13
val y = event.y + 1
- val scale = 0.9
- GlStateManager.pushMatrix()
- GlStateManager.translate(x.toFloat(), y.toFloat(), 0f)
- GlStateManager.scale(scale, scale, scale)
- fontRenderer.drawStringWithShadow(stackTip, 0f, 0f, 16777215)
- val reverseScale = 1 / 0.7
- GlStateManager.scale(reverseScale, reverseScale, reverseScale)
- GlStateManager.popMatrix()
-
- GlStateManager.enableLighting()
- GlStateManager.enableDepth()
+ RenderUtils.drawSlotText(x, y, stackTip, .9f)
}
@SubscribeEvent