A stable modding interface between Techblox and mods https://mod.exmods.org/
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

33 рядки
937B

  1. using System;
  2. using System.Reflection;
  3. using RobocraftX.GUI;
  4. using RobocraftX.GUI.Hotbar;
  5. using Svelto.ECS;
  6. using HarmonyLib;
  7. using GamecraftModdingAPI.Blocks;
  8. namespace GamecraftModdingAPI.Inventory
  9. {
  10. [HarmonyPatch]
  11. public class HotbarSlotSelectionHandlerEnginePatch
  12. {
  13. private static int selectedBlockInt = 0;
  14. public static BlockIDs EquippedPartID { get => (BlockIDs)selectedBlockInt; }
  15. private static MethodInfo PatchedMethod { get; } = AccessTools.Method(AccessTools.TypeByName("RobocraftX.GUI.Hotbar.HotbarSlotSelectionHandlerEngine"), "ActivateSlotForCube", parameters: new Type[] { typeof(uint), typeof(int), typeof(ExclusiveGroupStruct) });
  16. public static void Prefix(uint playerID, int selectedDBPartID, ExclusiveGroupStruct groupID)
  17. {
  18. selectedBlockInt = selectedDBPartID;
  19. }
  20. public static MethodBase TargetMethod(Harmony harmonyInstance)
  21. {
  22. return PatchedMethod;
  23. }
  24. }
  25. }