private void ChangePickupText(OnGenericNotification.orig_SetEquipment orig, RoR2.UI.GenericNotification self, EquipmentDef equipmentDef) { orig(self, equipmentDef); if (equipmentDef == instance.EquipmentDef) { var localUser = LocalUserManager.readOnlyLocalUsersList[0]; if (localUser != null && localUser.cachedMaster?.inventory) { var inventoryCount = localUser.cachedMaster.inventory.GetItemCount(Items.SpiceTally.instance.ItemDef); var index = Mathf.Min(inventoryCount, SpiceDescArray.Length - 1); self.descriptionText.token = SpiceDescArray[index]; } } }
internal void GenericNotification_SetEquipment(On.RoR2.UI.GenericNotification.orig_SetEquipment orig, RoR2.UI.GenericNotification self, EquipmentDef equipmentDef) { if (mod.config.MiscHidePickupNotificiationsEquipements.Value) { BetterUI.Destroy(self.gameObject); return; } orig(self, equipmentDef); self.descriptionText.token = equipmentDef.descriptionToken; }
internal void GenericNotification_SetArtifact(On.RoR2.UI.GenericNotification.orig_SetArtifact orig, RoR2.UI.GenericNotification self, ArtifactDef artifactDef) { if (mod.config.MiscHidePickupNotificiationsArtifacts.Value) { BetterUI.Destroy(self.gameObject); return; } orig(self, artifactDef); }
internal void GenericNotification_SetItem(On.RoR2.UI.GenericNotification.orig_SetItem orig, RoR2.UI.GenericNotification self, ItemDef itemDef) { if (mod.config.MiscHidePickupNotificiationsItems.Value) { BetterUI.Destroy(self.gameObject); return; } orig(self, itemDef); self.descriptionText.token = itemDef.descriptionToken; }
public static void ItemPickupTooltipHandler(GenericNotification.orig_Update orig, RoR2.UI.GenericNotification self) { orig(self); self.gameObject.SetActive(HoverConfiguration.ShowPickup.Value); if (self.transform.GetChild(0)) { var image = self.transform.GetChild(0).GetComponent <Image>(); var color = image.color; color.a = (float)HoverConfiguration.PickupOpacity.Value / 100; color.r = (float)HoverConfiguration.PickupBackgroundRed.Value / 255; color.g = (float)HoverConfiguration.PickupBackgroundGreen.Value / 255; color.b = (float)HoverConfiguration.PickupBackgroundBlue.Value / 255; self.transform.GetChild(0).GetComponent <Image>().color = color; } }
private void GenericNotification_SetItem(On.RoR2.UI.GenericNotification.orig_SetItem orig, RoR2.UI.GenericNotification self, ItemDef itemDef) { orig(self, itemDef); //if (itemDef == ItemCatalog.GetItemDef(catalogIndex)) //self.titleTMP.color = lunarColor32; }