Skip to content

Commit

Permalink
Address PR review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
greyivy committed Nov 23, 2024
1 parent b4cc1a2 commit 607d938
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion OrnithologistsGuild/Content/ContentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private static void Edit_DataMail(IAssetData data)
{
var mail = data.AsDictionary<string, string>().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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace OrnithologistsGuild
/// <summary>
/// Add game state queries for use in conditions.
/// </summary>
public static class GSQ
public static class GameStateQueries
{
private static IMonitor Monitor;

Expand All @@ -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;
}

/// <summary>
Expand All @@ -46,7 +46,7 @@ public static bool IDENTIFIED_AT_LEAST(string[] query, GameStateQueryContext con
/// <returns></returns>
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;
}
}
}
3 changes: 1 addition & 2 deletions OrnithologistsGuild/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -52,7 +52,6 @@ private void GameLoop_SaveLoaded(object sender, SaveLoadedEventArgs e)
MigrateLegacyItems();

SaveDataManager.Load();
// Mail.Initialize();
NestManager.Initialize();

if (ConfigManager.Config.LogMissingBiomes)
Expand Down

0 comments on commit 607d938

Please sign in to comment.