Skip to content

Commit

Permalink
By kwsch/PKHeX@d7473db, plugins can now be notified for language changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Manu098vm committed Jan 10, 2024
1 parent 45f1284 commit 4f43779
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions TeraFinder.Plugins/TeraPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void StandaloneInitialize(string defaultOT, ReadOnlySpan<byte> data = def
else
SAV = new SAV9SV
{
Game = (int)PKHeX.Core.GameVersion.SL,
Game = (int)GameVersion.SL,
OT = defaultOT,
Language = (int)GetLanguageID(language is not null ? language : Language),
};
Expand Down Expand Up @@ -310,7 +310,7 @@ public ConnectionForm LaunchConnector(Form? parent = null)

public void NotifySaveLoaded()
{
Language = PKHeX.Core.GameInfo.CurrentLanguage;
Language = GameInfo.CurrentLanguage;
TranslatePlugins();
if (SaveFileEditor.SAV is SAV9SV sav)
{
Expand All @@ -321,10 +321,16 @@ public void NotifySaveLoaded()
DisablePlugins();
}

public void NotifyDisplayLanguageChanged(string language)
{
Language = language;
TranslatePlugins();
}

public string GetSavName()
{
var ot = SAV.OT;
var game = (PKHeX.Core.GameVersion)SAV.Game;
var game = (GameVersion)SAV.Game;
var tid = (int)SAV.TrainerTID7;
return $"{game} - {ot} ({tid}) - {Language.ToUpper()}";
}
Expand Down

0 comments on commit 4f43779

Please sign in to comment.