mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-09 06:13:36 +08:00
missing files
This commit is contained in:
36
UXAssist/Patches/UIPatch.cs
Normal file
36
UXAssist/Patches/UIPatch.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
namespace UXAssist.Patches;
|
||||
|
||||
using Common;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
[PatchGuid(PluginInfo.PLUGIN_GUID)]
|
||||
public class UIPatch: PatchImpl<UIPatch>
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
Enable(true);
|
||||
Functions.UIFunctions.InitMenuButtons();
|
||||
}
|
||||
|
||||
// Add config button to main menu
|
||||
[HarmonyPostfix, HarmonyPatch(typeof(UIRoot), nameof(UIRoot._OnOpen))]
|
||||
public static void UIRoot__OnOpen_Postfix()
|
||||
{
|
||||
Functions.UIFunctions.InitMenuButtons();
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(UIPlanetGlobe), nameof(UIPlanetGlobe.DistributeButtons))]
|
||||
private static void UIPlanetGlobe_DistributeButtons_Postfix(UIPlanetGlobe __instance)
|
||||
{
|
||||
Functions.UIFunctions.UpdateGlobeButtonPosition(__instance);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(UIStarmapStar), nameof(UIStarmapStar.OnStarDisplayNameChange))]
|
||||
private static bool UIStarmapStar_OnStarDisplayNameChange_Prefix()
|
||||
{
|
||||
return Functions.UIFunctions.CornerComboBoxIndex == 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user