fix loading url & key again

This commit is contained in:
2024-06-22 18:58:07 +02:00
parent 80d41c869c
commit ade4f8f245

View File

@@ -45,7 +45,7 @@ public partial class Form1
{ {
RadTextBoxControl_MinecraftProfileFolder.Text = folderPath; RadTextBoxControl_MinecraftProfileFolder.Text = folderPath;
AppConfig.Instance.LastMinecraftProfilePath = folderPath; AppConfig.Instance.LastMinecraftProfilePath = folderPath;
CheckStatusAndUpdate(); CheckStatusAndUpdate(loadedProfile: true);
} }
private void LoadUpdateConfigFile(string filePath) private void LoadUpdateConfigFile(string filePath)
@@ -72,19 +72,22 @@ public partial class Form1
RadLabel_Status.SvgImage = null; RadLabel_Status.SvgImage = null;
} }
private void CheckStatusAndUpdate() private void CheckStatusAndUpdate(bool loadedProfile = false)
{ {
if (CheckStatus()) if (CheckStatus(loadedProfile))
RadButton_CheckForUpdates.PerformClick(); RadButton_CheckForUpdates.PerformClick();
} }
private bool CheckStatus() private bool CheckStatus(bool loadedProfile)
{ {
try try
{ {
modpackInfo = ModpackInfo.TryLoad(RadTextBoxControl_MinecraftProfileFolder.Text.Trim()); modpackInfo = ModpackInfo.TryLoad(RadTextBoxControl_MinecraftProfileFolder.Text.Trim());
RadTextBoxControl_ModpackConfig.Text = modpackInfo.ConfigUrl; if (loadedProfile)
radTextBoxControl_InstallKey.Text = modpackInfo.ExtrasKey; {
RadTextBoxControl_ModpackConfig.Text = modpackInfo.ConfigUrl;
radTextBoxControl_InstallKey.Text = modpackInfo.ExtrasKey;
}
} }
catch catch
{ {