Skip to content

feat(pause): PolyPlus pause menu and player panel on the vanilla one - #227

Open
Tektonikal wants to merge 2 commits into
mainfrom
feat/pause-menu
Open

Tektonikal wants to merge 2 commits into
mainfrom
feat/pause-menu

Conversation

@Tektonikal

Copy link
Copy Markdown
Contributor

No description provided.

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.
Comment on lines +105 to +109
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 [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.

Comment on lines +103 to +107
is AbstractButton -> PauseButton(
widget.x, widget.y, widget.width, widget.height,
widget.message.string, widget.isActive,
(widget as? SpriteIconButton)?.let { spriteIcon(it) },
) { press(widget) }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 [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.

Comment on lines +157 to +160
fun requestStats(screen: Screen) {
if (statsRequested.put(screen, Unit) != null) return
//? if > 1.8.9 {
Minecraft.getInstance().connection?.send(ServerboundClientCommandPacket(ServerboundClientCommandPacket.Action.REQUEST_STATS))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 [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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status
Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants