Repository navigation
feat(pause): PolyPlus pause menu and player panel on the vanilla one - #227
Tektonikal wants to merge 2 commits into
Conversation
Adds an optional Compose pause menu mirroring vanilla's widgets, and a player panel beside the vanilla menu: player preview, Social, Wardrobe and Host World on the right, Settings and playtime on the left, with pixel icons on the vanilla buttons.
c8f919d to
643bec7
Compare
| val width = minOf(WIDTH, room - MIN_EDGE_MARGIN) | ||
| if (width < MIN_WIDTH) return null | ||
| val x = screenWidth - width - (room - width).coerceAtMost(EDGE_MARGIN) | ||
| val leftRoom = menuLeft - MENU_GAP | ||
| val leftX = if (leftRoom - width >= MIN_EDGE_MARGIN) (leftRoom - width).coerceAtMost(EDGE_MARGIN) else null |
There was a problem hiding this comment.
🟡 [P2] Size the panel columns against the space on both sides
At the default 854×480 window size, the GUI width is 427: the centered menu leaves room for a 97-pixel left column and a 98-pixel right column. Taking width exclusively from the right makes leftX null, hiding Settings and Playtime despite sufficient space. This reproduces in both pause-menu variants. Bound the shared width against both sides, or size the left column independently.
| is AbstractButton -> PauseButton( | ||
| widget.x, widget.y, widget.width, widget.height, | ||
| widget.message.string, widget.isActive, | ||
| (widget as? SpriteIconButton)?.let { spriteIcon(it) }, | ||
| ) { press(widget) } |
There was a problem hiding this comment.
🟡 [P2] Preserve tooltips when mirroring pause-menu buttons
With the custom pause menu enabled on 26.3, the icon-only buttons lose their hover labels because the vanilla tooltip is discarded and PausePill renders only the image. This also removes explanations such as why player reporting is disabled. contentDescription does not provide an on-screen tooltip. Carry the original tooltip into the mirrored button and display it on hover.
| fun requestStats(screen: Screen) { | ||
| if (statsRequested.put(screen, Unit) != null) return | ||
| //? if > 1.8.9 { | ||
| Minecraft.getInstance().connection?.send(ServerboundClientCommandPacket(ServerboundClientCommandPacket.Action.REQUEST_STATS)) |
There was a problem hiding this comment.
🟡 [P2] Request fresh statistics while displaying advancing playtime
On multiplayer or an unpaused LAN world, playtime continues advancing while this menu is open, but the vanilla server sends updated statistics only when requested. This guard permits just one request per screen, so both one-second label refreshes repeatedly read the same cached value and the displayed time freezes. Request updated statistics at a bounded interval while the counter is visible instead of only refreshing its text.
No description provided.