summaryrefslogtreecommitdiff
path: root/StardewModdingAPI/Events
diff options
context:
space:
mode:
authorZoryn <Zoryn4163@users.noreply.github.com>2016-03-22 20:58:00 -0400
committerZoryn <Zoryn4163@users.noreply.github.com>2016-03-22 20:58:00 -0400
commit7076886f2c229db8c06f41dd29aa0bf7ac966dc2 (patch)
treeb73219bf01b6afc25dbe26b761e5d4acc28773dd /StardewModdingAPI/Events
parent07773a380428c7b37f729e3b32fd7e7b960b360d (diff)
parent24e144d0f1aaae33fb51e80031259d0119acff7c (diff)
downloadSMAPI-7076886f2c229db8c06f41dd29aa0bf7ac966dc2.tar.gz
SMAPI-7076886f2c229db8c06f41dd29aa0bf7ac966dc2.tar.bz2
SMAPI-7076886f2c229db8c06f41dd29aa0bf7ac966dc2.zip
Merge pull request #50 from Zoryn4163/master
a lot
Diffstat (limited to 'StardewModdingAPI/Events')
-rw-r--r--StardewModdingAPI/Events/Controls.cs8
-rw-r--r--StardewModdingAPI/Events/EventArgs.cs26
-rw-r--r--StardewModdingAPI/Events/Game.cs10
-rw-r--r--StardewModdingAPI/Events/Graphics.cs6
-rw-r--r--StardewModdingAPI/Events/Location.cs12
-rw-r--r--StardewModdingAPI/Events/Menu.cs8
-rw-r--r--StardewModdingAPI/Events/Mine.cs8
-rw-r--r--StardewModdingAPI/Events/Player.cs15
-rw-r--r--StardewModdingAPI/Events/Time.cs4
9 files changed, 41 insertions, 56 deletions
diff --git a/StardewModdingAPI/Events/Controls.cs b/StardewModdingAPI/Events/Controls.cs
index c79c28f6..5c604492 100644
--- a/StardewModdingAPI/Events/Controls.cs
+++ b/StardewModdingAPI/Events/Controls.cs
@@ -1,10 +1,6 @@
-using Microsoft.Xna.Framework;
+using System;
+using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace StardewModdingAPI.Events
{
diff --git a/StardewModdingAPI/Events/EventArgs.cs b/StardewModdingAPI/Events/EventArgs.cs
index ee30b406..a6de3597 100644
--- a/StardewModdingAPI/Events/EventArgs.cs
+++ b/StardewModdingAPI/Events/EventArgs.cs
@@ -1,13 +1,12 @@
-using Microsoft.Xna.Framework;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using StardewModdingAPI.Inheritance;
using StardewValley;
using StardewValley.Menus;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using Object = StardewValley.Object;
namespace StardewModdingAPI.Events
{
@@ -112,11 +111,11 @@ namespace StardewModdingAPI.Events
public class EventArgsLocationObjectsChanged : EventArgs
{
- public EventArgsLocationObjectsChanged(SerializableDictionary<Vector2, StardewValley.Object> newObjects)
+ public EventArgsLocationObjectsChanged(SerializableDictionary<Vector2, Object> newObjects)
{
NewObjects = newObjects;
}
- public SerializableDictionary<Vector2, StardewValley.Object> NewObjects { get; private set; }
+ public SerializableDictionary<Vector2, Object> NewObjects { get; private set; }
}
public class EventArgsCurrentLocationChanged : EventArgs
@@ -198,6 +197,17 @@ namespace StardewModdingAPI.Events
public String PriorString { get; private set; }
}
+ public class EventArgsLoadedGameChanged : EventArgs
+ {
+ public EventArgsLoadedGameChanged(bool loadedGame)
+ {
+ LoadedGame = loadedGame;
+ }
+
+ public bool LoadedGame { get; private set; }
+ }
+
+
public class EventArgsCommand : EventArgs
{
public EventArgsCommand(Command command)
diff --git a/StardewModdingAPI/Events/Game.cs b/StardewModdingAPI/Events/Game.cs
index ac630ba9..85022391 100644
--- a/StardewModdingAPI/Events/Game.cs
+++ b/StardewModdingAPI/Events/Game.cs
@@ -1,8 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace StardewModdingAPI.Events
{
@@ -54,7 +50,7 @@ namespace StardewModdingAPI.Events
}
catch (Exception ex)
{
- Log.Error("An exception occured in XNA Initialize: " + ex.ToString());
+ Log.Error("An exception occured in XNA Initialize: " + ex);
}
}
@@ -66,7 +62,7 @@ namespace StardewModdingAPI.Events
}
catch (Exception ex)
{
- Log.Error("An exception occured in XNA LoadContent: " + ex.ToString());
+ Log.Error("An exception occured in XNA LoadContent: " + ex);
}
}
@@ -78,7 +74,7 @@ namespace StardewModdingAPI.Events
}
catch (Exception ex)
{
- Log.Error("An exception occured in XNA UpdateTick: " + ex.ToString());
+ Log.Error("An exception occured in XNA UpdateTick: " + ex);
}
}
diff --git a/StardewModdingAPI/Events/Graphics.cs b/StardewModdingAPI/Events/Graphics.cs
index 60ee7a74..87ee845b 100644
--- a/StardewModdingAPI/Events/Graphics.cs
+++ b/StardewModdingAPI/Events/Graphics.cs
@@ -1,8 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace StardewModdingAPI.Events
{
@@ -19,7 +15,7 @@ namespace StardewModdingAPI.Events
}
catch (Exception ex)
{
- Log.Error("An exception occured in XNA DrawTick: " + ex.ToString());
+ Log.Error("An exception occured in XNA DrawTick: " + ex);
}
}
diff --git a/StardewModdingAPI/Events/Location.cs b/StardewModdingAPI/Events/Location.cs
index c347659b..63b0f602 100644
--- a/StardewModdingAPI/Events/Location.cs
+++ b/StardewModdingAPI/Events/Location.cs
@@ -1,10 +1,8 @@
-using Microsoft.Xna.Framework;
-using StardewValley;
-using System;
+using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using Microsoft.Xna.Framework;
+using StardewValley;
+using Object = StardewValley.Object;
namespace StardewModdingAPI.Events
{
@@ -24,7 +22,7 @@ namespace StardewModdingAPI.Events
CurrentLocationChanged.Invoke(null, new EventArgsCurrentLocationChanged(priorLocation, newLocation));
}
- internal static void InvokeOnNewLocationObject(SerializableDictionary<Vector2, StardewValley.Object> newObjects)
+ internal static void InvokeOnNewLocationObject(SerializableDictionary<Vector2, Object> newObjects)
{
LocationObjectsChanged.Invoke(null, new EventArgsLocationObjectsChanged(newObjects));
}
diff --git a/StardewModdingAPI/Events/Menu.cs b/StardewModdingAPI/Events/Menu.cs
index 0819fb20..d3f3e008 100644
--- a/StardewModdingAPI/Events/Menu.cs
+++ b/StardewModdingAPI/Events/Menu.cs
@@ -1,9 +1,5 @@
-using StardewValley.Menus;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System;
+using StardewValley.Menus;
namespace StardewModdingAPI.Events
{
diff --git a/StardewModdingAPI/Events/Mine.cs b/StardewModdingAPI/Events/Mine.cs
index 67f1e2c1..ea23a8a3 100644
--- a/StardewModdingAPI/Events/Mine.cs
+++ b/StardewModdingAPI/Events/Mine.cs
@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace StardewModdingAPI.Events
+namespace StardewModdingAPI.Events
{
public static class MineEvents
{
diff --git a/StardewModdingAPI/Events/Player.cs b/StardewModdingAPI/Events/Player.cs
index f0547f87..ca05c05b 100644
--- a/StardewModdingAPI/Events/Player.cs
+++ b/StardewModdingAPI/Events/Player.cs
@@ -1,10 +1,7 @@
-using StardewModdingAPI.Inheritance;
-using StardewValley;
-using System;
+using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using StardewModdingAPI.Inheritance;
+using StardewValley;
namespace StardewModdingAPI.Events
{
@@ -13,6 +10,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 event EventHandler<EventArgsLoadedGameChanged> LoadedGame = delegate { };
public static void InvokeFarmerChanged(Farmer priorFarmer, Farmer newFarmer)
{
@@ -28,5 +26,10 @@ namespace StardewModdingAPI.Events
{
LeveledUp.Invoke(null, new EventArgsLevelUp(type, newLevel));
}
+
+ public static void InvokeLoadedGame(EventArgsLoadedGameChanged loaded)
+ {
+ LoadedGame.Invoke(null, loaded);
+ }
}
}
diff --git a/StardewModdingAPI/Events/Time.cs b/StardewModdingAPI/Events/Time.cs
index fcf0b3e5..a3fcee19 100644
--- a/StardewModdingAPI/Events/Time.cs
+++ b/StardewModdingAPI/Events/Time.cs
@@ -1,8 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace StardewModdingAPI.Events
{