Fix formatting + game update issues

pull/21/head
Miepee 5 years ago
parent c6563ce5e5
commit 906ec2cefe

@ -53,10 +53,13 @@ namespace AM2RLauncher
SetPlayButtonState(UpdateState.Downloading);
progressBar.Visible = true;
progressLabel.Visible = true;
progressBar.Value = 0;
// Try to pull first.
try
{
progressBar.Visible = true;
await Task.Run(() => PullPatchData());
// thank you druid, for this case that should never happen
@ -95,6 +98,7 @@ namespace AM2RLauncher
finally
{
progressBar.Visible = false;
progressLabel.Visible = false;
LoadProfiles();
}
@ -810,9 +814,21 @@ namespace AM2RLauncher
/// </summary>
private void CustomMirrorTextBoxLostFocus(object sender, EventArgs e)
{
CrossPlatformOperations.WriteToConfig("CustomMirrorText", customMirrorTextBox.Text);
currentMirror = customMirrorTextBox.Text;
CrossPlatformOperations.WriteToConfig("CustomMirrorText", currentMirror);
log.Info("Overwriting mirror in gitconfig.");
//check if the gitConfig exists, if yes regex the gitURL, and replace it with the new current Mirror.
string gitConfigPath = CrossPlatformOperations.CURRENTPATH + "/PatchData/.git/config";
if (!File.Exists(gitConfigPath)) return;
string gitConfig = File.ReadAllText(gitConfigPath);
Regex gitURLRegex = new Regex("https://.*\\.git");
Match match = gitURLRegex.Match(gitConfig);
gitConfig = gitConfig.Replace(match.Value, currentMirror);
File.WriteAllText(gitConfigPath, gitConfig);
log.Info("Custom Mirror has been set to " + currentMirror + ".");
}

@ -229,6 +229,10 @@ namespace AM2RLauncher
settingsProfileDropDown.SelectedIndex = profileDropDown.Items.Count != 0 ? 0 : -1;
log.Info("Profiles loaded.");
// refresh the author and version label on the main tab
profileAuthorLabel.Text = Language.Text.Author + " " + profileList[profileDropDown.SelectedIndex].Author;
profileVersionLabel.Text = Language.Text.VersionLabel + " " + profileList[profileDropDown.SelectedIndex].Version;
}
/// <summary>

Loading…
Cancel
Save