public static void Postfix(GearItem __result, GearItem gearToAdd)
 {
     if (__result != null && Implementation.IsPreferredStruggleWeapon(gearToAdd))
     {
         Implementation.TogglePreferredStruggleWeapon(__result);
     }
 }
        public static bool Prefix(ItemDescriptionPage __instance, GearItem gi)
        {
            var uiLocalize = __instance.m_FavoriteLabel.GetComponent <UILocalize>();

            if (Implementation.IsStruggleWeapon(gi))
            {
                bool isPreferredStruggleWeapon = Implementation.IsPreferredStruggleWeapon(gi);

                Utils.SetActive(__instance.m_FavoriteObject, true);
                Utils.SetActive(__instance.m_FavoriteCheckmark, isPreferredStruggleWeapon);
                __instance.m_FavoriteLabel.color = isPreferredStruggleWeapon ? __instance.m_FavoriteLabelColorChecked : __instance.m_FavoriteLabelColorUnchecked;
                __instance.m_FavoriteLabel.text  = Localization.Get("GAMEPLAY_PreferredStruggleWeapon");

                if (uiLocalize)
                {
                    uiLocalize.enabled = false;
                }

                return(false);
            }

            if (uiLocalize && !uiLocalize.enabled)
            {
                uiLocalize.enabled = true;
                __instance.m_FavoriteLabel.text = Localization.Get(uiLocalize.key);
            }

            return(true);
        }