fix Console Commands' handling of tool upgrade levels for item commands

This commit is contained in:
Jesse Plamondon-Willard 2018-11-25 13:12:57 -05:00
parent 3b5cfad213
commit cbd63b9a87
No known key found for this signature in database
GPG Key ID: 7D7C8097B62033CE
2 changed files with 6 additions and 9 deletions

View File

@ -2,6 +2,7 @@
## Upcoming ## Upcoming
* For players: * For players:
* Fixed cryptic error when running the installer from inside a zip file on Windows. * Fixed cryptic error when running the installer from inside a zip file on Windows.
* Fixed Console Commands' handling of tool upgrade levels for item commands.
* For modders: * For modders:
* Reloading a map asset will now automatically update affected locations. * Reloading a map asset will now automatically update affected locations.

View File

@ -25,15 +25,11 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
public IEnumerable<SearchableItem> GetAll() public IEnumerable<SearchableItem> GetAll()
{ {
// get tools // get tools
for (int quality = Tool.stone; quality <= Tool.iridium; quality++) yield return new SearchableItem(ItemType.Tool, ToolFactory.axe, ToolFactory.getToolFromDescription(ToolFactory.axe, 0));
{ yield return new SearchableItem(ItemType.Tool, ToolFactory.hoe, ToolFactory.getToolFromDescription(ToolFactory.hoe, 0));
yield return new SearchableItem(ItemType.Tool, ToolFactory.axe, ToolFactory.getToolFromDescription(ToolFactory.axe, quality)); yield return new SearchableItem(ItemType.Tool, ToolFactory.pickAxe, ToolFactory.getToolFromDescription(ToolFactory.pickAxe, 0));
yield return new SearchableItem(ItemType.Tool, ToolFactory.hoe, ToolFactory.getToolFromDescription(ToolFactory.hoe, quality)); yield return new SearchableItem(ItemType.Tool, ToolFactory.wateringCan, ToolFactory.getToolFromDescription(ToolFactory.wateringCan, 0));
yield return new SearchableItem(ItemType.Tool, ToolFactory.pickAxe, ToolFactory.getToolFromDescription(ToolFactory.pickAxe, quality)); yield return new SearchableItem(ItemType.Tool, ToolFactory.fishingRod, ToolFactory.getToolFromDescription(ToolFactory.fishingRod, 0));
yield return new SearchableItem(ItemType.Tool, ToolFactory.wateringCan, ToolFactory.getToolFromDescription(ToolFactory.wateringCan, quality));
if (quality != Tool.iridium)
yield return new SearchableItem(ItemType.Tool, ToolFactory.fishingRod, ToolFactory.getToolFromDescription(ToolFactory.fishingRod, quality));
}
yield return new SearchableItem(ItemType.Tool, this.CustomIDOffset, new MilkPail()); // these don't have any sort of ID, so we'll just assign some arbitrary ones yield return new SearchableItem(ItemType.Tool, this.CustomIDOffset, new MilkPail()); // these don't have any sort of ID, so we'll just assign some arbitrary ones
yield return new SearchableItem(ItemType.Tool, this.CustomIDOffset + 1, new Shears()); yield return new SearchableItem(ItemType.Tool, this.CustomIDOffset + 1, new Shears());
yield return new SearchableItem(ItemType.Tool, this.CustomIDOffset + 2, new Pan()); yield return new SearchableItem(ItemType.Tool, this.CustomIDOffset + 2, new Pan());