Initial commit
This commit is contained in:
35
mod/Patches/PlanScreen.cs
Normal file
35
mod/Patches/PlanScreen.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace PriorityUX {
|
||||
[HarmonyPatch(typeof(PlanScreen))]
|
||||
static class PlanScreenPatches {
|
||||
[HarmonyPatch("OnKeyDown")]
|
||||
[HarmonyPrefix]
|
||||
public static bool OnKeyDown_Prefix(KButtonEvent e, PlanScreen __instance) {
|
||||
// Debug.Log("PlanScreen OnKeyDown " + e.GetAction());
|
||||
// Debug.Log("__instance.ProductInfoScreen: " + __instance.ProductInfoScreen);
|
||||
// Debug.Log("ProductInfoScreen Active: " + __instance.ProductInfoScreen.gameObject.activeSelf);
|
||||
if (__instance.ProductInfoScreen.gameObject.activeSelf) {
|
||||
MaterialSelectionPanelPatches.OnKeyDown(e, __instance.ProductInfoScreen.materialSelectionPanel);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
[HarmonyPatch("OnKeyUp")]
|
||||
[HarmonyPrefix]
|
||||
public static bool OnKeyUp_Prefix(KButtonEvent e, PlanScreen __instance) {
|
||||
// Debug.Log("PlanScreen OnKeyUp " + e.GetAction());
|
||||
// Debug.Log("__instance.ProductInfoScreen: " + __instance.ProductInfoScreen);
|
||||
// Debug.Log("ProductInfoScreen Active: " + __instance.ProductInfoScreen.gameObject.activeSelf);
|
||||
if (__instance.ProductInfoScreen.gameObject.activeSelf) {
|
||||
MaterialSelectionPanelPatches.OnKeyUp(e, __instance.ProductInfoScreen.materialSelectionPanel);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user