2020-04-02 13:50:30 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
|
|
|
|
using Svelto.ECS;
|
|
|
|
|
|
2020-05-03 19:31:09 +00:00
|
|
|
|
using HarmonyLib;
|
2020-04-02 13:50:30 +00:00
|
|
|
|
using GamecraftModdingAPI.Blocks;
|
|
|
|
|
|
|
|
|
|
namespace GamecraftModdingAPI.Inventory
|
|
|
|
|
{
|
|
|
|
|
[HarmonyPatch]
|
|
|
|
|
public class HotbarSlotSelectionHandlerEnginePatch
|
|
|
|
|
{
|
|
|
|
|
private static int selectedBlockInt = 0;
|
|
|
|
|
|
|
|
|
|
public static BlockIDs EquippedPartID { get => (BlockIDs)selectedBlockInt; }
|
|
|
|
|
|
2020-10-28 23:37:47 +00:00
|
|
|
|
private static MethodInfo PatchedMethod { get; } = AccessTools.Method("Gamecraft.GUI.Hotbar.Blocks.SyncHotbarSlotSelectedToEquipedPartEngine:ActivateSlotForCube", parameters: new Type[] { typeof(uint), typeof(int), typeof(ExclusiveGroupStruct) });
|
2020-04-02 13:50:30 +00:00
|
|
|
|
|
|
|
|
|
public static void Prefix(uint playerID, int selectedDBPartID, ExclusiveGroupStruct groupID)
|
|
|
|
|
{
|
|
|
|
|
selectedBlockInt = selectedDBPartID;
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-03 19:31:09 +00:00
|
|
|
|
public static MethodBase TargetMethod(Harmony harmonyInstance)
|
2020-04-02 13:50:30 +00:00
|
|
|
|
{
|
|
|
|
|
return PatchedMethod;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|