Restore GuiGraphicsExtended.drawSlotText#227
Conversation
…Text helper Agent-Logs-Url: https://github.com/CyclopsMC/CyclopsCore/sessions/7fd776ee-54e8-4a46-a5a2-0f5fb1e6e6ba Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
| this.guiGraphics = guiGraphics; | ||
| } | ||
|
|
||
| private void renderText(Font font, String text, int x, int y) { |
There was a problem hiding this comment.
This private method is not necessary. The implementation can just be moved to the other new methods.
There was a problem hiding this comment.
Done in b946c5c — removed the renderText helper and inlined the implementation directly in itemCount and drawSlotText.
|
|
||
| private void renderText(Font font, String text, int x, int y) { | ||
| float scale = 0.5f; | ||
| guiGraphics.pose().pushMatrix(); |
There was a problem hiding this comment.
Make sure the code comments from before are kept.
There was a problem hiding this comment.
Restored in b946c5c — the original // This part was added and // Scale was added here comments are back.
| float scale = 0.5f; | ||
| guiGraphics.pose().pushMatrix(); | ||
| guiGraphics.pose().scale(scale, scale); | ||
| guiGraphics.text(font, text, (int) ((x + 17) / scale - font.width(text)), (int) ((y + 12) / scale), -1, true); |
There was a problem hiding this comment.
This line should be exactly the same as the old line 28.
There was a problem hiding this comment.
Fixed in b946c5c — itemCount now uses (x + 19 - 2) and (y + 6 + 6) exactly as before.
…ressions, inline drawSlotText Agent-Logs-Url: https://github.com/CyclopsMC/CyclopsCore/sessions/204a904e-0e70-43fd-9f50-8d753c76640a Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
|



drawSlotText(Font, String, int, int)was dropped in 1.29.0, forcing downstream mods (e.g. IntegratedTerminals#198) to inline equivalent rendering logic as a workaround.Changes
drawSlotText— public method with inlined scaled text rendering (0.5× scale, right-aligned at slot bottom-right), making the downstream workaround unnecessaryOriginal prompt