Fixed LAN UI error after game end

This commit is contained in:
kmyuhkyuk
2026-03-22 22:33:04 +08:00
parent fb4fc9fa93
commit 7aab2e08bd
3 changed files with 14 additions and 19 deletions
@@ -15,15 +15,10 @@ namespace SlayTheSpire2.LAN.Multiplayer.Components
{
private static readonly string ScenePath = SceneHelper.GetScenePath("screens/multiplayer_host_submenu");
public static LanMultiplayerHostSubmenu? Instance { get; private set; }
private Control? _loadingOverlay;
public new static NMultiplayerHostSubmenu? Create()
public new static LanMultiplayerHostSubmenu? Create()
{
if (IsInstanceValid(Instance))
return Instance;
if (TestMode.IsOn)
return null;
@@ -41,8 +36,6 @@ namespace SlayTheSpire2.LAN.Multiplayer.Components
multiplayerHostSubmenu.QueueFree();
Instance = lanMultiplayerHostSubmenu;
return lanMultiplayerHostSubmenu;
}
@@ -1,5 +1,4 @@
using Godot;
using HarmonyLib;
using HarmonyLib;
using MegaCrit.Sts2.Core.Helpers;
using MegaCrit.Sts2.Core.Nodes.Screens.MainMenu;
using SlayTheSpire2.LAN.Multiplayer.Components;
@@ -16,9 +15,12 @@ namespace SlayTheSpire2.LAN.Multiplayer.Patchs.Screens
{
if (type == typeof(LanMultiplayerHostSubmenu))
{
if (!GodotObject.IsInstanceValid(LanMultiplayerHostSubmenu.Instance))
var lanMultiplayerHostSubmenu =
__instance.GetNodeOrNull<LanMultiplayerHostSubmenu>("LANMultiplayerHostSubmenu");
if (lanMultiplayerHostSubmenu == null)
{
var lanMultiplayerHostSubmenu = LanMultiplayerHostSubmenu.Create();
lanMultiplayerHostSubmenu = LanMultiplayerHostSubmenu.Create();
if (lanMultiplayerHostSubmenu != null)
{
@@ -30,7 +32,7 @@ namespace SlayTheSpire2.LAN.Multiplayer.Patchs.Screens
}
else
{
__result = LanMultiplayerHostSubmenu.Instance;
__result = lanMultiplayerHostSubmenu;
}
return false;
@@ -4,8 +4,8 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyVersion>1.6.0.0</AssemblyVersion>
<FileVersion>1.6.0.0</FileVersion>
<AssemblyVersion>1.6.1.0</AssemblyVersion>
<FileVersion>1.6.1.0</FileVersion>
</PropertyGroup>
<ItemGroup>
@@ -14,16 +14,16 @@
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>V:\Slay.the.Spire.2\data_sts2_windows_x86_64\0Harmony.dll</HintPath>
<HintPath>V:\SteamLibrary\steamapps\common\Slay the Spire 2\data_sts2_windows_x86_64\0Harmony.dll</HintPath>
</Reference>
<Reference Include="GodotSharp">
<HintPath>V:\Slay.the.Spire.2\data_sts2_windows_x86_64\GodotSharp.dll</HintPath>
<HintPath>V:\SteamLibrary\steamapps\common\Slay the Spire 2\data_sts2_windows_x86_64\GodotSharp.dll</HintPath>
</Reference>
<Reference Include="Steamworks.NET">
<HintPath>V:\Slay.the.Spire.2\data_sts2_windows_x86_64\Steamworks.NET.dll</HintPath>
<HintPath>V:\SteamLibrary\steamapps\common\Slay the Spire 2\data_sts2_windows_x86_64\Steamworks.NET.dll</HintPath>
</Reference>
<Reference Include="sts2">
<HintPath>V:\Slay.the.Spire.2\data_sts2_windows_x86_64\sts2.dll</HintPath>
<HintPath>V:\SteamLibrary\steamapps\common\Slay the Spire 2\data_sts2_windows_x86_64\sts2.dll</HintPath>
</Reference>
</ItemGroup>