diff --git a/src/SMAPI/Framework/RewriteFacades/DialogueBoxMethods.cs b/src/SMAPI/Framework/RewriteFacades/DialogueBoxMethods.cs new file mode 100644 index 00000000..9d6727ae --- /dev/null +++ b/src/SMAPI/Framework/RewriteFacades/DialogueBoxMethods.cs @@ -0,0 +1,12 @@ +using StardewValley.Menus; + +namespace StardewModdingAPI.Framework.RewriteFacades +{ + public class DialogueBoxMethods : DialogueBox + { + public DialogueBoxMethods(string dialogue) + : base(dialogue) + { + } + } +} diff --git a/src/SMAPI/Framework/RewriteFacades/InventoryMenuMethods.cs b/src/SMAPI/Framework/RewriteFacades/InventoryMenuMethods.cs index f9bb75e7..9c4b37b6 100644 --- a/src/SMAPI/Framework/RewriteFacades/InventoryMenuMethods.cs +++ b/src/SMAPI/Framework/RewriteFacades/InventoryMenuMethods.cs @@ -18,5 +18,51 @@ namespace StardewModdingAPI.Framework.RewriteFacades { return base.rightClick(x, y, toAddTo, playSound); } + + public List GetBorder(BorderSide side) + { + List clickableComponentList = new List(); + int num = this.capacity / this.rows; + switch (side) + { + case BorderSide.Top: + for (int index = 0; index < this.inventory.Count; ++index) + { + if (index < num) + clickableComponentList.Add(this.inventory[index]); + } + break; + case BorderSide.Left: + for (int index = 0; index < this.inventory.Count; ++index) + { + if (index % num == 0) + clickableComponentList.Add(this.inventory[index]); + } + break; + case BorderSide.Right: + for (int index = 0; index < this.inventory.Count; ++index) + { + if (index % num == num - 1) + clickableComponentList.Add(this.inventory[index]); + } + break; + case BorderSide.Bottom: + for (int index = 0; index < this.inventory.Count; ++index) + { + if (index >= this.actualInventory.Count - num) + clickableComponentList.Add(this.inventory[index]); + } + break; + } + return clickableComponentList; + } + + public enum BorderSide + { + Top, + Left, + Right, + Bottom, + } } } diff --git a/src/SMAPI/Framework/RewriteFacades/ShopMenuMethods.cs b/src/SMAPI/Framework/RewriteFacades/ShopMenuMethods.cs index d5970b89..4beca4c8 100644 --- a/src/SMAPI/Framework/RewriteFacades/ShopMenuMethods.cs +++ b/src/SMAPI/Framework/RewriteFacades/ShopMenuMethods.cs @@ -63,6 +63,18 @@ namespace StardewModdingAPI.Framework.RewriteFacades typeof(ShopMenu).GetField("categoriesToSellHere", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).SetValue(this, value); } } + public Dictionary ItemPriceAndStockProp + { + get + { + return (Dictionary)typeof(ShopMenu).GetField("itemPriceAndStock", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).GetValue(this); + } + set + { + typeof(ShopMenu).GetField("itemPriceAndStock", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).SetValue(this, value); + } + } + public ShopMenuMethods(Dictionary itemPriceAndStock, int currency = 0, string who = null, Func on_purchase = null, Func on_sell = null, string context = null) : base(itemPriceAndStock, currency, who, on_purchase, on_sell, context) { }