Skip to content

Instantly share code, notes, and snippets.

@d235j
Created December 3, 2019 02:47
Show Gist options
  • Save d235j/c6428fd53610c585827c28e71e9339dc to your computer and use it in GitHub Desktop.
Save d235j/c6428fd53610c585827c28e71e9339dc to your computer and use it in GitHub Desktop.
diff --git a/CustomFurniture/CustomFurnitureMod.cs b/CustomFurniture/CustomFurnitureMod.cs
index b36f28c..74cfbf4 100644
--- a/CustomFurniture/CustomFurnitureMod.cs
+++ b/CustomFurniture/CustomFurnitureMod.cs
@@ -75,8 +75,8 @@ namespace CustomFurniture
if (param[0] == "shop" && Game1.activeClickableMenu is ShopMenu shop)
{
- Dictionary<Item, int[]> items = Helper.Reflection.GetField<Dictionary<Item, int[]>>(shop, "itemPriceAndStock").GetValue();
- List<Item> selling = Helper.Reflection.GetField<List<Item>>(shop, "forSale").GetValue();
+ Dictionary<ISalable, int[]> items = Helper.Reflection.GetField<Dictionary<ISalable, int[]>>(shop, "itemPriceAndStock").GetValue();
+ List<ISalable> selling = Helper.Reflection.GetField<List<ISalable>>(shop, "forSale").GetValue();
List<Item> remove = new List<Item>();
List<Item> additions = new List<Item>();
@@ -175,8 +175,8 @@ namespace CustomFurniture
if (Game1.activeClickableMenu is ShopMenu)
{
ShopMenu shop = (ShopMenu)Game1.activeClickableMenu;
- Dictionary<Item, int[]> items = Helper.Reflection.GetField<Dictionary<Item, int[]>>(shop, "itemPriceAndStock").GetValue();
- List<Item> selling = Helper.Reflection.GetField<List<Item>>(shop, "forSale").GetValue();
+ Dictionary<ISalable, int[]> items = Helper.Reflection.GetField<Dictionary<ISalable, int[]>>(shop, "itemPriceAndStock").GetValue();
+ List<ISalable> selling = Helper.Reflection.GetField<List<ISalable>>(shop, "forSale").GetValue();
int currency = Helper.Reflection.GetField<int>(shop, "currency").GetValue();
bool isCatalogue = (currency == 0 && selling.Count > 0 && selling[0] is Furniture);
string shopkeeper = "Robin";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment