2016-03-04 22:05:36 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace StardewModdingAPI.Events
|
|
|
|
|
{
|
|
|
|
|
public static class TimeEvents
|
|
|
|
|
{
|
|
|
|
|
public static event EventHandler<EventArgsIntChanged> TimeOfDayChanged = delegate { };
|
|
|
|
|
public static event EventHandler<EventArgsIntChanged> DayOfMonthChanged = delegate { };
|
|
|
|
|
public static event EventHandler<EventArgsIntChanged> YearOfGameChanged = delegate { };
|
|
|
|
|
public static event EventHandler<EventArgsStringChanged> SeasonOfYearChanged = delegate { };
|
2016-03-27 18:40:09 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs when Game1.newDay changes. True directly before saving, and False directly after.
|
|
|
|
|
/// </summary>
|
2016-03-27 17:05:36 +08:00
|
|
|
|
public static event EventHandler<EventArgsNewDay> OnNewDay = delegate { };
|
2016-03-04 22:05:36 +08:00
|
|
|
|
|
2016-03-27 17:05:36 +08:00
|
|
|
|
internal static void InvokeTimeOfDayChanged(int priorInt, int newInt)
|
2016-03-04 22:05:36 +08:00
|
|
|
|
{
|
|
|
|
|
TimeOfDayChanged.Invoke(null, new EventArgsIntChanged(priorInt, newInt));
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-27 17:05:36 +08:00
|
|
|
|
internal static void InvokeDayOfMonthChanged(int priorInt, int newInt)
|
2016-03-04 22:05:36 +08:00
|
|
|
|
{
|
|
|
|
|
DayOfMonthChanged.Invoke(null, new EventArgsIntChanged(priorInt, newInt));
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-27 17:05:36 +08:00
|
|
|
|
internal static void InvokeYearOfGameChanged(int priorInt, int newInt)
|
2016-03-04 22:05:36 +08:00
|
|
|
|
{
|
|
|
|
|
YearOfGameChanged.Invoke(null, new EventArgsIntChanged(priorInt, newInt));
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-27 17:05:36 +08:00
|
|
|
|
internal static void InvokeSeasonOfYearChanged(string priorString, string newString)
|
2016-03-04 22:05:36 +08:00
|
|
|
|
{
|
|
|
|
|
SeasonOfYearChanged.Invoke(null, new EventArgsStringChanged(priorString, newString));
|
|
|
|
|
}
|
2016-03-27 15:52:43 +08:00
|
|
|
|
|
2016-03-27 17:05:36 +08:00
|
|
|
|
internal static void InvokeOnNewDay(int priorInt, int newInt, bool newDay)
|
2016-03-27 15:52:43 +08:00
|
|
|
|
{
|
2016-03-27 17:05:36 +08:00
|
|
|
|
OnNewDay.Invoke(null, new EventArgsNewDay(priorInt, newInt, newDay));
|
2016-03-27 15:52:43 +08:00
|
|
|
|
}
|
2016-03-04 22:05:36 +08:00
|
|
|
|
}
|
2016-03-27 13:09:09 +08:00
|
|
|
|
}
|