summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--StardewInjector/StardewInjector.csproj21
-rw-r--r--StardewInjector/packages.config6
-rw-r--r--StardewModdingAPI/Command.cs3
-rw-r--r--StardewModdingAPI/Events.cs153
-rw-r--r--StardewModdingAPI/Events/Controls.cs31
-rw-r--r--StardewModdingAPI/Events/EventArgs.cs (renamed from StardewModdingAPI/EventArgs.cs)2
-rw-r--r--StardewModdingAPI/Events/Game.cs57
-rw-r--r--StardewModdingAPI/Events/Graphics.cs31
-rw-r--r--StardewModdingAPI/Events/Location.cs32
-rw-r--r--StardewModdingAPI/Events/Menu.cs19
-rw-r--r--StardewModdingAPI/Events/Mine.cs12
-rw-r--r--StardewModdingAPI/Events/Player.cs19
-rw-r--r--StardewModdingAPI/Events/Time.cs36
-rw-r--r--StardewModdingAPI/Inheritance/SGame.cs32
-rw-r--r--StardewModdingAPI/Program.cs11
-rw-r--r--StardewModdingAPI/StardewModdingAPI.csproj14
-rw-r--r--TrainerMod/TrainerMod.cs3
-rw-r--r--TrainerMod/TrainerMod.csproj4
18 files changed, 297 insertions, 189 deletions
diff --git a/StardewInjector/StardewInjector.csproj b/StardewInjector/StardewInjector.csproj
index accb660f..67595e0f 100644
--- a/StardewInjector/StardewInjector.csproj
+++ b/StardewInjector/StardewInjector.csproj
@@ -33,8 +33,21 @@
<ItemGroup>
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
<Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
- <Reference Include="Mono.Cecil">
- <HintPath>Z:\Games\Stardew Valley\Mono.Cecil.dll</HintPath>
+ <Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
+ <HintPath>..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
+ <Reference Include="Mono.Cecil.Mdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
+ <HintPath>..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
+ <Reference Include="Mono.Cecil.Pdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
+ <HintPath>..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
+ <Reference Include="Mono.Cecil.Rocks, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
+ <HintPath>..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
+ <Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
@@ -65,8 +78,8 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
- <PostBuildEvent>mkdir "$(SolutionDir)Release\Mods\"
-copy /y "$(SolutionDir)$(ProjectName)\$(OutDir)$(TargetFileName)" "$(SolutionDir)Release\Mods\"</PostBuildEvent>
+ <PostBuildEvent>
+ </PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
diff --git a/StardewInjector/packages.config b/StardewInjector/packages.config
index 94c493b3..bedba391 100644
--- a/StardewInjector/packages.config
+++ b/StardewInjector/packages.config
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="Mono.Cecil" version="0.9.6.0" targetFramework="net40" />
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Mono.Cecil" version="0.9.6.1" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/StardewModdingAPI/Command.cs b/StardewModdingAPI/Command.cs
index bb18a9a6..4bfc7564 100644
--- a/StardewModdingAPI/Command.cs
+++ b/StardewModdingAPI/Command.cs
@@ -1,4 +1,5 @@
-using System;
+using StardewModdingAPI.Events;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
diff --git a/StardewModdingAPI/Events.cs b/StardewModdingAPI/Events.cs
deleted file mode 100644
index de1c24bc..00000000
--- a/StardewModdingAPI/Events.cs
+++ /dev/null
@@ -1,153 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Microsoft.Xna.Framework.Input;
-using StardewValley;
-using StardewValley.Menus;
-using Microsoft.Xna.Framework;
-
-namespace StardewModdingAPI
-{
- public static class Events
- {
- public static event EventHandler GameLoaded = delegate { };
- public static event EventHandler Initialize = delegate { };
- public static event EventHandler LoadContent = delegate { };
- public static event EventHandler UpdateTick = delegate { };
- public static event EventHandler DrawTick = delegate { };
-
- public static event EventHandler<EventArgsKeyboardStateChanged> KeyboardChanged = delegate { };
- public static event EventHandler<EventArgsKeyPressed> KeyPressed = delegate { };
- public static event EventHandler<EventArgsMouseStateChanged> MouseChanged = delegate { };
- public static event EventHandler<EventArgsClickableMenuChanged> MenuChanged = delegate { };
- public static event EventHandler<EventArgsGameLocationsChanged> LocationsChanged = delegate { };
- public static event EventHandler<EventArgsLocationObjectsChanged> LocationObjectsChanged = delegate { };
- public static event EventHandler<EventArgsCurrentLocationChanged> CurrentLocationChanged = delegate { };
- public static event EventHandler Resize = delegate { };
- public static event EventHandler<EventArgsFarmerChanged> FarmerChanged = delegate { };
- 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 { };
-
- public static void InvokeGameLoaded()
- {
- GameLoaded.Invoke(null, EventArgs.Empty);
- }
-
- public static void InvokeInitialize()
- {
- try
- {
- Initialize.Invoke(null, EventArgs.Empty);
- }
- catch (Exception ex)
- {
- Program.LogError("An exception occured in XNA Initialize: " + ex.ToString());
- }
- }
-
- public static void InvokeLoadContent()
- {
- try
- {
- LoadContent.Invoke(null, EventArgs.Empty);
- }
- catch (Exception ex)
- {
- Program.LogError("An exception occured in XNA LoadContent: " + ex.ToString());
- }
- }
-
- public static void InvokeUpdateTick()
- {
- try
- {
- UpdateTick.Invoke(null, EventArgs.Empty);
- }
- catch (Exception ex)
- {
- Program.LogError("An exception occured in XNA UpdateTick: " + ex.ToString());
- }
- }
-
- public static void InvokeDrawTick()
- {
- try
- {
- DrawTick.Invoke(null, EventArgs.Empty);
- }
- catch (Exception ex)
- {
- Program.LogError("An exception occured in XNA DrawTick: " + ex.ToString());
- }
- }
-
- public static void InvokeKeyboardChanged(KeyboardState priorState, KeyboardState newState)
- {
- KeyboardChanged.Invoke(null, new EventArgsKeyboardStateChanged(priorState, newState));
- }
-
- public static void InvokeMouseChanged(MouseState priorState, MouseState newState)
- {
- MouseChanged.Invoke(null, new EventArgsMouseStateChanged(priorState, newState));
- }
-
- public static void InvokeKeyPressed(Keys key)
- {
- KeyPressed.Invoke(null, new EventArgsKeyPressed(key));
- }
-
- public static void InvokeMenuChanged(IClickableMenu priorMenu, IClickableMenu newMenu)
- {
- MenuChanged.Invoke(null, new EventArgsClickableMenuChanged(priorMenu, newMenu));
- }
-
- public static void InvokeLocationsChanged(List<GameLocation> newLocations)
- {
- LocationsChanged.Invoke(null, new EventArgsGameLocationsChanged(newLocations));
- }
-
- public static void InvokeCurrentLocationChanged(GameLocation priorLocation, GameLocation newLocation)
- {
- CurrentLocationChanged.Invoke(null, new EventArgsCurrentLocationChanged(priorLocation, newLocation));
- }
-
- public static void InvokeResize(object sender, EventArgs e)
- {
- Resize.Invoke(sender, e);
- }
-
- public static void InvokeFarmerChanged(Farmer priorFarmer, Farmer newFarmer)
- {
- FarmerChanged.Invoke(null, new EventArgsFarmerChanged(priorFarmer, newFarmer));
- }
-
- public static void InvokeTimeOfDayChanged(Int32 priorInt, Int32 newInt)
- {
- TimeOfDayChanged.Invoke(null, new EventArgsIntChanged(priorInt, newInt));
- }
-
- public static void InvokeDayOfMonthChanged(Int32 priorInt, Int32 newInt)
- {
- DayOfMonthChanged.Invoke(null, new EventArgsIntChanged(priorInt, newInt));
- }
-
- public static void InvokeYearOfGameChanged(Int32 priorInt, Int32 newInt)
- {
- YearOfGameChanged.Invoke(null, new EventArgsIntChanged(priorInt, newInt));
- }
-
- public static void InvokeSeasonOfYearChanged(String priorString, String newString)
- {
- SeasonOfYearChanged.Invoke(null, new EventArgsStringChanged(priorString, newString));
- }
-
- internal static void InvokeOnNewLocationObject(SerializableDictionary<Vector2, StardewValley.Object> newObjects)
- {
- LocationObjectsChanged.Invoke(null, new EventArgsLocationObjectsChanged(newObjects));
- }
- }
-}
diff --git a/StardewModdingAPI/Events/Controls.cs b/StardewModdingAPI/Events/Controls.cs
new file mode 100644
index 00000000..ace890ca
--- /dev/null
+++ b/StardewModdingAPI/Events/Controls.cs
@@ -0,0 +1,31 @@
+using Microsoft.Xna.Framework.Input;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace StardewModdingAPI.Events
+{
+ public static class ControlEvents
+ {
+ public static event EventHandler<EventArgsKeyboardStateChanged> KeyboardChanged = delegate { };
+ public static event EventHandler<EventArgsKeyPressed> KeyPressed = delegate { };
+ public static event EventHandler<EventArgsMouseStateChanged> MouseChanged = delegate { };
+
+ public static void InvokeKeyboardChanged(KeyboardState priorState, KeyboardState newState)
+ {
+ KeyboardChanged.Invoke(null, new EventArgsKeyboardStateChanged(priorState, newState));
+ }
+
+ public static void InvokeMouseChanged(MouseState priorState, MouseState newState)
+ {
+ MouseChanged.Invoke(null, new EventArgsMouseStateChanged(priorState, newState));
+ }
+
+ public static void InvokeKeyPressed(Keys key)
+ {
+ KeyPressed.Invoke(null, new EventArgsKeyPressed(key));
+ }
+ }
+}
diff --git a/StardewModdingAPI/EventArgs.cs b/StardewModdingAPI/Events/EventArgs.cs
index cb7324c9..c9055f84 100644
--- a/StardewModdingAPI/EventArgs.cs
+++ b/StardewModdingAPI/Events/EventArgs.cs
@@ -8,7 +8,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace StardewModdingAPI
+namespace StardewModdingAPI.Events
{
public class EventArgsKeyboardStateChanged : EventArgs
{
diff --git a/StardewModdingAPI/Events/Game.cs b/StardewModdingAPI/Events/Game.cs
new file mode 100644
index 00000000..d155ba2e
--- /dev/null
+++ b/StardewModdingAPI/Events/Game.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace StardewModdingAPI.Events
+{
+ public static class GameEvents
+ {
+ public static event EventHandler GameLoaded = delegate { };
+ public static event EventHandler Initialize = delegate { };
+ public static event EventHandler LoadContent = delegate { };
+ public static event EventHandler UpdateTick = delegate { };
+
+ public static void InvokeGameLoaded()
+ {
+ GameLoaded.Invoke(null, EventArgs.Empty);
+ }
+
+ public static void InvokeInitialize()
+ {
+ try
+ {
+ Initialize.Invoke(null, EventArgs.Empty);
+ }
+ catch (Exception ex)
+ {
+ Program.LogError("An exception occured in XNA Initialize: " + ex.ToString());
+ }
+ }
+
+ public static void InvokeLoadContent()
+ {
+ try
+ {
+ LoadContent.Invoke(null, EventArgs.Empty);
+ }
+ catch (Exception ex)
+ {
+ Program.LogError("An exception occured in XNA LoadContent: " + ex.ToString());
+ }
+ }
+
+ public static void InvokeUpdateTick()
+ {
+ try
+ {
+ UpdateTick.Invoke(null, EventArgs.Empty);
+ }
+ catch (Exception ex)
+ {
+ Program.LogError("An exception occured in XNA UpdateTick: " + ex.ToString());
+ }
+ }
+ }
+}
diff --git a/StardewModdingAPI/Events/Graphics.cs b/StardewModdingAPI/Events/Graphics.cs
new file mode 100644
index 00000000..62bffe82
--- /dev/null
+++ b/StardewModdingAPI/Events/Graphics.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace StardewModdingAPI.Events
+{
+ public static class GraphicsEvents
+ {
+ public static event EventHandler Resize = delegate { };
+ public static event EventHandler DrawTick = delegate { };
+
+ public static void InvokeDrawTick()
+ {
+ try
+ {
+ DrawTick.Invoke(null, EventArgs.Empty);
+ }
+ catch (Exception ex)
+ {
+ Program.LogError("An exception occured in XNA DrawTick: " + ex.ToString());
+ }
+ }
+
+ public static void InvokeResize(object sender, EventArgs e)
+ {
+ Resize.Invoke(sender, e);
+ }
+ }
+}
diff --git a/StardewModdingAPI/Events/Location.cs b/StardewModdingAPI/Events/Location.cs
new file mode 100644
index 00000000..c347659b
--- /dev/null
+++ b/StardewModdingAPI/Events/Location.cs
@@ -0,0 +1,32 @@
+using Microsoft.Xna.Framework;
+using StardewValley;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace StardewModdingAPI.Events
+{
+ public static class LocationEvents
+ {
+ public static event EventHandler<EventArgsGameLocationsChanged> LocationsChanged = delegate { };
+ public static event EventHandler<EventArgsLocationObjectsChanged> LocationObjectsChanged = delegate { };
+ public static event EventHandler<EventArgsCurrentLocationChanged> CurrentLocationChanged = delegate { };
+
+ public static void InvokeLocationsChanged(List<GameLocation> newLocations)
+ {
+ LocationsChanged.Invoke(null, new EventArgsGameLocationsChanged(newLocations));
+ }
+
+ public static void InvokeCurrentLocationChanged(GameLocation priorLocation, GameLocation newLocation)
+ {
+ CurrentLocationChanged.Invoke(null, new EventArgsCurrentLocationChanged(priorLocation, newLocation));
+ }
+
+ internal static void InvokeOnNewLocationObject(SerializableDictionary<Vector2, StardewValley.Object> newObjects)
+ {
+ LocationObjectsChanged.Invoke(null, new EventArgsLocationObjectsChanged(newObjects));
+ }
+ }
+}
diff --git a/StardewModdingAPI/Events/Menu.cs b/StardewModdingAPI/Events/Menu.cs
new file mode 100644
index 00000000..0819fb20
--- /dev/null
+++ b/StardewModdingAPI/Events/Menu.cs
@@ -0,0 +1,19 @@
+using StardewValley.Menus;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace StardewModdingAPI.Events
+{
+ public static class MenuEvents
+ {
+ public static event EventHandler<EventArgsClickableMenuChanged> MenuChanged = delegate { };
+
+ public static void InvokeMenuChanged(IClickableMenu priorMenu, IClickableMenu newMenu)
+ {
+ MenuChanged.Invoke(null, new EventArgsClickableMenuChanged(priorMenu, newMenu));
+ }
+ }
+}
diff --git a/StardewModdingAPI/Events/Mine.cs b/StardewModdingAPI/Events/Mine.cs
new file mode 100644
index 00000000..67f1e2c1
--- /dev/null
+++ b/StardewModdingAPI/Events/Mine.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace StardewModdingAPI.Events
+{
+ public static class MineEvents
+ {
+ }
+}
diff --git a/StardewModdingAPI/Events/Player.cs b/StardewModdingAPI/Events/Player.cs
new file mode 100644
index 00000000..3fa5c806
--- /dev/null
+++ b/StardewModdingAPI/Events/Player.cs
@@ -0,0 +1,19 @@
+using StardewValley;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace StardewModdingAPI.Events
+{
+ public static class PlayerEvents
+ {
+ public static event EventHandler<EventArgsFarmerChanged> FarmerChanged = delegate { };
+
+ public static void InvokeFarmerChanged(Farmer priorFarmer, Farmer newFarmer)
+ {
+ FarmerChanged.Invoke(null, new EventArgsFarmerChanged(priorFarmer, newFarmer));
+ }
+ }
+}
diff --git a/StardewModdingAPI/Events/Time.cs b/StardewModdingAPI/Events/Time.cs
new file mode 100644
index 00000000..fcf0b3e5
--- /dev/null
+++ b/StardewModdingAPI/Events/Time.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+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 { };
+
+ public static void InvokeTimeOfDayChanged(Int32 priorInt, Int32 newInt)
+ {
+ TimeOfDayChanged.Invoke(null, new EventArgsIntChanged(priorInt, newInt));
+ }
+
+ public static void InvokeDayOfMonthChanged(Int32 priorInt, Int32 newInt)
+ {
+ DayOfMonthChanged.Invoke(null, new EventArgsIntChanged(priorInt, newInt));
+ }
+
+ public static void InvokeYearOfGameChanged(Int32 priorInt, Int32 newInt)
+ {
+ YearOfGameChanged.Invoke(null, new EventArgsIntChanged(priorInt, newInt));
+ }
+
+ public static void InvokeSeasonOfYearChanged(String priorString, String newString)
+ {
+ SeasonOfYearChanged.Invoke(null, new EventArgsStringChanged(priorString, newString));
+ }
+ }
+}
diff --git a/StardewModdingAPI/Inheritance/SGame.cs b/StardewModdingAPI/Inheritance/SGame.cs
index 83f8e335..f9b2f60c 100644
--- a/StardewModdingAPI/Inheritance/SGame.cs
+++ b/StardewModdingAPI/Inheritance/SGame.cs
@@ -100,14 +100,14 @@ namespace StardewModdingAPI.Inheritance
ModItems = new Dictionary<Int32, SObject>();
PreviouslyPressedKeys = new Keys[0];
base.Initialize();
- Events.InvokeInitialize();
+ Events.GameEvents.InvokeInitialize();
}
protected override void LoadContent()
{
Program.Log("XNA LoadContent");
base.LoadContent();
- Events.InvokeLoadContent();
+ Events.GameEvents.InvokeLoadContent();
}
protected override void Update(GameTime gameTime)
@@ -124,7 +124,7 @@ namespace StardewModdingAPI.Inheritance
Console.ReadKey();
}
- Events.InvokeUpdateTick();
+ Events.GameEvents.InvokeUpdateTick();
PreviouslyPressedKeys = CurrentlyPressedKeys;
}
@@ -132,7 +132,7 @@ namespace StardewModdingAPI.Inheritance
protected override void Draw(GameTime gameTime)
{
base.Draw(gameTime);
- Events.InvokeDrawTick();
+ Events.GraphicsEvents.InvokeDrawTick();
if (false)
{
@@ -225,71 +225,71 @@ namespace StardewModdingAPI.Inheritance
MStateNow = Mouse.GetState();
foreach (Keys k in FramePressedKeys)
- Events.InvokeKeyPressed(k);
+ Events.ControlEvents.InvokeKeyPressed(k);
if (KStateNow != KStatePrior)
{
- Events.InvokeKeyboardChanged(KStatePrior, KStateNow);
+ Events.ControlEvents.InvokeKeyboardChanged(KStatePrior, KStateNow);
KStatePrior = KStateNow;
}
if (MStateNow != MStatePrior)
{
- Events.InvokeMouseChanged(MStatePrior, MStateNow);
+ Events.ControlEvents.InvokeMouseChanged(MStatePrior, MStateNow);
MStatePrior = MStateNow;
}
if (activeClickableMenu != null && activeClickableMenu != PreviousActiveMenu)
{
- Events.InvokeMenuChanged(PreviousActiveMenu, activeClickableMenu);
+ Events.MenuEvents.InvokeMenuChanged(PreviousActiveMenu, activeClickableMenu);
PreviousActiveMenu = activeClickableMenu;
}
if (locations.GetHash() != PreviousGameLocations)
{
- Events.InvokeLocationsChanged(locations);
+ Events.LocationEvents.InvokeLocationsChanged(locations);
PreviousGameLocations = locations.GetHash();
}
if (currentLocation != PreviousGameLocation)
{
- Events.InvokeCurrentLocationChanged(PreviousGameLocation, currentLocation);
+ Events.LocationEvents.InvokeCurrentLocationChanged(PreviousGameLocation, currentLocation);
PreviousGameLocation = currentLocation;
}
if (player != null && player != PreviousFarmer)
{
- Events.InvokeFarmerChanged(PreviousFarmer, player);
+ Events.PlayerEvents.InvokeFarmerChanged(PreviousFarmer, player);
PreviousFarmer = player;
}
if(currentLocation != null && PreviousLocationObjects != currentLocation.objects.GetHash())
{
- Events.InvokeOnNewLocationObject(currentLocation.objects);
+ Events.LocationEvents.InvokeOnNewLocationObject(currentLocation.objects);
PreviousLocationObjects = currentLocation.objects.GetHash();
}
if (timeOfDay != PreviousTimeOfDay)
{
- Events.InvokeTimeOfDayChanged(PreviousTimeOfDay, timeOfDay);
+ Events.TimeEvents.InvokeTimeOfDayChanged(PreviousTimeOfDay, timeOfDay);
PreviousTimeOfDay = timeOfDay;
}
if (dayOfMonth != PreviousDayOfMonth)
{
- Events.InvokeDayOfMonthChanged(PreviousDayOfMonth, dayOfMonth);
+ Events.TimeEvents.InvokeDayOfMonthChanged(PreviousDayOfMonth, dayOfMonth);
PreviousDayOfMonth = dayOfMonth;
}
if (currentSeason != PreviousSeasonOfYear)
{
- Events.InvokeSeasonOfYearChanged(PreviousSeasonOfYear, currentSeason);
+ Events.TimeEvents.InvokeSeasonOfYearChanged(PreviousSeasonOfYear, currentSeason);
PreviousSeasonOfYear = currentSeason;
}
if (year != PreviousYearOfGame)
{
- Events.InvokeYearOfGameChanged(PreviousYearOfGame, year);
+ Events.TimeEvents.InvokeYearOfGameChanged(PreviousYearOfGame, year);
PreviousYearOfGame = year;
}
}
diff --git a/StardewModdingAPI/Program.cs b/StardewModdingAPI/Program.cs
index e7169bde..f7cb7c87 100644
--- a/StardewModdingAPI/Program.cs
+++ b/StardewModdingAPI/Program.cs
@@ -23,7 +23,8 @@ using StardewValley.Network;
using StardewValley.Tools;
using Keys = Microsoft.Xna.Framework.Input.Keys;
using Object = StardewValley.Object;
-
+using StardewModdingAPI.Events;
+
namespace StardewModdingAPI
{
public class Program
@@ -249,8 +250,8 @@ namespace StardewModdingAPI
//Command.RegisterCommand("crash", "crashes sdv").CommandFired += delegate { Game1.player.draw(null); };
//Subscribe to events
- Events.KeyPressed += Events_KeyPressed;
- Events.LoadContent += Events_LoadContent;
+ Events.ControlEvents.KeyPressed += Events_KeyPressed;
+ Events.GameEvents.LoadContent += Events_LoadContent;
//Events.MenuChanged += Events_MenuChanged; //Idk right now
if (debug)
{
@@ -265,12 +266,12 @@ namespace StardewModdingAPI
{
gamePtr.IsMouseVisible = false;
gamePtr.Window.Title = "Stardew Valley - Version " + Game1.version;
- StardewForm.Resize += Events.InvokeResize;
+ StardewForm.Resize += Events.GraphicsEvents.InvokeResize;
});
//Game's in memory now, send the event
LogInfo("Game Loaded");
- Events.InvokeGameLoaded();
+ Events.GameEvents.InvokeGameLoaded();
LogColour(ConsoleColor.Cyan, "Type 'help' for help, or 'help <cmd>' for a command's usage");
//Begin listening to input
diff --git a/StardewModdingAPI/StardewModdingAPI.csproj b/StardewModdingAPI/StardewModdingAPI.csproj
index 35a17272..64f5a718 100644
--- a/StardewModdingAPI/StardewModdingAPI.csproj
+++ b/StardewModdingAPI/StardewModdingAPI.csproj
@@ -78,8 +78,15 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Command.cs" />
- <Compile Include="EventArgs.cs" />
- <Compile Include="Events.cs" />
+ <Compile Include="Events\Controls.cs" />
+ <Compile Include="Events\EventArgs.cs" />
+ <Compile Include="Events\Game.cs" />
+ <Compile Include="Events\Graphics.cs" />
+ <Compile Include="Events\Location.cs" />
+ <Compile Include="Events\Menu.cs" />
+ <Compile Include="Events\Mine.cs" />
+ <Compile Include="Events\Player.cs" />
+ <Compile Include="Events\Time.cs" />
<Compile Include="Extensions.cs" />
<Compile Include="Inheritance\Menus\SBobberBar.cs" />
<Compile Include="Inheritance\Menus\SGameMenu.cs" />
@@ -102,7 +109,8 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
- <PostBuildEvent>copy /y "$(SolutionDir)$(ProjectName)\$(OutDir)StardewModdingAPI.exe" "$(SolutionDir)Release\"</PostBuildEvent>
+ <PostBuildEvent>
+</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
diff --git a/TrainerMod/TrainerMod.cs b/TrainerMod/TrainerMod.cs
index cc6f2044..238872c2 100644
--- a/TrainerMod/TrainerMod.cs
+++ b/TrainerMod/TrainerMod.cs
@@ -10,6 +10,7 @@ using StardewValley;
using StardewValley.Tools;
using Microsoft.Xna.Framework;
using StardewValley.Objects;
+using StardewModdingAPI.Events;
namespace TrainerMod
{
@@ -41,7 +42,7 @@ namespace TrainerMod
public override void Entry(params object[] objects)
{
RegisterCommands();
- Events.UpdateTick += Events_UpdateTick;
+ GameEvents.UpdateTick += Events_UpdateTick;
}
static void Events_UpdateTick(object sender, EventArgs e)
diff --git a/TrainerMod/TrainerMod.csproj b/TrainerMod/TrainerMod.csproj
index 841491ad..213b3210 100644
--- a/TrainerMod/TrainerMod.csproj
+++ b/TrainerMod/TrainerMod.csproj
@@ -64,8 +64,8 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
- <PostBuildEvent>mkdir "$(SolutionDir)Release\Mods\"
-copy /y "$(SolutionDir)$(ProjectName)\$(OutDir)TrainerMod.dll" "$(SolutionDir)Release\Mods\"</PostBuildEvent>
+ <PostBuildEvent>
+ </PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.