oni-priority-ux/mod/Patches/Screen.cs

49 lines
1.5 KiB
C#

// Generic place to intercept screen functions that are not overriden
using System;
using HarmonyLib;
using UnityEngine;
namespace PriorityUX {
// [HarmonyPatch(typeof(KScreen))]
// static class ScreenKeyPatches {
// [HarmonyPatch("OnKeyDown")]
// [HarmonyPostfix]
// static void OnKeyDown_Postfix(KButtonEvent e, object __instance) {
// // Debug.Log("KeyDown " + e + " " + __instance);
// // Debug.Log(Environment.StackTrace);
// // if (__instance is MaterialSelectionPanel msp) {
// // Debug.Log("KD> Material Selection");
// // }
// // if (__instance is MaterialSelectionPanel msp) {
// // Debug.Log("[PriorityUX] >> Redirect MaterialSelectionPanel KeyDown");
// // Debug.Log(msp);
// // MaterialSelectionPanelPatches.OnKeyDown(e, msp);
// // }
// }
// [HarmonyPatch("OnKeyUp")]
// [HarmonyPostfix]
// static void OnKeyUp_Postfix(KButtonEvent e, object __instance) {
// // if (__instance is MaterialSelectionPanel msp) {
// // Debug.Log("[PriorityUX] >> Redirect MaterialSelectionPanel KeyUp");
// // Debug.Log(msp);
// // MaterialSelectionPanelPatches.OnKeyUp(e, msp);
// // }
// }
// }
// [HarmonyPatch(typeof(KIconToggleMenu))]
// static class Test {
// [HarmonyPatch("OnKeyDown")]
// [HarmonyPostfix]
// static void OnKeyDown_Postfix(KButtonEvent e, object __instance) {
// // Debug.Log("KIconToggleMenu KeyDown " + e + " " + __instance);
// // Debug.Log(Environment.StackTrace);
// }
// }
}