/// <summary> /// Finishes the item setup, adds it to the item databases, adds an encounter trackable /// blah, blah, blah /// </summary> public static void SetupItem(PickupObject item, string shortDesc, string longDesc, string idPool) { try { item.encounterTrackable = null; ETGMod.Databases.Items.SetupItem(item, item.name); SpriteBuilder.AddToAmmonomicon(item.sprite.GetCurrentSpriteDef()); item.encounterTrackable.journalData.AmmonomiconSprite = item.sprite.GetCurrentSpriteDef().name; item.SetName(item.name); item.SetShortDescription(shortDesc); item.SetLongDescription(longDesc); if (item is PlayerItem) { (item as PlayerItem).consumable = false; } Gungeon.Game.Items.Add(idPool + ":" + item.name.ToLower().Replace(" ", "_"), item); ETGMod.Databases.Items.Add(item); } catch (Exception e) { ETGModConsole.Log(e.Message); ETGModConsole.Log(e.StackTrace); } }
// Token: 0x06000024 RID: 36 RVA: 0x00002EE8 File Offset: 0x000010E8 public static void SetupItem(this PickupObject item, string shortDesc, string longDesc, string idPool = "customItems") { try { item.encounterTrackable = null; ETGMod.Databases.Items.SetupItem(item, item.name); SpriteBuilder.AddToAmmonomicon(item.sprite.GetCurrentSpriteDef()); item.encounterTrackable.journalData.AmmonomiconSprite = item.sprite.GetCurrentSpriteDef().name; GunExt.SetName(item, item.name); GunExt.SetShortDescription(item, shortDesc); GunExt.SetLongDescription(item, longDesc); bool flag = item is PlayerItem; if (flag) { (item as PlayerItem).consumable = false; } Game.Items.Add(idPool + ":" + item.name.ToLower().Replace(" ", "_"), item); ETGMod.Databases.Items.Add(item, false, "ANY"); FakePrefab.MarkAsFakePrefab(item.gameObject); item.gameObject.SetActive(false); } catch (Exception ex) { ETGModConsole.Log(ex.Message, false); ETGModConsole.Log(ex.StackTrace, false); } }