Jo Jo funguje Kappa

This commit is contained in:
Dominik G.
2025-10-06 18:15:27 +02:00
parent 807e8fc5f3
commit 515160b1ec
11 changed files with 3103 additions and 76 deletions

View File

@@ -80,24 +80,45 @@ namespace MegaKoop.UI
// Steam Integration
private SteamLobbyService steam;
private bool _initialized;
private void Start()
{
if (uiDocument == null)
uiDocument = GetComponent<UIDocument>();
if (uiDocument != null)
{
root = uiDocument.rootVisualElement;
InitializeElements();
RegisterEvents();
EnsureSteamServices();
RegisterSteamEvents();
SetupInitialState();
}
else
if (uiDocument == null)
{
Debug.LogError("UIDocument not found on MultiplayerLobbyController!");
return;
}
root = uiDocument.rootVisualElement;
if (root == null)
{
Debug.LogError("rootVisualElement is null on MultiplayerLobbyController!");
return;
}
// Initialize only after attached to a panel to avoid DPI/pixelsPerPoint issues
root.RegisterCallback<AttachToPanelEvent>(OnAttachedToPanel);
if (root.panel != null)
{
// Already attached (domain reload case)
OnAttachedToPanel(default);
}
}
private void OnAttachedToPanel(AttachToPanelEvent evt)
{
if (_initialized) return;
_initialized = true;
InitializeElements();
RegisterEvents();
EnsureSteamServices();
RegisterSteamEvents();
SetupInitialState();
}
private void OnDisable()