diff --git a/OrnithologistsGuild/Content/ContentManager.cs b/OrnithologistsGuild/Content/ContentManager.cs index 01c3370..80918b5 100644 --- a/OrnithologistsGuild/Content/ContentManager.cs +++ b/OrnithologistsGuild/Content/ContentManager.cs @@ -48,7 +48,7 @@ private static void Edit_DataMail(IAssetData data) { var mail = data.AsDictionary().Data; // give lifelist - mail["Mods_Ivy_OrnithologistsGuild_Introduction"] = $"{I18n.Mail_Introduction()}%item id (T)Ivy_OrnithologistsGuild_LifeList %% %item conversationTopic Ivy_OrnithologistGuild_Introduction 14 %% [#]{I18n.Mail_Introduction_Title()}"; + mail["Mods_Ivy_OrnithologistsGuild_Introduction"] = $"{I18n.Mail_Introduction()}%item id {Constants.LIFE_LIST_FQID} %% %item conversationTopic Ivy_OrnithologistGuild_Introduction 14 %% [#]{I18n.Mail_Introduction_Title()}"; // 1 bird identified, mixed seeds mail["Mods_Ivy_OrnithologistsGuild_LifeList1"] = $"{I18n.Mail_LifeList1()}%item id (O)770 5 %% [#]{I18n.Mail_LifeList1_Title()}"; // 3 birds identified, corn diff --git a/OrnithologistsGuild/Game/GSQ.cs b/OrnithologistsGuild/Game/GameStateQueries.cs similarity index 83% rename from OrnithologistsGuild/Game/GSQ.cs rename to OrnithologistsGuild/Game/GameStateQueries.cs index fe65aae..aaa16e4 100644 --- a/OrnithologistsGuild/Game/GSQ.cs +++ b/OrnithologistsGuild/Game/GameStateQueries.cs @@ -8,7 +8,7 @@ namespace OrnithologistsGuild /// /// Add game state queries for use in conditions. /// - public static class GSQ + public static class GameStateQueries { private static IMonitor Monitor; @@ -34,7 +34,7 @@ public static bool IDENTIFIED_AT_LEAST(string[] query, GameStateQueryContext con Monitor.Log(error, LogLevel.Error); return false; } - return SaveDataManager.SaveData.ForPlayer(Game1.player.UniqueMultiplayerID).LifeList.IdentifiedCount >= identify; + return (SaveDataManager.SaveData?.ForPlayer(Game1.player.UniqueMultiplayerID).LifeList.IdentifiedCount ?? 0) >= identify; } /// @@ -46,7 +46,7 @@ public static bool IDENTIFIED_AT_LEAST(string[] query, GameStateQueryContext con /// public static bool IDENTIFIED_ALL(string[] query, GameStateQueryContext context) { - return SaveDataManager.SaveData.ForPlayer(Game1.player.UniqueMultiplayerID).LifeList.IdentifiedCount >= ContentPackManager.BirdieDefs.Count; + return (SaveDataManager.SaveData?.ForPlayer(Game1.player.UniqueMultiplayerID).LifeList.IdentifiedCount ?? 0) >= ContentPackManager.BirdieDefs.Count; } } } \ No newline at end of file diff --git a/OrnithologistsGuild/ModEntry.cs b/OrnithologistsGuild/ModEntry.cs index e166d08..2ab3f58 100644 --- a/OrnithologistsGuild/ModEntry.cs +++ b/OrnithologistsGuild/ModEntry.cs @@ -31,7 +31,7 @@ public override void Entry(IModHelper helper) Helper.Events.Input.ButtonPressed += Input_ButtonPressed; SaveDataManager.Initialize(); - GSQ.Initialize(ModManifest.UniqueID, Monitor); + GameStateQueries.Initialize(ModManifest.UniqueID, Monitor); } private void Input_ButtonPressed(object sender, ButtonPressedEventArgs e) @@ -52,7 +52,6 @@ private void GameLoop_SaveLoaded(object sender, SaveLoadedEventArgs e) MigrateLegacyItems(); SaveDataManager.Load(); - // Mail.Initialize(); NestManager.Initialize(); if (ConfigManager.Config.LogMissingBiomes)