mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-08-05 15:10:23 +08:00
refactor(UXAssist): split UIFunctions into UI sub-features
This commit is contained in:
@@ -114,7 +114,7 @@ public class PlayerPatch : PatchImpl<PlayerPatch>
|
||||
new CodeInstruction(OpCodes.Brtrue, jumpPos.Value),
|
||||
new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(PlayerPatch.ShortcutKeysForStarsName), nameof(ShortcutKeysForStarsName.ForceShowAllStarsName))),
|
||||
new CodeInstruction(OpCodes.Brtrue, jumpPos.Value),
|
||||
new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(Functions.UIFunctions), nameof(Functions.UIFunctions.ShowStarName))),
|
||||
new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(Functions.UI.StarmapFilterUI), nameof(Functions.UI.StarmapFilterUI.ShowStarName))),
|
||||
new CodeInstruction(OpCodes.Ldarg_0),
|
||||
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(UIStarmapStar), nameof(UIStarmapStar.star))),
|
||||
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(StarData), nameof(StarData.index))),
|
||||
|
||||
@@ -355,21 +355,21 @@ public class UIPatch : PatchImpl<UIPatch>
|
||||
[HarmonyPatch(typeof(UIStarmapStar), nameof(UIStarmapStar.OnStarDisplayNameChange))]
|
||||
private static bool UIStarmapStar_OnStarDisplayNameChange_Prefix()
|
||||
{
|
||||
return Functions.UIFunctions.CornerComboBoxIndex == 0;
|
||||
return Functions.UI.StarmapFilterUI.CornerComboBoxIndex == 0;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(UIStarmapStar), nameof(UIStarmapStar._OnClose))]
|
||||
private static void UIStarmapStar__OnClose_Postfix(UIStarmapStar __instance)
|
||||
{
|
||||
Functions.UIFunctions.StarmapFilterToggler?.SetCheckedWithEvent(false);
|
||||
Functions.UI.StarmapFilterUI.StarmapFilterToggler?.SetCheckedWithEvent(false);
|
||||
}
|
||||
|
||||
[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)
|
||||
if (!UIRoot.instance.uiGame.starmap.active || !Functions.UI.StarmapFilterUI.StarmapFilterToggler.Checked)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -382,7 +382,7 @@ public class UIPatch : PatchImpl<UIPatch>
|
||||
[HarmonyPatch(typeof(UIGoalPanel), nameof(UIGoalPanel.DetermineVisiable))]
|
||||
private static bool UIGoalPanel_DetermineVisiable_Prefix(UIGoalPanel __instance)
|
||||
{
|
||||
if (!UIRoot.instance.uiGame.starmap.active || !Functions.UIFunctions.StarmapFilterToggler.Checked)
|
||||
if (!UIRoot.instance.uiGame.starmap.active || !Functions.UI.StarmapFilterUI.StarmapFilterToggler.Checked)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user