Skip to content

Commit

Permalink
Temporarily disable UIControlPanel interactions
Browse files Browse the repository at this point in the history
  • Loading branch information
starfi5h committed Aug 16, 2024
1 parent efff3e1 commit 0afe80a
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#region

using HarmonyLib;
using NebulaWorld;

#endregion

namespace NebulaPatcher.Patches.Dynamic;

[HarmonyPatch(typeof(UIControlPanelAdvancedMinerEntry))]
internal class UIControlPanelAdvancedMinerEntry_Patch
{
[HarmonyPrefix]
[HarmonyPatch(nameof(UIControlPanelAdvancedMinerEntry.OnFillNecessaryButtonClick))]
public static bool OnFillNecessaryButtonClick_Prefix()
{
if (!Multiplayer.IsActive) return true;

// Temporarily disable fill item button. We will sync in the future
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#region

using HarmonyLib;
using NebulaWorld;

#endregion

namespace NebulaPatcher.Patches.Dynamic;

[HarmonyPatch(typeof(UIControlPanelDispenserEntry))]
internal class UIControlPanelDispenserEntry_Patch
{
[HarmonyPrefix]
[HarmonyPatch(nameof(UIControlPanelDispenserEntry.OnFillNecessaryButtonClick))]
public static bool OnFillNecessaryButtonClick_Prefix(UIControlPanelDispenserEntry __instance)
{
if (!Multiplayer.IsActive) return true;

// Temporarily disable fill item button. We will sync in the future
return false;
}
}
22 changes: 22 additions & 0 deletions NebulaPatcher/Patches/Dynamic/UIControlPanelStationEntry_Patch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#region

using HarmonyLib;
using NebulaWorld;

#endregion

namespace NebulaPatcher.Patches.Dynamic;

[HarmonyPatch(typeof(UIControlPanelStationEntry))]
internal class UIControlPanelStationEntry_Patch
{
[HarmonyPrefix]
[HarmonyPatch(nameof(UIControlPanelStationEntry.OnFillNecessaryButtonClick))]
public static bool OnFillNecessaryButtonClick_Prefix()
{
if (!Multiplayer.IsActive) return true;

// Temporarily disable fill item button. We will sync in the future
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#region

using HarmonyLib;
using NebulaWorld;

#endregion

namespace NebulaPatcher.Patches.Dynamic;

[HarmonyPatch(typeof(UIControlPanelStationInspector))]
internal class UIControlPanelStationInspector_Patch
{
[HarmonyPostfix, HarmonyPriority(Priority.Last)]
[HarmonyPatch(nameof(UIControlPanelStationInspector._OnOpen))]
public static void OnOpen_Postfix(UIControlPanelStationInspector __instance)
{
if (!Multiplayer.IsActive) return;

// Temporarily disable the station window, as we need to deal with remote station and sync in the future
__instance._Close();
}
}

0 comments on commit 0afe80a

Please sign in to comment.