fix compatibility with SMAPI 2.0

This commit is contained in:
Jesse Plamondon-Willard 2017-08-05 15:20:46 -04:00
parent 0f33387756
commit a03da96aa8
37 changed files with 77 additions and 49 deletions

View File

@ -7,6 +7,7 @@
"PatchVersion": 0,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "Got to go fast!",
"UniqueID": "Omegasis.AutoSpeed",
"EntryDll": "AutoSpeed.dll"

View File

@ -7,6 +7,7 @@
"PatchVersion": 0,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "Lets you view the billboard from anywhere.",
"UniqueID": "Omegasis.BillboardAnywhere",
"EntryDll": "BillboardAnywhere.dll"

View File

@ -68,7 +68,7 @@ namespace Omegasis.BuildEndurance
GameEvents.UpdateTick += this.GameEvents_UpdateTick;
GameEvents.OneSecondTick += this.GameEvents_OneSecondTick;
SaveEvents.AfterLoad += this.SaveEvents_AfterLoad;
TimeEvents.DayOfMonthChanged += this.TimeEvents_DayOfMonthChanged;
TimeEvents.AfterDayStarted += this.TimeEvents_AfterDayStarted;
string configPath = Path.Combine(helper.DirectoryPath, "BuildEnduranceConfig.json");
if (!File.Exists(configPath))
@ -178,10 +178,10 @@ namespace Omegasis.BuildEndurance
this.WriteConfig();
}
/// <summary>The method invoked when <see cref="Game1.dayOfMonth"/> changes.</summary>
/// <summary>The method invoked when a new day starts.</summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event data.</param>
public void TimeEvents_DayOfMonthChanged(object sender, EventArgs e)
public void TimeEvents_AfterDayStarted(object sender, EventArgs e)
{
// reset data
this.WasExhausted = false;

View File

@ -35,4 +35,5 @@ Edit `BuildEnduranceConfig.json` to configure the mod settings.
* Updated to Stardew Valley 1.2 and SMAPI 1.12.
1.4:
* Updated for SMAPI 2.0.
* Internal refactoring.

View File

@ -7,6 +7,7 @@
"PatchVersion": 0,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "Increase your health as you play.",
"UniqueID": "Omegasis.BuildEndurance",
"EntryDll": "BuildEndurance.dll"

View File

@ -65,7 +65,7 @@ namespace Omegasis.BuildHealth
GameEvents.UpdateTick += this.GameEvents_UpdateTick;
GameEvents.OneSecondTick += this.GameEvents_OneSecondTick;
TimeEvents.DayOfMonthChanged += this.TimeEvents_DayOfMonthChanged;
TimeEvents.AfterDayStarted += this.TimeEvents_AfterDayStarted;
SaveEvents.AfterLoad += this.SaveEvents_AfterLoaded;
var configPath = Path.Combine(helper.DirectoryPath, "BuildHealthConfig.json");
@ -146,10 +146,10 @@ namespace Omegasis.BuildHealth
}
}
/// <summary>The method invoked when <see cref="Game1.dayOfMonth"/> changes.</summary>
/// <summary>The method invoked after a new day starts.</summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event data.</param>
public void TimeEvents_DayOfMonthChanged(object sender, EventArgs e)
public void TimeEvents_AfterDayStarted(object sender, EventArgs e)
{
// reset data
this.LastHealth = Game1.player.maxHealth;

View File

@ -36,4 +36,5 @@ Edit `BuildHealthConfig.json` to configure the mod settings.
* Updated to Stardew Valley 1.2 and SMAPI 1.12.
1.4:
* Updated for SMAPI 2.0.
* Internal refactoring.

View File

@ -7,6 +7,7 @@
"PatchVersion": 0,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "Increase your health as you play.",
"UniqueID": "Omegasis.BuildHealth",
"EntryDll": "BuildHealth.dll"

View File

@ -7,6 +7,7 @@
"PatchVersion": 0,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "Lets you buy back any obtained collectable.",
"UniqueID": "Omegasis.BuyBackCollectables",
"EntryDll": "BuyBackCollectables.dll"

View File

@ -51,10 +51,10 @@ namespace Omegasis.CustomShopsRedux
** Public methods
*********/
/// <summary>The mod entry point, called after the mod is first loaded.</summary>
/// <param name="args">The mod arguments.</param>
public override void Entry(params object[] args)
/// <param name="helper">Provides simplified APIs for writing mods.</param>
public override void Entry(IModHelper helper)
{
PlayerEvents.LoadedGame += this.PlayerEvents_LoadedGame;
SaveEvents.AfterLoad += this.SaveEvents_AfterDayStarted;
ControlEvents.KeyPressed += this.ControlEvents_KeyPressed;
}
@ -62,10 +62,10 @@ namespace Omegasis.CustomShopsRedux
/*********
** Private methods
*********/
/// <summary>The method invoked after the player loads a save.</summary>
/// <summary>The method invoked after a new day starts.</summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event data.</param>
private void PlayerEvents_LoadedGame(object sender, EventArgsLoadedGameChanged e)
private void SaveEvents_AfterDayStarted(object sender, EventArgs e)
{
this.IsGameLoaded = true;
this.LoadConfig();
@ -89,10 +89,10 @@ namespace Omegasis.CustomShopsRedux
/// <summary>Load the configuration settings.</summary>
private void LoadConfig()
{
this.DataPath = Path.Combine(this.PathOnDisk, "Custom_Shops");
this.DataPath = Path.Combine(this.Helper.DirectoryPath, "Custom_Shops");
Directory.CreateDirectory(this.DataPath);
string path = Path.Combine(this.PathOnDisk, "Custom_Shop_Redux_Config.txt");
string path = Path.Combine(this.Helper.DirectoryPath, "Custom_Shop_Redux_Config.txt");
if (!File.Exists(path))
this.KeyBinding = "U";
else
@ -105,7 +105,7 @@ namespace Omegasis.CustomShopsRedux
/// <summary>Save the configuration settings.</summary>
private void WriteConfig()
{
string path = Path.Combine(this.PathOnDisk, "Custom_Shop_Redux_Config.txt");
string path = Path.Combine(this.Helper.DirectoryPath, "Custom_Shop_Redux_Config.txt");
string[] text = new string[20];
text[0] = "Config: Custom_Shop_Redux. Feel free to mess with these settings.";
text[1] = "====================================================================================";
@ -121,13 +121,13 @@ namespace Omegasis.CustomShopsRedux
{
// get mod folder
DirectoryInfo modFolder = new DirectoryInfo(this.DataPath);
Log.Info(modFolder);
this.Monitor.Log(modFolder.FullName);
// get text files
FileInfo[] files = modFolder.GetFiles("*.txt");
if (!files.Any())
{
Log.Error("No shop .txt information is found. You should create one.");
this.Monitor.Log("No shop .txt information is found. You should create one.", LogLevel.Error);
return;
}
@ -136,7 +136,7 @@ namespace Omegasis.CustomShopsRedux
this.Options.Add(file.Name);
if (!this.Options.Any())
{
Log.Error("No shop .txt information is found. You should create one.");
this.Monitor.Log("No shop .txt information is found. You should create one.", LogLevel.Error);
return;
}
@ -156,7 +156,7 @@ namespace Omegasis.CustomShopsRedux
// validate
if (filename == "Custom_Shop_Redux_Config.txt")
{
Log.Info("Silly human. The config file is not a shop.");
this.Monitor.Log("Silly human. The config file is not a shop.", LogLevel.Info);
return;
}
@ -168,8 +168,8 @@ namespace Omegasis.CustomShopsRedux
if (i >= lineCount || objType == "" || text[i] == "") break;
//read in a line for obj type here
Log.Info(i);
Log.Info(objType);
this.Monitor.Log(i.ToString());
this.Monitor.Log(objType);
int objID;
int price;
if (objType == "item" || objType == "Item" || objType == "Object" || objType == "object")
@ -177,13 +177,13 @@ namespace Omegasis.CustomShopsRedux
objID = Convert.ToInt16(text[i]);
i += 2;
Log.Info(i);
this.Monitor.Log(i.ToString());
bool isRecipe = Convert.ToBoolean(text[i]);
i += 2;
Log.Info(i);
this.Monitor.Log(i.ToString());
price = Convert.ToInt32(text[i]);
i += 2;
Log.Info(i);
this.Monitor.Log(i.ToString());
int quality = Convert.ToInt32(text[i]);
@ -295,7 +295,7 @@ namespace Omegasis.CustomShopsRedux
//TODO:
//add in support for colored objects
//add in support for tools
Log.Success(i);
this.Monitor.Log(i.ToString());
if (i >= lineCount)
break;

View File

@ -59,4 +59,5 @@ Supported item types:
* Updated to Stardew Valley 1.2 and SMAPI 1.12.
1.4:
* Updated for SMAPI 2.0.
* Internal refactoring.

View File

@ -7,6 +7,7 @@
"PatchVersion": 0,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "A nice way to make custom shops.",
"UniqueID": "Omegasis.CustomShopReduxGui",
"EntryDll": "CustomShopsRedux.dll"

View File

@ -7,6 +7,7 @@
"PatchVersion": 0,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "Open the daily quest board from anywhere in the game.",
"UniqueID": "Omegasis.DailyQuestAnywhere",
"EntryDll": "DailyQuestAnywhere.dll"

View File

@ -1,4 +1,5 @@
using StardewModdingAPI;
using System;
using StardewModdingAPI;
using StardewModdingAPI.Events;
using StardewValley;
@ -14,19 +15,19 @@ namespace Omegasis.Fall28SnowDay
/// <param name="helper">Provides simplified APIs for writing mods.</param>
public override void Entry(IModHelper helper)
{
TimeEvents.DayOfMonthChanged += this.TimeEvents_DayOfMonthChanged;
SaveEvents.BeforeSave += this.SaveEvents_BeforeSave;
}
/*********
** Private methods
*********/
/// <summary>The method invoked when <see cref="Game1.dayOfMonth"/> changes.</summary>
/// <summary>The method invoked just before the game saves.</summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event data.</param>
public void TimeEvents_DayOfMonthChanged(object sender, EventArgsIntChanged e)
public void SaveEvents_BeforeSave(object sender, EventArgs e)
{
if (Game1.dayOfMonth == 27 && Game1.IsFall)
if (Game1.IsFall && Game1.dayOfMonth == 27)
Game1.weatherForTomorrow = Game1.weather_snow;
}
}

View File

@ -22,4 +22,5 @@ It automatically snows on fall 28.
* Updated to Stardew Valley 1.2 and SMAPI 1.12.
1.4:
* Updated for SMAPI 2.0.
* Internal refactoring.

View File

@ -7,6 +7,7 @@
"PatchVersion": 1,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "Makes it snow on Fall 28, which makes a good explanation for all the snow on the next day.",
"UniqueID": "Omegasis.Fall28SnowDay",
"EntryDll": "Fall28SnowDay.dll"

View File

@ -61,7 +61,7 @@ namespace Omegasis.HappyBirthday
/// <param name="helper">Provides simplified APIs for writing mods.</param>
public override void Entry(IModHelper helper)
{
TimeEvents.DayOfMonthChanged += this.TimeEvents_DayOfMonthChanged;
TimeEvents.AfterDayStarted += this.TimeEvents_AfterDayStarted;
GameEvents.UpdateTick += this.GameEvents_UpdateTick;
SaveEvents.AfterLoad += this.SaveEvents_AfterLoad;
ControlEvents.KeyPressed += this.ControlEvents_KeyPressed;
@ -78,10 +78,10 @@ namespace Omegasis.HappyBirthday
/*********
** Private methods
*********/
/// <summary>The method invoked when <see cref="Game1.dayOfMonth"/> changes.</summary>
/// <summary>The method invoked after a new day starts.</summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event data.</param>
private void TimeEvents_DayOfMonthChanged(object sender, EventArgsIntChanged e)
private void TimeEvents_AfterDayStarted(object sender, EventArgs e)
{
if (Game1.player == null)
return;

View File

@ -53,4 +53,5 @@ change based on your friendship with them. Check your mailbox for letters from y
* Updated to Stardew Valley 1.2 and SMAPI 1.12.
1.4:
* Updated for SMAPI 2.0.
* Internal refactoring.

View File

@ -7,6 +7,7 @@
"PatchVersion": 0,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "Adds the farmer's birthday to the game.",
"UniqueID": "Omegasis.HappyBirthday",
"EntryDll": "HappyBirthday.dll"

View File

@ -52,7 +52,7 @@ namespace Omegasis.MoreRain
public override void Entry(IModHelper helper)
{
SaveEvents.AfterLoad += this.SaveEvents_AfterLoad;
TimeEvents.DayOfMonthChanged += this.TimeEvents_DayOfMonthChanged;
SaveEvents.BeforeSave += this.SaveEvents_BeforeSave;
this.LoadConfig();
}
@ -69,10 +69,10 @@ namespace Omegasis.MoreRain
this.HandleNewDay();
}
/// <summary>The method invoked when <see cref="Game1.dayOfMonth"/> changes.</summary>
/// <summary>The method invoked before the game is saved.</summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event data.</param>
private void TimeEvents_DayOfMonthChanged(object sender, EventArgsIntChanged e)
private void SaveEvents_BeforeSave(object sender, EventArgs e)
{
if (this.IsGameLoaded)
this.HandleNewDay();
@ -203,7 +203,7 @@ namespace Omegasis.MoreRain
}
/// <summary>Save the configuration settings.</summary>
void SaveConfig()
private void SaveConfig()
{
string path = Path.Combine(Helper.DirectoryPath, "More_Rain_Config.txt");
string[] text = new string[20];

View File

@ -28,4 +28,5 @@ It won't rain on days where a wedding or a festival would take place.
* Updated to Stardew Valley 1.2 and SMAPI 1.12.
1.4:
* Updated for SMAPI 2.0.
* Internal refactoring.

View File

@ -7,6 +7,7 @@
"PatchVersion": 2,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "Change how much it rains in the game.",
"UniqueID": "Omegasis.MoreRain",
"EntryDll": "MoreRain.dll"

View File

@ -7,6 +7,7 @@
"PatchVersion": 0,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "Lets you rearrange the museum without needing to donate something.",
"UniqueID": "Omegasis.MuseumRearranger",
"EntryDll": "MuseumRearranger.dll"

View File

@ -93,7 +93,7 @@ namespace Omegasis.NightOwl
public override void Entry(IModHelper helper)
{
TimeEvents.TimeOfDayChanged += this.TimeEvents_TimeOfDayChanged;
TimeEvents.DayOfMonthChanged += this.TimeEvents_DayOfMonthChanged;
TimeEvents.AfterDayStarted += this.TimeEvents_AfterDayStarted;
SaveEvents.AfterLoad += this.SaveEvents_AfterLoad;
GameEvents.FourthUpdateTick += this.GameEvents_FourthUpdateTick;
}
@ -140,10 +140,10 @@ namespace Omegasis.NightOwl
this.JustCollapsed = false;
}
/// <summary>The method invoked when <see cref="Game1.dayOfMonth"/> changes.</summary>
/// <summary>The method invoked when a new day starts.</summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event data.</param>
public void TimeEvents_DayOfMonthChanged(object sender, EventArgsIntChanged e)
public void TimeEvents_AfterDayStarted(object sender, EventArgs e)
{
if (!this.IsGameLoaded)
return;

View File

@ -24,4 +24,5 @@ Edit the `Night_Owl_Config_.txt` to change the mod settings.
* Updated to Stardew Valley 1.2 and SMAPI 1.12.
1.4:
* Updated for SMAPI 2.0.
* Internal refactoring.

View File

@ -7,6 +7,7 @@
"PatchVersion": 0,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "Lets you stay up all night.",
"UniqueID": "Omegasis.NightOwl",
"EntryDll": "NightOwl.dll"

View File

@ -7,6 +7,7 @@
"PatchVersion": 0,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "Removes all pets from the game.",
"UniqueID": "Omegasis.NoMorePets",
"EntryDll": "NoMorePets.dll"

View File

@ -36,4 +36,5 @@ Press `K` to save anywhere. Edit `Save_Anywhere_Config.txt` to configure the key
* Updated to Stardew Valley 1.2 and SMAPI 1.12.
2.5:
* Updated for SMAPI 2.0.
* Internal refactoring.

View File

@ -41,7 +41,7 @@ namespace Omegasis.SaveAnywhere
SaveEvents.AfterLoad += this.SaveEvents_AfterLoad;
ControlEvents.KeyPressed += this.ControlEvents_KeyPressed;
GameEvents.UpdateTick += this.GameEvents_UpdateTick;
TimeEvents.DayOfMonthChanged += this.TimeEvents_DayOfMonthChanged;
TimeEvents.AfterDayStarted += this.TimeEvents_AfterDayStarted;
}
@ -79,10 +79,10 @@ namespace Omegasis.SaveAnywhere
}
}
/// <summary>The method invoked when <see cref="Game1.dayOfMonth"/> changes.</summary>
/// <summary>The method invoked after a new day starts.</summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event data.</param>
private void TimeEvents_DayOfMonthChanged(object sender, EventArgsIntChanged e)
private void TimeEvents_AfterDayStarted(object sender, EventArgs e)
{
// reload NPC schedules
this.ShouldResetSchedules = true;

View File

@ -7,6 +7,7 @@
"PatchVersion": 0,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "Lets you save almost anywhere.",
"UniqueID": "Omegasis.SaveAnywhere",
"EntryDll": "SaveAnywhere.dll"

View File

@ -23,4 +23,5 @@ configure that.
* Updated to Stardew Valley 1.2 and SMAPI 1.12.
1.3:
* Updated for SMAPI 2.0.
* Internal refactoring.

View File

@ -41,17 +41,17 @@ namespace Omegasis.SaveBackup
this.BackupSaves(SaveBackup.PrePlayBackupsPath);
TimeEvents.DayOfMonthChanged += this.TimeEvents_DayOfMonthChanged;
SaveEvents.BeforeSave += this.SaveEvents_BeforeSave;
}
/*********
** Private methods
*********/
/// <summary>The method invoked when <see cref="StardewValley.Game1.dayOfMonth"/> changes.</summary>
/// <summary>The method invoked before the save is updated.</summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event data.</param>
private void TimeEvents_DayOfMonthChanged(object sender, EventArgs e)
private void SaveEvents_BeforeSave(object sender, EventArgs e)
{
this.BackupSaves(SaveBackup.NightlyBackupsPath);
}

View File

@ -7,6 +7,7 @@
"PatchVersion": 0,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "Backs up your save files at regular intervals.",
"UniqueID": "Omegasis.SaveBackup",
"EntryDll": "SaveBackup.dll"

View File

@ -33,4 +33,5 @@ This won't mute the music for in-game events or festivals.
* Updated to Stardew Valley 1.2 and SMAPI 1.12.
1.4:
* Updated for SMAPI 2.0.
* Internal refactoring.

View File

@ -89,7 +89,7 @@ namespace Omegasis.StardewSymphony
this.HexProcessor = new MusicHexProcessor(this.MasterList, this.Reset);
SaveEvents.AfterLoad += this.SaveEvents_AfterLoad;
TimeEvents.DayOfMonthChanged += this.TimeEvents_DayOfMonthChanged;
TimeEvents.AfterDayStarted += this.TimeEvents_AfterDayStarted;
GameEvents.UpdateTick += this.GameEvents_UpdateTick;
LocationEvents.CurrentLocationChanged += this.LocationEvents_CurrentLocationChanged;
}
@ -132,10 +132,10 @@ namespace Omegasis.StardewSymphony
Game1.nextMusicTrack = ""; //same as above line
}
/// <summary>The method invoked when <see cref="Game1.dayOfMonth"/> changes.</summary>
/// <summary>The method invoked after a new day starts.</summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event data.</param>
private void TimeEvents_DayOfMonthChanged(object sender, EventArgsIntChanged e)
private void TimeEvents_AfterDayStarted(object sender, EventArgs e)
{
if (!this.IsGameLoaded)
return;
@ -269,7 +269,7 @@ namespace Omegasis.StardewSymphony
string extension = Path.GetExtension(filePath);
if (extension == ".xsb")
{
Log.AsyncG(filePath);
this.Monitor.Log(filePath);
this.HexProcessor.AddSoundBank(filePath);
}
//if (extension == "xwb")

View File

@ -7,6 +7,7 @@
"PatchVersion": 0,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "Adding more music to the game one beep at a time.",
"UniqueID": "Omegasis.StardewSymphony",
"EntryDll": "StardewSymphony.dll"

View File

@ -7,6 +7,7 @@
"PatchVersion": 0,
"Build": null
},
"MinimumApiVersion": "1.15",
"Description": "Emulates old Harvest Moon-style games where time is frozen inside.",
"UniqueID": "Omegasis.TimeFreeze",
"EntryDll": "TimeFreeze.dll"