static void Postfix(Pickupable __instance) { if (__instance.GetTechType().isGravTrap()) { HandReticle.main.interactText2 = GravTrapObjectsType.getFrom(__instance.gameObject).techTypeListName; } }
static void Pickupable_OnHandHover_Postfix(Pickupable __instance) { if (__instance.GetTechType().isGravTrap()) { HandReticle.main.setText(textHandSubscript: GravTrapObjectsType.getFrom(__instance.gameObject).techTypeListName); } }
static void Postfix(InventoryItem item, int button) { if (button == 2 && item.item.GetTechType().isGravTrap()) { GravTrapObjectsType.getFrom(item.item.gameObject).techTypeListIndex++; } }
public static void patch() { LanguageHelper.init(); PersistentConsoleCommands.register <ConsoleCommands>(); HarmonyHelper.patchAll(true); CraftHelper.patchAll(); GravTrapObjectsType.init(typesConfig); }
static void Postfix(StringBuilder sb, TechType techType, GameObject obj) { if (!techType.isGravTrap()) { return; } var objectsType = GravTrapObjectsType.getFrom(obj); objectsType.techTypeListIndex += TypeListSwitcher.getChangeListDir(); TooltipFactory.WriteDescription(sb, objectsType.techTypeListName); }
static void Postfix(GUIHand __instance) { if (!__instance.player.IsFreeToInteract() || !AvatarInputHandler.main.IsEnabled()) { return; } if (__instance.GetTool() is PlayerTool tool && tool.pickupable.GetTechType().isGravTrap()) { HandReticle.main.SetUseTextRaw(tool.GetCustomUseText(), GravTrapObjectsType.getFrom(tool.gameObject).techTypeListName); } }
public static void patch() { LanguageHelper.init(); HarmonyHelper.patchAll(); CraftHelper.patchAll(); if (config.mk2Enabled) { HarmonyHelper.patch(typeof(GravTrapMK2Patches)); } GravTrapObjectsType.init(Mod.loadConfig <TypesConfig>("types_config.json", Config.LoadOptions.ReadOnly)); }
static void Postfix(StringBuilder sb, TechType techType, GameObject obj) { if (!techType.isGravTrap()) { return; } if (Main.config.useWheelScroll && InputHelper.getMouseWheelValue() != 0f) // not exactly right to do it here, but I didn't find a better way { GravTrapObjectsType.getFrom(obj).techTypeListIndex += Math.Sign(InputHelper.getMouseWheelValue()); } TooltipFactory.WriteDescription(sb, GravTrapObjectsType.getFrom(obj).techTypeListName); }
static void GUIHand_OnUpdate_Postfix(GUIHand __instance) { if (!__instance.player.IsFreeToInteract() || !AvatarInputHandler.main.IsEnabled()) { return; } if (__instance.GetTool() is PlayerTool tool && tool.pickupable?.GetTechType().isGravTrap() == true) { HandReticle.main.setText(textUse: tool.GetCustomUseText(), textUseSubscript: GravTrapObjectsType.getFrom(tool.gameObject).techTypeListName); } }