Skip to content

Commit

Permalink
De-reference api.None
Browse files Browse the repository at this point in the history
Prevents the mod from creating the string cache on entry
  • Loading branch information
RuiNtD committed Oct 2, 2024
1 parent 5d9c816 commit cce581d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions RichPresenceMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,30 +88,28 @@ public override void Entry(IModHelper helper)
};

#region Default Tags
var None = api.None;

Tag("Activity", () => api.GamePresence);
Tag("ModCount", () => Helper.ModRegistry.GetAll().Count().ToString());
Tag("SMAPIVersion", () => Constants.ApiVersion.ToString());
Tag("StardewVersion", () => Game1.version);
Tag("RPCModVersion", () => ModManifest.Version.ToString());
Tag("Song", () => Utility.getSongTitleFromCueName(Game1.currentSong?.Name ?? None));
Tag("Song", () => Utility.getSongTitleFromCueName(Game1.currentSong?.Name ?? api.None));

WTag("Name", () => Game1.player.Name);
WTag(
"Farm",
() => Game1.content.LoadString("Strings\\UI:Inventory_FarmName", api.FormatTag("FarmName"))
);
WTag("FarmName", () => Game1.player.farmName.ToString());
WTag("PetName", () => Game1.player.hasPet() ? Game1.player.getPetDisplayName() : None);
WTag("PetName", () => Game1.player.hasPet() ? Game1.player.getPetDisplayName() : api.None);
WTag("Location", () => Game1.currentLocation.Name);
WTag(
"RomanticInterest",
() => Utility.getTopRomanticInterest(Game1.player)?.getName() ?? None
() => Utility.getTopRomanticInterest(Game1.player)?.getName() ?? api.None
);
WTag(
"NonRomanticInterest",
() => Utility.getTopNonRomanticInterest(Game1.player)?.getName() ?? None
() => Utility.getTopNonRomanticInterest(Game1.player)?.getName() ?? api.None
);

WTag(
Expand Down

0 comments on commit cce581d

Please sign in to comment.