diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt index 72bffdc46..388ea8a08 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -70,17 +70,26 @@ object NEUItems { fun isVanillaItem(item: ItemStack) = manager.auctionManager.isVanillaItem(item.getInternalName()) - fun ItemStack.renderOnScreen(x: Float, y: Float) { + fun ItemStack.renderOnScreen(x: Float, y: Float, scaleMultiplier: Double = 1.0) { GlStateManager.pushMatrix() val isSkull = item === Items.skull + + val baseScale = (if (isSkull) 0.8f else 0.6f) + val finalScale = baseScale * scaleMultiplier + val diff = ((finalScale - baseScale) * 10).toFloat() + + val translateX: Float + val translateY: Float if (isSkull) { - GlStateManager.translate(x - 2, y - 2, 0f) + translateX = x - 2 - diff + translateY = y - 2 - diff } else { - GlStateManager.translate(x, y, 0f) + translateX = x - diff + translateY = y - diff } - val scale = if (isSkull) 0.8f else 0.6f - GlStateManager.scale(scale, scale, 0f) + GlStateManager.translate(translateX, translateY, 0f) + GlStateManager.scale(finalScale, finalScale, 0.0) drawItemStack(this) GlStateManager.popMatrix() } |