Add RPC text when opening/closing a pck

This commit is contained in:
miku-666
2022-08-04 19:15:40 +02:00
parent 46ecfd6743
commit 5f3efa7e04
2 changed files with 6 additions and 0 deletions

View File

@@ -118,6 +118,9 @@ namespace PckStudio.Classes.FileTypes
return LocKeys[locKey];
}
public bool HasLocEntry(string locKey)
=> LocKeys.ContainsKey(locKey);
public string GetLocEntry(string locKey, string language)
{
if (!LocKeys.ContainsKey(locKey))

View File

@@ -142,6 +142,8 @@ namespace PckStudio
convertToBedrockToolStripMenuItem.Enabled = true;
BuildMainTreeView();
tabControl.SelectTab(1);
if (TryGetLocFile(out LOCFile locfile) && locfile.HasLocEntry("IDS_DISPLAY_NAME"))
RPC.SetPresence($"Editing a Pack: {locfile.GetLocEntry("IDS_DISPLAY_NAME", "en-EN")}", "Program by PhoenixARC");
}
private void CloseEditorTab()
@@ -161,6 +163,7 @@ namespace PckStudio
closeToolStripMenuItem.Visible = false;
fileEntryCountLabel.Text = "Files:0";
tabControl.SelectTab(0);
RPC.SetPresence("An Open Source .PCK File Editor", "Program by PhoenixARC");
}
/// <summary>