pack: v0.38.1 — bnstoolkit 0.5.1 UI coords hotfix #77

Merged
Matt merged 1 commits from hotfix/bnstoolkit-ui-coords into main 2026-06-08 14:43:10 +00:00
Owner

Summary

Visual bug: every screen's widgets rendered far off to the right of the panel instead of inside it. Root cause: I assumed Widget.setPos(x, y) in FTB Library takes absolute screen coords, but it takes coords relative to the parent panel. Net effect: every offset got applied twice (panel-pos + offset where the renderer also adds panel-pos again).

Fix: drop the getX()+ / getY()+ from every setPos call in alignWidgets(). Now using plain relative offsets.

Covers all 6 screens (Hub, TierUpgrade, Shop, Bounty, Plot, QuestLog) plus the contentTop()/contentBottom() helpers on BaseBnsScreen.

🤖 Generated with Claude Code

## Summary Visual bug: every screen's widgets rendered far off to the right of the panel instead of inside it. Root cause: I assumed `Widget.setPos(x, y)` in FTB Library takes absolute screen coords, but it takes coords relative to the parent panel. Net effect: every offset got applied twice (panel-pos + offset where the renderer also adds panel-pos again). Fix: drop the `getX()+` / `getY()+` from every `setPos` call in `alignWidgets()`. Now using plain relative offsets. Covers all 6 screens (Hub, TierUpgrade, Shop, Bounty, Plot, QuestLog) plus the `contentTop()`/`contentBottom()` helpers on BaseBnsScreen. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Matt added 1 commit 2026-06-08 14:43:10 +00:00
Every screen positioned its child widgets with setPos(getX() + offset,
getY() + offset) under the assumption that FTB Library uses absolute
screen coordinates. It uses PARENT-RELATIVE coordinates — the panel's
own position is added back at render time — so all widgets rendered
at panel-position * 2 + offset, shoving them off the right edge.

Fix: drop the getX()/getY() from every setPos. Now using plain
parent-relative offsets, which is what FTB Library docs + FTB Quests/
Chunks source actually do.

Affects: HubScreen, TierUpgradeScreen, BountyBoardScreen,
PlotPurchaseScreen, ShopBrowserScreen, QuestLogScreen.
Also fixed BaseBnsScreen.contentTop()/contentBottom() to return
relative offsets.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Matt merged commit ec8f2b83cf into main 2026-06-08 14:43:10 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: minecraft/brass-and-sigil#77