Beispiel #1
0
        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;
        }
Beispiel #2
0
        private void GenericNotification_SetItem(On.RoR2.UI.GenericNotification.orig_SetItem orig, GenericNotification self, ItemDef itemDef)
        {
            if (itemDef.itemIndex != catalogIndex)
            {
                orig(self, itemDef);
                return;
            }
            var clearCount = Run.instance.stageClearCount;
            var StageCount = Mathf.Max(clearCount + 1, 1);

            string numberString      = HelperUtil.NumbertoOrdinal(StageCount);
            string numberCapitalized = char.ToUpper(numberString[0]) + numberString.Substring(1);
            string descString        = adjustedDesc[Mathf.Clamp(StageCount, 0, adjustedDesc.Length - 1)];

            //https://www.dotnetperls.com/uppercase-first-letter

            //string output2 = numberCapitalized + " Chamber" +
            //"\nThis " + descString + " artifact indicates mastery of the " + numberString + " chamber."; TODO: REMOVE WHEN KNOW IT WORKS
            string output = string.Format(itemPickupDescToken, numberCapitalized, descString, numberString);

            if (bannedStages.Contains(SceneCatalog.mostRecentSceneDef.baseSceneName))
            {
                output = itemPickupDescBannedToken;
            }

            self.titleText.token       = itemDef.nameToken;
            self.titleTMP.color        = ColorCatalog.GetColor(itemDef.colorIndex);
            self.descriptionText.token = output;

            if (itemDef.pickupIconSprite != null)
            {
                self.iconImage.texture = itemDef.pickupIconTexture;
                //var index = Mathf.Max(clearCount, textures.Count-1);
                //self.iconImage.texture = Resources.Load<Texture>(filePaths[index]);
                //self.iconImage.texture = textures[index];
            }
        }
 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;
 }