summaryrefslogtreecommitdiff
path: root/StardewModdingAPI/Events
diff options
context:
space:
mode:
authorClxS <slxxls92@gmail.com>2016-03-04 20:40:46 +0000
committerClxS <slxxls92@gmail.com>2016-03-04 20:40:46 +0000
commitb8a9f8fc88706896c3191b80d17375a483183226 (patch)
tree3ebc1fb20daa09105c9e22d2c32685f74271af06 /StardewModdingAPI/Events
parent4712da9f2d382e4593966530145140f33c7673bf (diff)
downloadSMAPI-b8a9f8fc88706896c3191b80d17375a483183226.tar.gz
SMAPI-b8a9f8fc88706896c3191b80d17375a483183226.tar.bz2
SMAPI-b8a9f8fc88706896c3191b80d17375a483183226.zip
Added event handlers for each of the level up events
Diffstat (limited to 'StardewModdingAPI/Events')
-rw-r--r--StardewModdingAPI/Events/EventArgs.cs20
-rw-r--r--StardewModdingAPI/Events/Player.cs6
2 files changed, 26 insertions, 0 deletions
diff --git a/StardewModdingAPI/Events/EventArgs.cs b/StardewModdingAPI/Events/EventArgs.cs
index 7f2e28c7..66d057a7 100644
--- a/StardewModdingAPI/Events/EventArgs.cs
+++ b/StardewModdingAPI/Events/EventArgs.cs
@@ -108,6 +108,26 @@ namespace StardewModdingAPI.Events
public List<ItemStackChange> QuantityChanged { get; private set; }
}
+ public class EventArgsLevelUp : EventArgs
+ {
+ public enum LevelType
+ {
+ Combat,
+ Farming,
+ Fishing,
+ Foraging,
+ Mining,
+ Luck
+ }
+ public EventArgsLevelUp(LevelType type, Int32 newLevel)
+ {
+ Type = type;
+ NewLevel = newLevel;
+ }
+ public LevelType Type { get; private set; }
+ public Int32 NewLevel { get; private set; }
+ }
+
public class EventArgsIntChanged : EventArgs
{
public EventArgsIntChanged(Int32 priorInt, Int32 newInt)
diff --git a/StardewModdingAPI/Events/Player.cs b/StardewModdingAPI/Events/Player.cs
index 47d21f63..f0547f87 100644
--- a/StardewModdingAPI/Events/Player.cs
+++ b/StardewModdingAPI/Events/Player.cs
@@ -12,6 +12,7 @@ namespace StardewModdingAPI.Events
{
public static event EventHandler<EventArgsFarmerChanged> FarmerChanged = delegate { };
public static event EventHandler<EventArgsInventoryChanged> InventoryChanged = delegate { };
+ public static event EventHandler<EventArgsLevelUp> LeveledUp = delegate { };
public static void InvokeFarmerChanged(Farmer priorFarmer, Farmer newFarmer)
{
@@ -22,5 +23,10 @@ namespace StardewModdingAPI.Events
{
InventoryChanged.Invoke(null, new EventArgsInventoryChanged(inventory, changedItems));
}
+
+ public static void InvokeLeveledUp(EventArgsLevelUp.LevelType type, int newLevel)
+ {
+ LeveledUp.Invoke(null, new EventArgsLevelUp(type, newLevel));
+ }
}
}