CG-0MPPL0PSI002GGVB: Migrate Golf to use shared Renderer API#589
Merged
SorraTheOrc merged 4 commits intoMay 31, 2026
Merged
Conversation
added 4 commits
May 29, 2026 00:05
…adapter - Create SushiGoAdapter.ts bridging Sushi Go overlays to shared Renderer helpers - Replace createOverlayButton/createOverlayMenuButton with createActionButton/createSushiGoMenuButton in SushiGoOverlayManager - Update browser tests to verify Container-based button structure - No visual regressions; all 2821 tests pass
…r API - Create BeleagueredCastleAdapter.ts with re-exported shared helpers and createBcHudText factory for BC-specific HUD text styling. - Update BeleagueredCastleRenderer.createHUD() to use createHudText and createActionButton instead of direct Phaser API calls. - Update BeleagueredCastleRenderer.refreshUndoRedoButtons() to use alpha instead of color manipulation for disabled state. - Update BeleagueredCastleOverlayManager to use createHudText for stats and title text in win/no-moves overlays. - Remove unused FONT_FAMILY import from renderer.
…score overlay
Root cause: createActionButton creates Containers at default depth 0,
but overlay backgrounds sit at depth 10, hiding buttons behind them.
Fix:
- Add depth option to ActionButtonOptions in shared Renderer API
- Set container depth when depth option is provided in createActionButton
- Pass { depth: 11 } to all three overlay button calls in SushiGoOverlayManager
- Pass depth option through createSushiGoMenuButton wrapper
Test:
- New browser test 'renders Next Round button above overlay background depth'
checks Container depth >= 11 and background rectangle is interactive
- Created GolfAdapter re-exporting shared helpers with Golf-specific wrappers (createGolfHudText, createGolfMenuButton) - Migrated GolfOverlayManager to use createActionButton, createGolfHudText, createGolfMenuButton from GolfAdapter - Migrated GolfRenderer to use createGolfHudText for all text rendering - Migrated GolfReplayController to use createActionButton, createGolfHudText - Added align and lineSpacing support to HudTextOptions - Fixed GolfOverlay browser test: use MouseEvent instead of PointerEvent (Phaser 4 RC7 MouseManager listens for mousedown/mouseup, not pointerdown/pointerup) - Updated renderer unit tests for changed interaction target
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate Golf game rendering to use the shared Renderer API via a GolfAdapter, following the same adapter pattern established by Main Street and The Mind in CG-0MP12VWO1003YL55.
Changes
GolfAdapter.ts: Re-exports shared helpers (createHudText,createActionButton,createHudContainer,getCardTexture,createSceneTitle,createSceneMenuButton,createOverlayBackground,dismissOverlay) and provides Golf-specific wrappers (createGolfHudTextwith Golf font/depth defaults,createGolfMenuButtonfor menu navigation)GolfOverlayManager.ts: UsescreateActionButton,createGolfHudText,createGolfMenuButtonfrom adapter; removed directscene.add.text()callsGolfRenderer.ts: UsescreateGolfHudTextfor all text elements (labels, scores, instructions); imports card textures and scene helpers via adapterGolfReplayController.ts: UsescreateActionButtonfor takeover overlay buttons,createGolfHudTextfor textalignandlineSpacingtoHudTextOptions/createHudTextfor text formatting supportMouseEventinstead ofPointerEvent(Phaser 4 RC7's MouseManager listens formousedown/mouseup, and synthetic PointerEvents don't auto-generate matching MouseEvents)Test Results
Review Focus
createActionButton