46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
using Omegasis.BillboardAnywhere.Framework;
|
|
using StardewModdingAPI;
|
|
using StardewModdingAPI.Events;
|
|
using StardewValley;
|
|
using StardewValley.Menus;
|
|
|
|
namespace Omegasis.BillboardAnywhere
|
|
{
|
|
/// <summary>The mod entry point.</summary>
|
|
public class BillboardAnywhere : Mod
|
|
{
|
|
/*********
|
|
** Properties
|
|
*********/
|
|
/// <summary>The mod configuration.</summary>
|
|
private ModConfig Config;
|
|
|
|
|
|
/*********
|
|
** Public methods
|
|
*********/
|
|
/// <summary>The mod entry point, called after the mod is first loaded.</summary>
|
|
/// <param name="helper">Provides simplified APIs for writing mods.</param>
|
|
public override void Entry(IModHelper helper)
|
|
{
|
|
this.Config = helper.ReadConfig<ModConfig>();
|
|
|
|
helper.Events.Input.ButtonPressed += this.OnButtonPressed;
|
|
}
|
|
|
|
|
|
/*********
|
|
** Private methods
|
|
*********/
|
|
/// <summary>Raised after the player presses a button on the keyboard, controller, or mouse.</summary>
|
|
/// <param name="sender">The event sender.</param>
|
|
/// <param name="e">The event arguments.</param>
|
|
public void OnButtonPressed(object sender, ButtonPressedEventArgs e)
|
|
{
|
|
// load menu if key pressed
|
|
if (Context.IsPlayerFree && e.Button == this.Config.KeyBinding)
|
|
Game1.activeClickableMenu = new Billboard();
|
|
}
|
|
}
|
|
}
|