From f9f3db7db03e969bde33f417d66f259a3d3e6006 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 24 Oct 2020 18:28:43 -0400 Subject: [PATCH] add character-customization-only shirts to item repo --- docs/release-notes.md | 3 +++ .../Framework/ItemRepository.cs | 21 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index d6b5df7a..86081c62 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -11,6 +11,9 @@ * For modders: * Fixed error when heuristically rewriting a property for a type that no longer exists. +* For the Console Commands mod: + * `player_add` can now spawn shirts normally only available during character customization. + ## 3.7.5 Released 16 October 2020 for Stardew Valley 1.4.1 or later. diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs index a96a842c..5884d28a 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs @@ -61,8 +61,25 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework yield return this.TryCreate(ItemType.Tool, this.CustomIDOffset + 3, _ => new Wand()); // clothing - foreach (int id in Game1.clothingInformation.Keys) - yield return this.TryCreate(ItemType.Clothing, id, p => new Clothing(p.ID)); + { + // items + HashSet clothingIds = new HashSet(); + foreach (int id in Game1.clothingInformation.Keys) + { + if (id < 0) + continue; // placeholder data for character customization clothing below + + clothingIds.Add(id); + yield return this.TryCreate(ItemType.Clothing, id, p => new Clothing(p.ID)); + } + + // character customization shirts (some shirts in this range have no data, but game has special logic to handle them) + for (int id = 1000; id <= 1111; id++) + { + if (!clothingIds.Contains(id)) + yield return this.TryCreate(ItemType.Clothing, id, p => new Clothing(p.ID)); + } + } // wallpapers for (int id = 0; id < 112; id++)