Skip to content

Commit

Permalink
[CMW] Do not close ConfigurationManager window if it was moved inside…
Browse files Browse the repository at this point in the history
… the settings screen
  • Loading branch information
ManlyMarco committed Dec 30, 2023
1 parent b6af626 commit f29855a
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/AI_ConfigurationManager/AI.ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ private static void OnOpen(ConfigWindow __instance, ref Button[] ___buttons)
}

[HarmonyPostfix, HarmonyPatch(typeof(ConfigWindow), nameof(ConfigWindow.Unload))]
private static void OnClose() => _manager.DisplayingWindow = false;
private static void OnClose() => _manager.DisplayingWindow = _manager.DisplayingWindow && !_manager.IsWindowFullscreen; // Keep the window open if user dragged it
}
}
2 changes: 1 addition & 1 deletion src/EC_ConfigurationManager/EC.ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ IEnumerator CreateButton()
}

[HarmonyPostfix, HarmonyPatch(typeof(ConfigScene), nameof(ConfigScene.Unload))]
private static void OnClose() => _manager.DisplayingWindow = false;
private static void OnClose() => _manager.DisplayingWindow = _manager.DisplayingWindow && !_manager.IsWindowFullscreen; // Keep the window open if user dragged it
}
}
2 changes: 1 addition & 1 deletion src/HC_ConfigurationManager/HC.ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,6 @@ private static void OnOpen(ConfigWindow __instance)
}

[HarmonyPostfix, HarmonyPatch(typeof(ConfigWindow), nameof(ConfigWindow.Unload))]
private static void OnClose() => _manager.DisplayingWindow = false;
private static void OnClose() => _manager.DisplayingWindow = _manager.DisplayingWindow && !_manager.IsWindowFullscreen; // Keep the window open if user dragged it
}
}
2 changes: 1 addition & 1 deletion src/HS2_ConfigurationManager/HS2.ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ private static void OnOpen(ConfigWindow __instance, ref Button[] ___buttons)
}

[HarmonyPostfix, HarmonyPatch(typeof(ConfigWindow), nameof(ConfigWindow.Unload))]
private static void OnClose() => _manager.DisplayingWindow = false;
private static void OnClose() => _manager.DisplayingWindow = _manager.DisplayingWindow && !_manager.IsWindowFullscreen; // Keep the window open if user dragged it
}
}
2 changes: 1 addition & 1 deletion src/HS_ConfigurationManager/HS.ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private IEnumerator SceneChanged()
else
{
_previousWindowState = _manager.DisplayingWindow;
_manager.DisplayingWindow = false;
_manager.DisplayingWindow = _manager.DisplayingWindow && !_manager.IsWindowFullscreen; // Keep the window open if user dragged it
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/KKS_ConfigurationManager/KKS_ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ private static void CreateButton()
private static void OnOpen(ref UniTask __result) => __result.GetAwaiter().OnCompleted(CreateButton);

[HarmonyPostfix, HarmonyPatch(typeof(ConfigScene), nameof(ConfigScene.Unload))]
private static void OnClose() => _manager.DisplayingWindow = false;
private static void OnClose() => _manager.DisplayingWindow = _manager.DisplayingWindow && !_manager.IsWindowFullscreen; // Keep the window open if user dragged it
}
}
2 changes: 1 addition & 1 deletion src/KK_ConfigurationManager/KK.ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ IEnumerator CreateButton()
}

[HarmonyPostfix, HarmonyPatch(typeof(ConfigScene), nameof(ConfigScene.Unload))]
private static void OnClose() => _manager.DisplayingWindow = false;
private static void OnClose() => _manager.DisplayingWindow = _manager.DisplayingWindow && !_manager.IsWindowFullscreen; // Keep the window open if user dragged it
}
}

0 comments on commit f29855a

Please sign in to comment.