public static void Postfix(GearItem __result, GearItem gearToAdd) { if (__result != null && Implementation.IsPreferredStruggleWeapon(gearToAdd)) { Implementation.TogglePreferredStruggleWeapon(__result); } }
public static bool Prefix(ItemDescriptionPage __instance) { var panelInventory = InterfaceManager.m_Panel_Inventory; var gearItem = (GearItem)AccessTools.Method(panelInventory.GetType(), "GetCurrentlySelectedGearItem").Invoke(panelInventory, null); if (!Implementation.IsStruggleWeapon(gearItem)) { return(true); } Implementation.TogglePreferredStruggleWeapon(gearItem); InterfaceManager.m_Panel_Inventory.RefreshTable(); return(false); }