|
- using System;
- using System.Reflection;
-
- using Svelto.ECS;
-
- using HarmonyLib;
- using GamecraftModdingAPI.Blocks;
-
- namespace GamecraftModdingAPI.Inventory
- {
- [HarmonyPatch]
- public class HotbarSlotSelectionHandlerEnginePatch
- {
- private static int selectedBlockInt = 0;
-
- public static BlockIDs EquippedPartID { get => (BlockIDs)selectedBlockInt; }
-
- private static MethodInfo PatchedMethod { get; } = AccessTools.Method("Gamecraft.GUI.Hotbar.Blocks.SyncHotbarSlotSelectedToEquippedPartEngine:ActivateSlotForCube", parameters: new Type[] { typeof(uint), typeof(int) });
-
- public static void Prefix(uint playerID, int selectedDBPartID)
- {
- selectedBlockInt = selectedDBPartID;
- }
-
- public static MethodBase TargetMethod(Harmony harmonyInstance)
- {
- return PatchedMethod;
- }
- }
- }
|