1.More rewrites.
2,Give detailed message when mod's assemblies can't load.
This commit is contained in:
parent
e5fb317220
commit
e753f87626
|
@ -0,0 +1,12 @@
|
|||
using StardewValley.Menus;
|
||||
|
||||
namespace StardewModdingAPI.Framework.RewriteFacades
|
||||
{
|
||||
public class DialogueBoxMethods : DialogueBox
|
||||
{
|
||||
public DialogueBoxMethods(string dialogue)
|
||||
: base(dialogue)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,5 +18,51 @@ namespace StardewModdingAPI.Framework.RewriteFacades
|
|||
{
|
||||
return base.rightClick(x, y, toAddTo, playSound);
|
||||
}
|
||||
|
||||
public List<ClickableComponent> GetBorder(BorderSide side)
|
||||
{
|
||||
List<ClickableComponent> clickableComponentList = new List<ClickableComponent>();
|
||||
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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,6 +63,18 @@ namespace StardewModdingAPI.Framework.RewriteFacades
|
|||
typeof(ShopMenu).GetField("categoriesToSellHere", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).SetValue(this, value);
|
||||
}
|
||||
}
|
||||
public Dictionary<ISalable, int[]> ItemPriceAndStockProp
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Dictionary<ISalable, int[]>)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<ISalable, int[]> itemPriceAndStock, int currency = 0, string who = null, Func<ISalable, Farmer, int, bool> on_purchase = null, Func<ISalable, bool> on_sell = null, string context = null) : base(itemPriceAndStock, currency, who, on_purchase, on_sell, context)
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue