fix: Improve logging for menu transitions and resolve top-level canvas references in ServerBrowser

This commit is contained in:
2025-12-15 10:39:38 +01:00
parent 270a92c617
commit 99398b5479
2 changed files with 42 additions and 4 deletions

View File

@@ -232,6 +232,7 @@ namespace KCM
FirstSibling = true,
OnClick = () =>
{
Main.helper?.Log("Multiplayer button clicked");
SfxSystem.PlayUiSelect();
TransitionTo(MenuState.ServerBrowser);
}
@@ -320,6 +321,10 @@ namespace KCM
if (ServerBrowser.KCMUICanvas != null)
{
ServerBrowser.KCMUICanvas.gameObject.SetActive((int)state > 21);
if (state == MenuState.ServerBrowser)
{
Main.helper?.Log($"TransitionTo ServerBrowser: browserRef={(ServerBrowser.serverBrowserRef != null ? "ready" : "null")}, canvas={(ServerBrowser.KCMUICanvas != null ? "ready" : "null")}");
}
helper.Log(((int)state > 21).ToString());
}