From d490fd8bd49df47bc73cfd3887cbdd2cdc66e54d Mon Sep 17 00:00:00 2001 From: MrBruh <4706866+cybersecurity@users.noreply.github.com> Date: Mon, 19 Oct 2026 21:40:27 +1300 Subject: [PATCH] Undo the map list's own return to the main menu after a match (#329) The Xbox's postgame map select wrappers already carry main_menu_if_no_history, with which the stock event code calls main_goto_main_menu() when Back closes the last screen. The PC menus' connected_map_select_wrapper, which menu_tags.c opens in their place, was given the same flag by tools/port_settings.py in 4301ca88d, so the hard-coded names and the network_game_abort() call in widget_instance_go_back_to_previous were not needed, and they changed stock split-screen behaviour (a split-screen game is a local server). widget_instance_go_back_to_previous is as it was before 7d128e1bd. Checked: the harness and touch menu tests (491 passed), test_web_build (11 passed), ui_widget.c compiled for Linux and the Android guest. --- source/interface/ui_widget.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/source/interface/ui_widget.c b/source/interface/ui_widget.c index 11bc7765..3355b6a4 100644 --- a/source/interface/ui_widget.c +++ b/source/interface/ui_widget.c @@ -3220,17 +3220,6 @@ static void widget_instance_set_focused_child_by_index( return; } -/* port: the map list a finished match opens on its own, after the menu -history was closed with the match */ -static boolean widget_name_is_postgame_map_list( - char const *name) -{ - return name && - (!csstrcmp(name, "pc\\main_menu\\multiplayer_type_select\\connected\\connected_map_select_wrapper") || - !csstrcmp(name, "ui\\shell\\main_menu\\multiplayer_type_select\\connected\\connected_map_select_postgame_wrapper") || - !csstrcmp(name, "ui\\shell\\main_menu\\multiplayer_type_select\\split_screen\\splitscreen_map_select_postgame_wrapper")); -} - static void widget_instance_go_back_to_previous( struct widget_instance *widget) { @@ -3238,8 +3227,6 @@ static void widget_instance_go_back_to_previous( short widget_stack = (widget->local_player_index == NONE) ? 0 : widget->local_player_index; short previous_local_player_index = NONE; long previous_widget_tag; - struct widget_instance *top = widget_instance_get_topmost_parent(widget); - char const *closed_name = top ? tag_get_name(top->definition_tag_index) : NULL; if (widget_globals.widget_stack[widget_stack]) { @@ -3251,7 +3238,7 @@ static void widget_instance_go_back_to_previous( { previous_widget_tag = NONE; } - ui_widget_delete(top); + ui_widget_delete(widget_instance_get_topmost_parent(widget)); if (previous_widget_tag != NONE) { struct widget_instance *new_widget = ui_widget_load_by_name_or_tag( @@ -3271,17 +3258,6 @@ static void widget_instance_go_back_to_previous( data.focused_child_index); } } - /* port: that list has no screen before it. Back would leave the - menu's world up with no buttons, logo or music. Any other screen - with no history is left as it was. A network game returns through - the main menu; the menu's own world loads its shell. */ - else if (widget_name_is_postgame_map_list(closed_name)) - { - if (global_network_game_server_get() || global_network_game_client_get()) - network_game_abort(); - else if (main_menu_is_active()) - main_goto_main_menu(); - } return; }