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]