From 4301ca88d6b5fa6cd4e98520672790bbbce425e7 Mon Sep 17 00:00:00 2001 From: chestahh Date: Fri, 16 Oct 2026 02:46:37 +0100 Subject: [PATCH] Restore the main menu when leaving the postgame host screen The postgame host map picker opens without menu history. Give it the existing main_menu_if_no_history flag used by the lobby so leaving the last screen restores the main menu instead of leaving only the background. Update the generator and generated XML together. Preserve OpenCE's existing handlers; no MCC code or regression-test files are included. This local menu change does not require a network version bump. Resolved the fork cherry-pick against OpenCE main 8102e711 by adding only the flag override. Windows portable release build passed. Existing menu teardown, touch and web checks returned 28 passes and 6 failures: missing m.lib/pthread.h and Windows path separators in POSIX-oriented tests. Android and web build targets were unavailable locally. Checked generator round-trip stability and git diff --check. The two simple wrappers were regenerated through ce_menus.widget_xml from their exported XML fields; the original PC tag inputs were unavailable. No upstream runtime game session or Linux build was run. Earlier scripted runtime verification was performed on the GulchCE implementation, not this upstream revision. (cherry picked from commit c811c7f527d70d5476578ed88ea0edcef2269967) --- .../menus/ce/main_menu.multiplayer_type_select.connected.xml | 2 +- tools/port_settings.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/port/assets/menus/ce/main_menu.multiplayer_type_select.connected.xml b/port/assets/menus/ce/main_menu.multiplayer_type_select.connected.xml index 786f8ca1..4ae27ed8 100644 --- a/port/assets/menus/ce/main_menu.multiplayer_type_select.connected.xml +++ b/port/assets/menus/ce/main_menu.multiplayer_type_select.connected.xml @@ -1,7 +1,7 @@ - + diff --git a/tools/port_settings.py b/tools/port_settings.py index 6e8028f8..c987b9f1 100644 --- a/tools/port_settings.py +++ b/tools/port_settings.py @@ -618,6 +618,11 @@ MAP_KIND_CHOOSER = "main_menu/new_select/list_item_0_map_kind" # changes to the PC version's widgets (by our names): attributes set, all # their handlers replaced, children added, game data inputs added WIDGET_PATCHES = { + # The host returns here after a round with no menu history. Back must + # reopen the main menu when it closes the last screen, as the lobby does. + f"{MT}/connected/connected_map_select_wrapper": {"set": { + "flags": "pass_unhandled_to_focused_child pause_game main_menu_if_no_history tag_controller_index force_handle_mouse", + }}, # (the profile settings' picture: on Gamepad Setup's row, the profile's # button settings, BITMAP_FRAMES; menu_functions.c's # profile_gamepad_layout)