From a2a0469cd024e2fd4b35503db152ba1a6df712ec Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 3 Dec 2018 01:43:02 -0500 Subject: deprecate old events (#606) --- src/SMAPI/Framework/DeprecationManager.cs | 6 ++++++ src/SMAPI/Framework/SCore.cs | 26 +++++++++++++------------- 2 files changed, 19 insertions(+), 13 deletions(-) (limited to 'src/SMAPI/Framework') diff --git a/src/SMAPI/Framework/DeprecationManager.cs b/src/SMAPI/Framework/DeprecationManager.cs index 0fde67ee..be564c22 100644 --- a/src/SMAPI/Framework/DeprecationManager.cs +++ b/src/SMAPI/Framework/DeprecationManager.cs @@ -35,6 +35,12 @@ namespace StardewModdingAPI.Framework this.ModRegistry = modRegistry; } + /// Log a deprecation warning for the old-style events. + public void WarnForOldEvents() + { + this.Warn("legacy events", "2.9", DeprecationLevel.Notice); + } + /// Log a deprecation warning. /// A noun phrase describing what is deprecated. /// The SMAPI version which deprecated it. diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 4b95917b..827ed82c 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -181,19 +181,19 @@ namespace StardewModdingAPI.Framework try { // hook up events - ContentEvents.Init(this.EventManager); - ControlEvents.Init(this.EventManager); - GameEvents.Init(this.EventManager); - GraphicsEvents.Init(this.EventManager); - InputEvents.Init(this.EventManager); - LocationEvents.Init(this.EventManager); - MenuEvents.Init(this.EventManager); - MineEvents.Init(this.EventManager); - MultiplayerEvents.Init(this.EventManager); - PlayerEvents.Init(this.EventManager); - SaveEvents.Init(this.EventManager); - SpecialisedEvents.Init(this.EventManager); - TimeEvents.Init(this.EventManager); + ContentEvents.Init(this.EventManager, this.DeprecationManager); + ControlEvents.Init(this.EventManager, this.DeprecationManager); + GameEvents.Init(this.EventManager, this.DeprecationManager); + GraphicsEvents.Init(this.EventManager, this.DeprecationManager); + InputEvents.Init(this.EventManager, this.DeprecationManager); + LocationEvents.Init(this.EventManager, this.DeprecationManager); + MenuEvents.Init(this.EventManager, this.DeprecationManager); + MineEvents.Init(this.EventManager, this.DeprecationManager); + MultiplayerEvents.Init(this.EventManager, this.DeprecationManager); + PlayerEvents.Init(this.EventManager, this.DeprecationManager); + SaveEvents.Init(this.EventManager, this.DeprecationManager); + SpecialisedEvents.Init(this.EventManager, this.DeprecationManager); + TimeEvents.Init(this.EventManager, this.DeprecationManager); // init JSON parser JsonConverter[] converters = { -- cgit