mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-08 23:33:33 +08:00
Starmap filter: Hide top overlaping windows while the filter UI is shown
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user