diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-06-15 14:14:13 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-06-15 14:14:13 +0200 |
commit | 57246cc1053215bd4a4e66857eeefc9c83b399f4 (patch) | |
tree | 97679c99b2ce47ad489a282abca8292a658df828 /src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt | |
parent | 6b3e7ef0c4b56c36f62b48a4b93ae3186623e4cb (diff) | |
download | skyhanni-57246cc1053215bd4a4e66857eeefc9c83b399f4.tar.gz skyhanni-57246cc1053215bd4a4e66857eeefc9c83b399f4.tar.bz2 skyhanni-57246cc1053215bd4a4e66857eeefc9c83b399f4.zip |
Added cells alignment ability cooldown
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt b/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt index 7937ab2ae..943e4f50d 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt @@ -29,24 +29,23 @@ class ItemTipHelper { // if (lastColorCacheTime.getOrDefault(uuid, 0L) + 1000 > System.currentTimeMillis()) { // stackTip = cache[uuid]!! // } else { - val itemTipEvent = RenderItemTipEvent(stack) + val itemTipEvent = RenderItemTipEvent(stack, mutableListOf()) itemTipEvent.postAndCatch() - stackTip = itemTipEvent.stackTip -// cache[uuid] = stackTip -// lastColorCacheTime[uuid] = System.currentTimeMillis() -// } - if (stackTip.isEmpty()) return + if (itemTipEvent.renderObjects.isEmpty()) return GlStateManager.disableLighting() GlStateManager.disableDepth() GlStateManager.disableBlend() - val fontRenderer = event.fontRenderer - val x = event.x + 17 - fontRenderer.getStringWidth(stackTip) - val y = event.y + 9 + for (renderObject in itemTipEvent.renderObjects) { + val fontRenderer = event.fontRenderer + val text = renderObject.text + val x = event.x + 17 - fontRenderer.getStringWidth(text) + renderObject.offsetX + val y = event.y + 9 + renderObject.offsetY + fontRenderer.drawStringWithShadow(text, x.toFloat(), y.toFloat(), 16777215) + } - fontRenderer.drawStringWithShadow(stackTip, x.toFloat(), y.toFloat(), 16777215) GlStateManager.enableLighting() GlStateManager.enableDepth() } |