2017-08-06 03:51:44 +08:00
|
|
|
|
using Omegasis.BillboardAnywhere.Framework;
|
2017-07-28 08:28:39 +08:00
|
|
|
|
using StardewModdingAPI;
|
2017-07-30 01:54:26 +08:00
|
|
|
|
using StardewModdingAPI.Events;
|
2017-07-28 08:28:39 +08:00
|
|
|
|
using StardewValley;
|
2017-07-30 01:54:26 +08:00
|
|
|
|
using StardewValley.Menus;
|
2017-07-28 08:28:39 +08:00
|
|
|
|
|
|
|
|
|
namespace Omegasis.BillboardAnywhere
|
2016-10-20 15:15:14 +08:00
|
|
|
|
{
|
2017-07-30 01:54:26 +08:00
|
|
|
|
/// <summary>The mod entry point.</summary>
|
|
|
|
|
public class BillboardAnywhere : Mod
|
2016-10-20 15:15:14 +08:00
|
|
|
|
{
|
2017-07-30 01:54:26 +08:00
|
|
|
|
/*********
|
|
|
|
|
** Properties
|
|
|
|
|
*********/
|
2017-08-06 03:51:44 +08:00
|
|
|
|
/// <summary>The mod configuration.</summary>
|
|
|
|
|
private ModConfig Config;
|
2016-10-20 15:15:14 +08:00
|
|
|
|
|
2017-07-30 01:54:26 +08:00
|
|
|
|
|
|
|
|
|
/*********
|
|
|
|
|
** 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>
|
2016-12-09 08:34:28 +08:00
|
|
|
|
public override void Entry(IModHelper helper)
|
2016-10-20 15:15:14 +08:00
|
|
|
|
{
|
2017-08-06 03:51:44 +08:00
|
|
|
|
this.Config = helper.ReadConfig<ModConfig>();
|
|
|
|
|
|
2017-07-30 01:54:26 +08:00
|
|
|
|
ControlEvents.KeyPressed += this.ControlEvents_KeyPressed;
|
2016-10-20 15:15:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-30 01:54:26 +08:00
|
|
|
|
|
|
|
|
|
/*********
|
|
|
|
|
** Private methods
|
|
|
|
|
*********/
|
|
|
|
|
/// <summary>The method invoked when the presses a keyboard button.</summary>
|
|
|
|
|
/// <param name="sender">The event sender.</param>
|
|
|
|
|
/// <param name="e">The event data.</param>
|
|
|
|
|
public void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
|
2016-10-20 15:15:14 +08:00
|
|
|
|
{
|
2017-07-30 01:54:26 +08:00
|
|
|
|
// load menu if key pressed
|
2017-08-06 03:51:44 +08:00
|
|
|
|
if (Context.IsPlayerFree && e.KeyPressed.ToString() == this.Config.KeyBinding)
|
2017-07-30 01:54:26 +08:00
|
|
|
|
Game1.activeClickableMenu = new Billboard();
|
2016-10-20 15:15:14 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|