using Omegasis.BuyBackCollectables.Framework; using StardewModdingAPI; using StardewModdingAPI.Events; using StardewValley; namespace Omegasis.BuyBackCollectables { /// The mod entry point. public class BuyBackCollectables : Mod { /********* ** Properties *********/ /// 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(); ControlEvents.KeyPressed += this.ControlEvents_KeyPressed; } /********* ** Private methods *********/ /// The method invoked when the presses a keyboard button. /// The event sender. /// The event data. public void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e) { if (Context.IsPlayerFree && e.KeyPressed.ToString() == this.Config.KeyBinding) Game1.activeClickableMenu = new BuyBackMenu(this.Config.CostMultiplier); } } }