1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-08 22:13:30 +08:00

Starmap filter: Hide top overlaping windows while the filter UI is shown

This commit is contained in:
2025-05-02 21:03:46 +08:00
parent fb3a74c7e7
commit 47cfb4d79a
4 changed files with 41 additions and 11 deletions

View File

@@ -41,4 +41,33 @@ public class UIPatch: PatchImpl<UIPatch>
{
return Functions.UIFunctions.CornerComboBoxIndex == 0;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(UIMechaLab), nameof(UIMechaLab.DetermineVisible))]
private static bool UIMechaLab_DetermineVisible_Prefix(UIMechaLab __instance, ref bool __result)
{
if (!UIRoot.instance.uiGame.starmap.active || !Functions.UIFunctions.StarmapFilterToggler.Checked)
{
return true;
}
__instance._Close();
__result = false;
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(UIGoalPanel), nameof(UIGoalPanel.DetermineVisiable))]
private static bool UIGoalPanel_DetermineVisiable_Prefix(UIGoalPanel __instance)
{
if (!UIRoot.instance.uiGame.starmap.active || !Functions.UIFunctions.StarmapFilterToggler.Checked)
{
return true;
}
__instance.isUseOverwrittenState = true;
if (__instance.stateOverwritten == EUIGoalPanelState.None)
{
__instance.stateOverwritten = EUIGoalPanelState.Collapse;
}
return false;
}
}