using System.Collections.Generic;
using Microsoft.Xna.Framework;
using StardewModdingAPI;
using StardewValley;
using StardewValley.Menus;
namespace Omegasis.SaveAnywhere
{
/// A subclass of that does everything except save.
internal class NewShippingMenu : ShippingMenu
{
/*********
** Properties
*********/
/// The private field on the shipping menu which indicates the game has already been saved, which prevents it from saving.
private readonly IPrivateField SavedYet;
/*********
** Public methods
*********/
/// Construct an instance.
/// The shipping bin items.
/// Simplifies access to game code.
public NewShippingMenu(List- items, IReflectionHelper reflection)
: base(items)
{
this.SavedYet = reflection.GetPrivateField(this, "savedYet");
}
/// Updates the menu during the game's update loop.
/// The game time that has passed.
public override void update(GameTime time)
{
this.SavedYet.SetValue(true); // prevent menu from saving
base.update(time);
}
}
}