From 1bba74750c26b989140d870dd44970aae4f72c02 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:01:16 +0200 Subject: [PATCH] Don't kill window incorrectly if CoopSettingsWindow is active --- Fika.Core/UI/Custom/MatchMakerUIScript.cs | 4 +++- .../MatchmakerAcceptScreen_Show_Patch.cs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Fika.Core/UI/Custom/MatchMakerUIScript.cs b/Fika.Core/UI/Custom/MatchMakerUIScript.cs index 1fff94f2..3688fc9d 100644 --- a/Fika.Core/UI/Custom/MatchMakerUIScript.cs +++ b/Fika.Core/UI/Custom/MatchMakerUIScript.cs @@ -1,6 +1,7 @@ using Comfort.Common; using EFT; using EFT.UI; +using EFT.UI.Matchmaker; using Fika.Core.Bundles; using Fika.Core.Coop.Patches; using Fika.Core.Coop.Utils; @@ -45,6 +46,7 @@ public DefaultUIButton AcceptButton internal RaidSettings raidSettings; internal DefaultUIButton backButton; internal DefaultUIButton acceptButton; + internal CoopSettingsWindow coopSettingsWindow; protected void OnEnable() { @@ -78,7 +80,7 @@ protected void Start() protected void Update() { - if (Input.GetKeyDown(KeyCode.Escape)) + if (Input.GetKeyDown(KeyCode.Escape) && coopSettingsWindow != null && !coopSettingsWindow.IsActive) { DestroyThis(); } diff --git a/Fika.Core/UI/Patches/MatchmakerAcceptScreen/MatchmakerAcceptScreen_Show_Patch.cs b/Fika.Core/UI/Patches/MatchmakerAcceptScreen/MatchmakerAcceptScreen_Show_Patch.cs index e8dc78c0..9c5cab67 100644 --- a/Fika.Core/UI/Patches/MatchmakerAcceptScreen/MatchmakerAcceptScreen_Show_Patch.cs +++ b/Fika.Core/UI/Patches/MatchmakerAcceptScreen/MatchmakerAcceptScreen_Show_Patch.cs @@ -21,7 +21,7 @@ protected override MethodBase GetTargetMethod() public static GameObject MatchmakerObject { get; set; } [PatchPrefix] - private static void Prefix(ref RaidSettings raidSettings, DefaultUIButton ____acceptButton, DefaultUIButton ____backButton) + private static void Prefix(ref RaidSettings raidSettings, DefaultUIButton ____acceptButton, DefaultUIButton ____backButton, CoopSettingsWindow ____coopSettingsWindow) { if (MatchmakerObject == null) { @@ -37,6 +37,7 @@ private static void Prefix(ref RaidSettings raidSettings, DefaultUIButton ____ac newMatchMaker.raidSettings = raidSettings; newMatchMaker.acceptButton = ____acceptButton; newMatchMaker.backButton = ____backButton; + newMatchMaker.coopSettingsWindow = ____coopSettingsWindow; } [PatchPostfix]