Complete Match Results modal: standalone overlay, auto-open on resolution

MatchResultScreen becomes a self-contained modal (IsOpen/Open/Close,
_panelRoot, pause handling); resolution auto-open moves there from the
session browser. OverviewMenu integrates it into the Esc chain and hides
the Match Results button until results exist (same pattern as the
role-scoped mode buttons).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Fable 5 committed 2026-07-12 12:55:05 +02:00
1 parent fdb562bba5
commit 7669ae1b66
3 files changed
+101 -28

No files matched your search

@@ -13,9 +13,7 @@ using UnityEngine.UI;
/// lobby/map the overview (Esc) menu reopens it via <see cref="Open"/> as a modal pause overlay
/// (cursor freed, gameplay suspended via <see cref="GameModeManager.SetPaused"/>) - all Esc key
/// handling lives in <see cref="OverviewMenu"/>, which closes this overlay through <see cref="Close"/>.
/// It also auto-opens when the Resolution sub-phase begins so
/// the final match scoreboard (a section of this panel) is presented. The Disconnect button is
/// context-sensitive: in Main it is an
/// The Disconnect button is context-sensitive: in Main it is an
/// application "Exit"; on the map it becomes "Back to Lobby" for the match authority (ends the match);
/// everyone else gets a plain disconnect. Only the visual <see cref="panelRoot"/> is toggled - this binder
/// stays alive on its (always-active) canvas so it keeps tracking state while the panel is hidden.
@@ -61,7 +59,6 @@ public class OnlineSessionBrowserUI : MonoBehaviour
private bool _connected; // last-seen connection state (to detect transitions)
private Scene _lastScene; // last-seen active scene (to auto-close on a scene change)
private string _disconnectText; // last applied caption (avoids per-frame TMP churn)
private MatchManager.MatchSubPhase _lastSubPhase; // last-seen sub-phase (auto-open on Resolution)
private void Awake()
{
@@ -124,16 +121,6 @@ public class OnlineSessionBrowserUI : MonoBehaviour
if (!connected) return; // Main: panel always shown
// Resolution just began -> auto-open the overlay so the final scoreboard is presented. Esc can
// still close it (via the overview menu); the lobby scene swap afterwards auto-closes it (see above).
MatchManager.MatchSubPhase subPhase = _match ? _match.LocalSubPhase : MatchManager.MatchSubPhase.None;
if (subPhase != _lastSubPhase)
{
_lastSubPhase = subPhase;
if (subPhase == MatchManager.MatchSubPhase.Resolution && !_open)
SetOpen(true);
}
RefreshDisconnectLabel();
}
@@ -202,7 +189,6 @@ public class OnlineSessionBrowserUI : MonoBehaviour
// Connection up (hosted/joined) -> hide the panel; Esc reopens it in the lobby/map.
// Back to Main (disconnect/shutdown) -> show it again and drop any pause.
_open = false;
_lastSubPhase = MatchManager.MatchSubPhase.None; // rejoining into Resolution must re-trigger
if (!connected && _gameMode) _gameMode.SetPaused(false);
ApplyVisibility();
}