From 7a18716b8ad256e828f19b4e98708f25a0f4193f Mon Sep 17 00:00:00 2001 From: Vigers Ray Date: Fri, 23 Jan 2026 22:00:06 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=84=D0=BE=D0=BD=D0=BE=D0=B2=D0=BE=D0=B9=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B8=20=D1=80=D0=B5=D1=81?= =?UTF-8?q?=D1=83=D1=80=D1=81=D0=BE=D0=B2=20=D0=B2=20=D0=BB=D0=BE=D0=B1?= =?UTF-8?q?=D0=B1=D0=B8:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BA=D0=BE=D0=BD=D1=82=D1=80=D0=BE=D0=BB=D1=8C=20?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D0=B9=20=D1=84=D0=BE=D0=BD=D0=B0?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D1=80=D0=B5=D0=B4=D0=BE=D1=82?= =?UTF-8?q?=D0=B2=D1=80=D0=B0=D1=89=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=83=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D1=80=D0=B5=D0=B2=D1=88=D0=B8=D1=85=20=D1=80=D0=B5?= =?UTF-8?q?=D0=B7=D1=83=D0=BB=D1=8C=D1=82=D0=B0=D1=82=D0=BE=D0=B2=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B8."?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 62fb6bada4bd4265d1860849ba35017365b346ed. --- Content.Client/Lobby/LobbyState.cs | 60 ++------------------------- Content.Client/Lobby/UI/LobbyGui.xaml | 6 +-- 2 files changed, 6 insertions(+), 60 deletions(-) diff --git a/Content.Client/Lobby/LobbyState.cs b/Content.Client/Lobby/LobbyState.cs index 867bfba509..32a918dc5b 100644 --- a/Content.Client/Lobby/LobbyState.cs +++ b/Content.Client/Lobby/LobbyState.cs @@ -70,11 +70,6 @@ namespace Content.Client.Lobby private ResPath? _currentAnimationPath; private ResPath? _currentArtPath; - // Используется для «мягкой отмены» фоновых загрузок (арт / анимация / параллакс). - // При каждом запуске новой загрузки увеличиваем версию и перед применением результата - // проверяем, что версия всё ещё совпадает (иначе результат игнорируем). - private int _backgroundLoadVersion = 0; - private const string LoadingRsiPath = "/Textures/_Sunrise/loading.rsi"; private const string LoadingState = "loading"; @@ -446,8 +441,6 @@ namespace Content.Client.Lobby lobbyBackgroundTypeString = default; } - _backgroundLoadVersion++; - // Lobby may be null during reconnection or before initialization // This is normal, just return silently - the background will be set when Lobby is initialized if (Lobby == null) @@ -514,8 +507,6 @@ namespace Content.Client.Lobby private void SetLobbyAnimation(string lobbyAnimation) { - var loadVersion = _backgroundLoadVersion; - // Check if animation background type is currently selected var backgroundType = _cfg.GetCVar(SunriseCCVars.LobbyBackgroundType); if (backgroundType == "Random" && _gameTicker.LobbyType != null) @@ -541,12 +532,6 @@ namespace Content.Client.Lobby return; } - if (loadVersion != _backgroundLoadVersion) - { - _sawmill.Debug("SetLobbyAnimation aborted due to background load version change"); - return; - } - // Hide old animation and show loading animation immediately (before any resource checks) Lobby!.LobbyAnimation.Visible = false; ShowLoadingAnimation(); @@ -658,11 +643,11 @@ namespace Content.Client.Lobby { // First try to get from cache bool fromCache = _resourceCache.TryGetResource(targetPath, out rsiResource); - + if (fromCache && rsiResource != null) { _sawmill.Debug($"RSI resource found in cache: {targetPath}"); - + // Verify that cached resource is still valid by checking if the state exists // This is important after reconnection when files in VFS may have been cleared if (!rsiResource.RSI.TryGetState(requiredState, out _)) @@ -673,7 +658,7 @@ namespace Content.Client.Lobby rsiResource = null; } } - + if (!fromCache) { _sawmill.Debug($"RSI resource not in cache or invalid, attempting to load: {targetPath}"); @@ -698,12 +683,6 @@ namespace Content.Client.Lobby return; } - if (loadVersion != _backgroundLoadVersion) - { - _sawmill.Debug("SetLobbyAnimation result ignored due to background load version change"); - return; - } - // Final verification that the resource actually loaded correctly by checking if the state exists if (rsiResource == null || !rsiResource.RSI.TryGetState(requiredState, out _)) { @@ -733,7 +712,6 @@ namespace Content.Client.Lobby private void SetLobbyArt(string lobbyArt) { - var loadVersion = _backgroundLoadVersion; // Check if art background type is currently selected var backgroundType = _cfg.GetCVar(SunriseCCVars.LobbyBackgroundType); if (backgroundType == "Random" && _gameTicker.LobbyType != null) @@ -759,12 +737,6 @@ namespace Content.Client.Lobby return; } - if (loadVersion != _backgroundLoadVersion) - { - _sawmill.Debug("SetLobbyArt aborted due to background load version change"); - return; - } - // Hide old art and show loading animation immediately Lobby!.LobbyArt.Visible = false; ShowLoadingAnimation(); @@ -807,12 +779,6 @@ namespace Content.Client.Lobby // Try to set the art, handle errors gracefully try { - if (loadVersion != _backgroundLoadVersion) - { - _sawmill.Debug("SetLobbyArt result ignored due to background load version change"); - return; - } - if (_resourceCache.TryGetResource(targetPath, out var textureResource)) { Lobby!.LobbyArt.Texture = textureResource.Texture; @@ -834,7 +800,6 @@ namespace Content.Client.Lobby private void SetLobbyParallax(string lobbyParallax) { - var loadVersion = _backgroundLoadVersion; // Check if parallax background type is currently selected var backgroundType = _cfg.GetCVar(SunriseCCVars.LobbyBackgroundType); if (backgroundType == "Random" && _gameTicker.LobbyType != null) @@ -860,24 +825,12 @@ namespace Content.Client.Lobby return; } - if (loadVersion != _backgroundLoadVersion) - { - _sawmill.Debug("SetLobbyParallax aborted due to background load version change"); - return; - } - // Show loading animation for parallax (it may load network textures) ShowLoadingAnimation(); // Subscribe to resource loaded events to hide loading animation when parallax textures are ready void OnParallaxResourceLoaded(string resourcePath) { - if (loadVersion != _backgroundLoadVersion) - { - _netTexturesManager.ResourceLoaded -= OnParallaxResourceLoaded; - return; - } - // Check if parallax is loaded if (_parallaxManager.IsLoaded(lobbyParallaxPrototype.Parallax)) { @@ -890,12 +843,7 @@ namespace Content.Client.Lobby _parallaxManager.LoadParallaxByName(lobbyParallaxPrototype.Parallax).ContinueWith(task => { - if (loadVersion != _backgroundLoadVersion) - { - _netTexturesManager.ResourceLoaded -= OnParallaxResourceLoaded; - return; - } - + // Hide loading animation when parallax loading completes if (Lobby != null && _parallaxManager.IsLoaded(lobbyParallaxPrototype.Parallax)) { _netTexturesManager.ResourceLoaded -= OnParallaxResourceLoaded; diff --git a/Content.Client/Lobby/UI/LobbyGui.xaml b/Content.Client/Lobby/UI/LobbyGui.xaml index 23c6e87a88..3799c36ee5 100644 --- a/Content.Client/Lobby/UI/LobbyGui.xaml +++ b/Content.Client/Lobby/UI/LobbyGui.xaml @@ -44,14 +44,12 @@ Name="LoadingAnimationContainer" Orientation="Vertical" VerticalAlignment="Center" - Visible="False" - MouseFilter="Pass"> + Visible="False"> + VerticalAlignment="Center" />