AppleSkin

AppleSkin

241M Downloads

[compatability] not displayed in Roughly Enough Items

milkev opened this issue ยท 10 comments

commented

when using REI, the food values are not shown, and are only shown once in your inventory.

using the latest fabric version of REI and appleskin.

commented

From taking a quick look at the REI source, it looks like it only ever calls the matrices, lines, mouseX, mouseY overload of renderTooltip, whereas AppleSkin needs the one with ItemStack to be called in order to cache the ItemStack for context when rendering the tooltip

So, will need some other way to get the ItemStack that is being hovered in the REI screen for use in renderTooltip.

EDIT: Possibly FocusedStackProvider ? Or maybe just some code like this

commented

Does #98 not fix this?

commented

Does #98 not fix this?

not fix it, REI will fetch base tooltip from ItemStack.getTooltip, and the rendering with custom render api.

commented

Looked into this a bit and found something that should work but the rendering is still broken for some reason:

https://github.com/squeek502/AppleSkin/tree/1.16-fabric-rei (32206f0)

Moving the tooltip mixin from Screen.getTooltipFromItem (which just calls ItemStack.getTooltip internally) to ItemStack.getTooltip itself makes it so AppleSkin can add its tooltips to the list in REI, since REI calls ItemStack.getTooltip directly. However, for some reason, the icons don't render, even though when stepping through the code, all the AppleSkin rendering code gets called and the x & y coordinates seem to make sense. Not sure why that is happening.

commented

Before REI 5.9.0 using custom render
After REF 5.9.0 using screen.renderTooltip

You can try REF a version after 5.9.0

commented

I was testing with REI 5.12.248 using:

modImplementation "me.shedaniel:RoughlyEnoughItems:5.12.248"
commented

image

well, that's because zlevel is to large

commented
diff --git a/java/squeek/appleskin/client/TooltipOverlayHandler.java b/java/squeek/appleskin/client/TooltipOverlayHandler.java
index 74897c3..ce5f35b 100644
--- a/java/squeek/appleskin/client/TooltipOverlayHandler.java
+++ b/java/squeek/appleskin/client/TooltipOverlayHandler.java
@@ -287,9 +287,6 @@ public class TooltipOverlayHandler
                RenderSystem.enableBlend();
                RenderSystem.defaultBlendFunc();
 
-               matrixStack.push();
-               matrixStack.translate(0.0D, 0.0D, 500D); // zLevel must higher than of the background.
-
                // Render from right to left so that the icons 'face' the right way
                x += (foodOverlay.hungerBars - 1) * 9;
 
@@ -368,8 +365,6 @@ public class TooltipOverlayHandler
                        matrixStack.pop();
                }
 
-               matrixStack.pop();
-
                RenderSystem.disableBlend();
                RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
commented

Nice, thanks for finding the fix @SAGESSE-CN!

Should be fixed as of b2ed069

commented

@squeek502 I tried ported to REI, but FocuseStackProvider does not seem to customize of the rendering.