using Omegasis.BuyBackCollectables.Framework;
using StardewModdingAPI;
using StardewModdingAPI.Events;
using StardewValley;
namespace Omegasis.BuyBackCollectables
{
/// The mod entry point.
public class BuyBackCollectables : Mod
{
/*********
** Fields
*********/
/// The mod configuration.
private ModConfig Config;
/*********
** Public methods
*********/
/// The mod entry point, called after the mod is first loaded.
/// Provides simplified APIs for writing mods.
public override void Entry(IModHelper helper)
{
this.Config = helper.ReadConfig();
helper.Events.Input.ButtonPressed += this.OnButtonPressed;
}
/*********
** Private methods
*********/
/// Raised after the player presses a button on the keyboard, controller, or mouse.
/// The event sender.
/// The event arguments.
private void OnButtonPressed(object sender, ButtonPressedEventArgs e)
{
if (Context.IsPlayerFree && e.Button == this.Config.KeyBinding)
Game1.activeClickableMenu = new BuyBackMenu(this.Config.CostMultiplier);
}
}
}