bump all deprecation levels to 'pending removal'
This commit is contained in:
parent
136525b40d
commit
7cb523cd49
|
@ -33,6 +33,7 @@ For modders:
|
|||
* Fixed `SemanticVersion` not treating hyphens as separators when comparing prerelease tags.
|
||||
<small>_(While that was technically correct, it leads to unintuitive behaviour like sorting `-alpha-2` _after_ `-alpha-10`, even though `-alpha.2` sorts before `-alpha.10`.)_</small>
|
||||
* Fixed corrupted state exceptions not being logged by SMAPI.
|
||||
* Increased all deprecations to _pending removal_.
|
||||
|
||||
For SMAPI developers:
|
||||
* Added SMAPI 2.0 compile mode, for testing how mods will work with SMAPI 2.0.
|
||||
|
|
|
@ -95,7 +95,7 @@ namespace StardewModdingAPI
|
|||
/// <param name="monitor">Encapsulates monitoring and logging.</param>
|
||||
public static void CallCommand(string input, IMonitor monitor)
|
||||
{
|
||||
Command.DeprecationManager.Warn("Command.CallCommand", "1.9", DeprecationLevel.Info);
|
||||
Command.DeprecationManager.Warn("Command.CallCommand", "1.9", DeprecationLevel.PendingRemoval);
|
||||
Command.CommandManager.Trigger(input);
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ namespace StardewModdingAPI
|
|||
name = name?.Trim().ToLower();
|
||||
|
||||
// raise deprecation warning
|
||||
Command.DeprecationManager.Warn("Command.RegisterCommand", "1.9", DeprecationLevel.Info);
|
||||
Command.DeprecationManager.Warn("Command.RegisterCommand", "1.9", DeprecationLevel.PendingRemoval);
|
||||
|
||||
// validate
|
||||
if (Command.LegacyCommands.ContainsKey(name))
|
||||
|
@ -131,7 +131,7 @@ namespace StardewModdingAPI
|
|||
/// <param name="name">The command name to find.</param>
|
||||
public static Command FindCommand(string name)
|
||||
{
|
||||
Command.DeprecationManager.Warn("Command.FindCommand", "1.9", DeprecationLevel.Info);
|
||||
Command.DeprecationManager.Warn("Command.FindCommand", "1.9", DeprecationLevel.PendingRemoval);
|
||||
if (name == null)
|
||||
return null;
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ namespace StardewModdingAPI
|
|||
/// <summary>Construct an instance.</summary>
|
||||
protected Config()
|
||||
{
|
||||
Config.DeprecationManager.Warn("the Config class", "1.0", DeprecationLevel.Info);
|
||||
Config.DeprecationManager.Warn("the Config class", "1.0", DeprecationLevel.PendingRemoval);
|
||||
Config.DeprecationManager.MarkWarned($"{nameof(Mod)}.{nameof(Mod.BaseConfigPath)}", "1.0"); // typically used to construct config, avoid redundant warnings
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace StardewModdingAPI.Events
|
|||
{
|
||||
add
|
||||
{
|
||||
GameEvents.DeprecationManager.Warn($"{nameof(GameEvents)}.{nameof(GameEvents.Initialize)}", "1.10", DeprecationLevel.Info);
|
||||
GameEvents.DeprecationManager.Warn($"{nameof(GameEvents)}.{nameof(GameEvents.Initialize)}", "1.10", DeprecationLevel.PendingRemoval);
|
||||
GameEvents._Initialize += value;
|
||||
}
|
||||
remove => GameEvents._Initialize -= value;
|
||||
|
@ -61,7 +61,7 @@ namespace StardewModdingAPI.Events
|
|||
{
|
||||
add
|
||||
{
|
||||
GameEvents.DeprecationManager.Warn($"{nameof(GameEvents)}.{nameof(GameEvents.LoadContent)}", "1.10", DeprecationLevel.Info);
|
||||
GameEvents.DeprecationManager.Warn($"{nameof(GameEvents)}.{nameof(GameEvents.LoadContent)}", "1.10", DeprecationLevel.PendingRemoval);
|
||||
GameEvents._LoadContent += value;
|
||||
}
|
||||
remove => GameEvents._LoadContent -= value;
|
||||
|
@ -73,7 +73,7 @@ namespace StardewModdingAPI.Events
|
|||
{
|
||||
add
|
||||
{
|
||||
GameEvents.DeprecationManager.Warn($"{nameof(GameEvents)}.{nameof(GameEvents.GameLoaded)}", "1.12", DeprecationLevel.Info);
|
||||
GameEvents.DeprecationManager.Warn($"{nameof(GameEvents)}.{nameof(GameEvents.GameLoaded)}", "1.12", DeprecationLevel.PendingRemoval);
|
||||
GameEvents._GameLoaded += value;
|
||||
}
|
||||
remove => GameEvents._GameLoaded -= value;
|
||||
|
@ -85,7 +85,7 @@ namespace StardewModdingAPI.Events
|
|||
{
|
||||
add
|
||||
{
|
||||
GameEvents.DeprecationManager.Warn($"{nameof(GameEvents)}.{nameof(GameEvents.FirstUpdateTick)}", "1.12", DeprecationLevel.Info);
|
||||
GameEvents.DeprecationManager.Warn($"{nameof(GameEvents)}.{nameof(GameEvents.FirstUpdateTick)}", "1.12", DeprecationLevel.PendingRemoval);
|
||||
GameEvents._FirstUpdateTick += value;
|
||||
}
|
||||
remove => GameEvents._FirstUpdateTick -= value;
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace StardewModdingAPI.Events
|
|||
{
|
||||
add
|
||||
{
|
||||
PlayerEvents.DeprecationManager.Warn($"{nameof(PlayerEvents)}.{nameof(PlayerEvents.LoadedGame)}", "1.6", DeprecationLevel.Info);
|
||||
PlayerEvents.DeprecationManager.Warn($"{nameof(PlayerEvents)}.{nameof(PlayerEvents.LoadedGame)}", "1.6", DeprecationLevel.PendingRemoval);
|
||||
PlayerEvents._LoadedGame += value;
|
||||
}
|
||||
remove => PlayerEvents._LoadedGame -= value;
|
||||
|
@ -51,7 +51,7 @@ namespace StardewModdingAPI.Events
|
|||
{
|
||||
add
|
||||
{
|
||||
PlayerEvents.DeprecationManager.Warn($"{nameof(PlayerEvents)}.{nameof(PlayerEvents.FarmerChanged)}", "1.6", DeprecationLevel.Info);
|
||||
PlayerEvents.DeprecationManager.Warn($"{nameof(PlayerEvents)}.{nameof(PlayerEvents.FarmerChanged)}", "1.6", DeprecationLevel.PendingRemoval);
|
||||
PlayerEvents._FarmerChanged += value;
|
||||
}
|
||||
remove => PlayerEvents._FarmerChanged -= value;
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace StardewModdingAPI.Events
|
|||
{
|
||||
add
|
||||
{
|
||||
TimeEvents.DeprecationManager.Warn($"{nameof(TimeEvents)}.{nameof(TimeEvents.DayOfMonthChanged)}", "1.14", DeprecationLevel.Info);
|
||||
TimeEvents.DeprecationManager.Warn($"{nameof(TimeEvents)}.{nameof(TimeEvents.DayOfMonthChanged)}", "1.14", DeprecationLevel.PendingRemoval);
|
||||
TimeEvents._DayOfMonthChanged += value;
|
||||
}
|
||||
remove => TimeEvents._DayOfMonthChanged -= value;
|
||||
|
@ -61,7 +61,7 @@ namespace StardewModdingAPI.Events
|
|||
{
|
||||
add
|
||||
{
|
||||
TimeEvents.DeprecationManager.Warn($"{nameof(TimeEvents)}.{nameof(TimeEvents.YearOfGameChanged)}", "1.14", DeprecationLevel.Info);
|
||||
TimeEvents.DeprecationManager.Warn($"{nameof(TimeEvents)}.{nameof(TimeEvents.YearOfGameChanged)}", "1.14", DeprecationLevel.PendingRemoval);
|
||||
TimeEvents._YearOfGameChanged += value;
|
||||
}
|
||||
remove => TimeEvents._YearOfGameChanged -= value;
|
||||
|
@ -73,7 +73,7 @@ namespace StardewModdingAPI.Events
|
|||
{
|
||||
add
|
||||
{
|
||||
TimeEvents.DeprecationManager.Warn($"{nameof(TimeEvents)}.{nameof(TimeEvents.SeasonOfYearChanged)}", "1.14", DeprecationLevel.Info);
|
||||
TimeEvents.DeprecationManager.Warn($"{nameof(TimeEvents)}.{nameof(TimeEvents.SeasonOfYearChanged)}", "1.14", DeprecationLevel.PendingRemoval);
|
||||
TimeEvents._SeasonOfYearChanged += value;
|
||||
}
|
||||
remove => TimeEvents._SeasonOfYearChanged -= value;
|
||||
|
@ -85,7 +85,7 @@ namespace StardewModdingAPI.Events
|
|||
{
|
||||
add
|
||||
{
|
||||
TimeEvents.DeprecationManager.Warn($"{nameof(TimeEvents)}.{nameof(TimeEvents.OnNewDay)}", "1.6", DeprecationLevel.Info);
|
||||
TimeEvents.DeprecationManager.Warn($"{nameof(TimeEvents)}.{nameof(TimeEvents.OnNewDay)}", "1.6", DeprecationLevel.PendingRemoval);
|
||||
TimeEvents._OnNewDay += value;
|
||||
}
|
||||
remove => TimeEvents._OnNewDay -= value;
|
||||
|
|
|
@ -307,7 +307,7 @@ namespace StardewModdingAPI
|
|||
/// <summary>Raise a deprecation warning.</summary>
|
||||
private static void WarnDeprecated()
|
||||
{
|
||||
Log.DeprecationManager.Warn($"the {nameof(Log)} class", "1.1", DeprecationLevel.Info);
|
||||
Log.DeprecationManager.Warn($"the {nameof(Log)} class", "1.1", DeprecationLevel.PendingRemoval);
|
||||
}
|
||||
|
||||
/// <summary>Get the name of the mod logging a message from the stack.</summary>
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace StardewModdingAPI
|
|||
{
|
||||
get
|
||||
{
|
||||
Mod.DeprecationManager.Warn($"{nameof(Mod)}.{nameof(Mod.PathOnDisk)}", "1.0", DeprecationLevel.Info);
|
||||
Mod.DeprecationManager.Warn($"{nameof(Mod)}.{nameof(Mod.PathOnDisk)}", "1.0", DeprecationLevel.PendingRemoval);
|
||||
return this._pathOnDisk;
|
||||
}
|
||||
internal set { this._pathOnDisk = value; }
|
||||
|
@ -52,7 +52,7 @@ namespace StardewModdingAPI
|
|||
{
|
||||
get
|
||||
{
|
||||
Mod.DeprecationManager.Warn($"{nameof(Mod)}.{nameof(Mod.BaseConfigPath)}", "1.0", DeprecationLevel.Info);
|
||||
Mod.DeprecationManager.Warn($"{nameof(Mod)}.{nameof(Mod.BaseConfigPath)}", "1.0", DeprecationLevel.PendingRemoval);
|
||||
Mod.DeprecationManager.MarkWarned($"{nameof(Mod)}.{nameof(Mod.PathOnDisk)}", "1.0"); // avoid redundant warnings
|
||||
return Path.Combine(this.PathOnDisk, "config.json");
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ namespace StardewModdingAPI
|
|||
{
|
||||
get
|
||||
{
|
||||
Mod.DeprecationManager.Warn($"{nameof(Mod)}.{nameof(Mod.PerSaveConfigPath)}", "1.0", DeprecationLevel.Info);
|
||||
Mod.DeprecationManager.Warn($"{nameof(Mod)}.{nameof(Mod.PerSaveConfigPath)}", "1.0", DeprecationLevel.PendingRemoval);
|
||||
Mod.DeprecationManager.MarkWarned($"{nameof(Mod)}.{nameof(Mod.PerSaveConfigFolder)}", "1.0"); // avoid redundant warnings
|
||||
return Context.IsSaveLoaded ? Path.Combine(this.PerSaveConfigFolder, $"{Constants.SaveFolderName}.json") : "";
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ namespace StardewModdingAPI
|
|||
[Obsolete]
|
||||
private string GetPerSaveConfigFolder()
|
||||
{
|
||||
Mod.DeprecationManager.Warn($"{nameof(Mod)}.{nameof(Mod.PerSaveConfigFolder)}", "1.0", DeprecationLevel.Info);
|
||||
Mod.DeprecationManager.Warn($"{nameof(Mod)}.{nameof(Mod.PerSaveConfigFolder)}", "1.0", DeprecationLevel.PendingRemoval);
|
||||
Mod.DeprecationManager.MarkWarned($"{nameof(Mod)}.{nameof(Mod.PathOnDisk)}", "1.0"); // avoid redundant warnings
|
||||
|
||||
if (!((Manifest)this.ModManifest).PerSaveConfigs)
|
||||
|
|
|
@ -395,7 +395,7 @@ namespace StardewModdingAPI
|
|||
// per-save directories
|
||||
if ((mod.Manifest as Manifest)?.PerSaveConfigs == true)
|
||||
{
|
||||
deprecationWarnings.Add(() => this.DeprecationManager.Warn(mod.DisplayName, $"{nameof(Manifest)}.{nameof(Manifest.PerSaveConfigs)}", "1.0", DeprecationLevel.Info));
|
||||
deprecationWarnings.Add(() => this.DeprecationManager.Warn(mod.DisplayName, $"{nameof(Manifest)}.{nameof(Manifest.PerSaveConfigs)}", "1.0", DeprecationLevel.PendingRemoval));
|
||||
try
|
||||
{
|
||||
string psDir = Path.Combine(mod.DirectoryPath, "psconfigs");
|
||||
|
@ -753,7 +753,7 @@ namespace StardewModdingAPI
|
|||
|
||||
// raise deprecation warning for old Entry() methods
|
||||
if (this.DeprecationManager.IsVirtualMethodImplemented(mod.GetType(), typeof(Mod), nameof(Mod.Entry), new[] { typeof(object[]) }))
|
||||
deprecationWarnings.Add(() => this.DeprecationManager.Warn(metadata.DisplayName, $"{nameof(Mod)}.{nameof(Mod.Entry)}(object[]) instead of {nameof(Mod)}.{nameof(Mod.Entry)}({nameof(IModHelper)})", "1.0", DeprecationLevel.Info));
|
||||
deprecationWarnings.Add(() => this.DeprecationManager.Warn(metadata.DisplayName, $"{nameof(Mod)}.{nameof(Mod.Entry)}(object[]) instead of {nameof(Mod)}.{nameof(Mod.Entry)}({nameof(IModHelper)})", "1.0", DeprecationLevel.PendingRemoval));
|
||||
#endif
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
Loading…
Reference in New Issue