Embed server browser as main menu modal

Refactors the browser UI into a reusable `CO_Browser.create()` module and adds embedded modal styling so MULTIPLAYER opens inside the main menu instead of swapping to a separate view. Updates main-menu JS/CSS to host, animate, and route input for the browser panel while keeping nav and prompts in sync. On the C++ side, PrismaUI now drives browser show/hide and event dispatch through the main menu view, and `ServerBrowserBridge::SetView()` was added so bridge events target the active host view.
This commit is contained in:
2026-07-07 17:35:15 +12:00
parent 2961eb6512
commit 9447bc308f
12 changed files with 1514 additions and 982 deletions
+31
View File
@@ -240,6 +240,37 @@ See corrected entry above for the full investigation and actual root cause. This
### Next Steps
- See corrected entry above.
## 2026-07-07 - Server Browser Main Menu Modal
### Summary
Refactored the server browser into a reusable `CO_Browser.create()` module (same pattern as settings) and embedded it in the custom main menu as a modal overlay. MULTIPLAYER now opens the browser in-place while keeping the left nav visible; B/back closes the modal and returns to the menu list. All existing C++↔JS hooks are preserved (`coAction`, `dispatchCoEvent`, `onBrowserShown`, `closeBrowser`, `setConnectionStatus`, `CO_App`).
### Files Changed
- `ui/views/CommonwealthOnline/browser/browser.js` (new reusable module)
- `ui/views/CommonwealthOnline/browser/browser-modal.css` (new embedded modal styles)
- `ui/views/CommonwealthOnline/browser/app.js` (standalone bootstrap)
- `ui/views/CommonwealthOnline/browser/index.html` (uses `CO_Browser.create()`)
- `ui/views/CommonwealthOnline/main-menu/index.html`, `script.js`, `styles.css`
- `plugin/src/F4TPrismaUI.cpp`
- `plugin/include/F4TServerBrowserBridge.h`, `plugin/src/F4TServerBrowserBridge.cpp`
- `changelog.md`
### Details
- Browser modal uses the same fade/slide animation pattern as the settings panel (`is-browser-mode` on `.main-screen`).
- `F4TPrismaUI::ShowServerBrowser()` now ensures the main menu is visible and invokes `onBrowserShown` on the main menu view instead of hiding it and showing a separate browser PrismaUI view.
- `ServerBrowserBridge::SetView()` lets the bridge dispatch events to whichever view hosts the browser UI.
- Standalone `browser/index.html` remains available for F9/dev testing with unchanged global hooks.
### Testing
- Not run in this session (requires in-game PrismaUI).
### Known Issues
- None currently known.
### Next Steps
- In-game verify MULTIPLAYER opens modal, server list populates via `dispatchCoEvent`, join/refresh actions reach C++, and B closes back to main menu.
- Confirm gamepad routing still reaches browser via `ServerBrowserBridge::ForwardControllerInput` when browser modal is open.
## 2026-07-06 - Main Menu PrismaUI Overlay + Input Capture
### Summary