summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-08-06 22:23:18 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-08-06 22:23:18 -0400
commit8df5d79c9e01c2d665192ba5accfcd45a47e2dda (patch)
tree5b09b558d9d395d396058431fb8a77d8b846f206
parenta1a93ac4bf20458d49028ed40905e715aa1ae152 (diff)
downloadSMAPI-8df5d79c9e01c2d665192ba5accfcd45a47e2dda.tar.gz
SMAPI-8df5d79c9e01c2d665192ba5accfcd45a47e2dda.tar.bz2
SMAPI-8df5d79c9e01c2d665192ba5accfcd45a47e2dda.zip
fix ConsoleCommands item search code
-rw-r--r--docs/release-notes.md2
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/ItemType.cs5
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs29
3 files changed, 16 insertions, 20 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 42bd7975..691bf48e 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -2,6 +2,8 @@
## 2.6.1
* For players:
* Fixed custom festival maps always using spring tilesheets.
+ * Fixed `player_add` command not recognising return scepter.
+ * Fixed `player_add` showing fish twice.
* For modders:
* Fixed false compatibility error when constructing multidimensional arrays.
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/ItemType.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/ItemType.cs
index 797d4650..7ee662d0 100644
--- a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/ItemType.cs
+++ b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemData/ItemType.cs
@@ -1,4 +1,4 @@
-namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.ItemData
+namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.ItemData
{
/// <summary>An item type that can be searched and added to the player through the console.</summary>
internal enum ItemType
@@ -9,9 +9,6 @@
/// <summary>A <see cref="Boots"/> item.</summary>
Boots,
- /// <summary>A fish item.</summary>
- Fish,
-
/// <summary>A <see cref="Wallpaper"/> flooring item.</summary>
Flooring,
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs
index e678d057..7a3d8694 100644
--- a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs
+++ b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs
@@ -37,14 +37,15 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
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 + 2, new Pan());
+ yield return new SearchableItem(ItemType.Tool, this.CustomIDOffset + 3, new Wand());
// wallpapers
for (int id = 0; id < 112; id++)
- yield return new SearchableItem(ItemType.Wallpaper, id, new Wallpaper(id));
+ yield return new SearchableItem(ItemType.Wallpaper, id, new Wallpaper(id) { Category = SObject.furnitureCategory });
// flooring
for (int id = 0; id < 40; id++)
- yield return new SearchableItem(ItemType.Flooring, id, new Wallpaper(id, isFloor: true));
+ yield return new SearchableItem(ItemType.Flooring, id, new Wallpaper(id, isFloor: true) { Category = SObject.furnitureCategory });
// equipment
foreach (int id in Game1.content.Load<Dictionary<int, string>>("Data\\Boots").Keys)
@@ -75,10 +76,6 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
yield return new SearchableItem(ItemType.Furniture, id, new Furniture(id, Vector2.Zero));
}
- // fish
- foreach (int id in Game1.content.Load<Dictionary<int, string>>("Data\\Fish").Keys)
- yield return new SearchableItem(ItemType.Fish, id, new SObject(id, 999));
-
// craftables
foreach (int id in Game1.bigCraftablesInformation.Keys)
yield return new SearchableItem(ItemType.BigCraftable, id, new SObject(Vector2.Zero, id));
@@ -103,16 +100,16 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
yield return new SearchableItem(ItemType.Object, id, item);
// fruit products
- if (item.category == SObject.FruitsCategory)
+ if (item.Category == SObject.FruitsCategory)
{
// wine
SObject wine = new SObject(348, 1)
{
Name = $"{item.Name} Wine",
- Price = item.price * 3
+ Price = item.Price * 3
};
wine.preserve.Value = SObject.PreserveType.Wine;
- wine.preservedParentSheetIndex.Value = item.parentSheetIndex;
+ wine.preservedParentSheetIndex.Value = item.ParentSheetIndex;
yield return new SearchableItem(ItemType.Object, this.CustomIDOffset * 2 + id, wine);
// jelly
@@ -122,21 +119,21 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
Price = 50 + item.Price * 2
};
jelly.preserve.Value = SObject.PreserveType.Jelly;
- jelly.preservedParentSheetIndex.Value = item.parentSheetIndex;
+ jelly.preservedParentSheetIndex.Value = item.ParentSheetIndex;
yield return new SearchableItem(ItemType.Object, this.CustomIDOffset * 3 + id, jelly);
}
// vegetable products
- else if (item.category == SObject.VegetableCategory)
+ else if (item.Category == SObject.VegetableCategory)
{
// juice
SObject juice = new SObject(350, 1)
{
Name = $"{item.Name} Juice",
- Price = (int)(item.price * 2.25d)
+ Price = (int)(item.Price * 2.25d)
};
juice.preserve.Value = SObject.PreserveType.Juice;
- juice.preservedParentSheetIndex.Value = item.parentSheetIndex;
+ juice.preservedParentSheetIndex.Value = item.ParentSheetIndex;
yield return new SearchableItem(ItemType.Object, this.CustomIDOffset * 4 + id, juice);
// pickled
@@ -146,16 +143,16 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework
Price = 50 + item.Price * 2
};
pickled.preserve.Value = SObject.PreserveType.Pickle;
- pickled.preservedParentSheetIndex.Value = item.parentSheetIndex;
+ pickled.preservedParentSheetIndex.Value = item.ParentSheetIndex;
yield return new SearchableItem(ItemType.Object, this.CustomIDOffset * 5 + id, pickled);
}
// flower honey
- else if (item.category == SObject.flowersCategory)
+ else if (item.Category == SObject.flowersCategory)
{
// get honey type
SObject.HoneyType? type = null;
- switch (item.parentSheetIndex)
+ switch (item.ParentSheetIndex)
{
case 376:
type = SObject.HoneyType.Poppy;