Make mirrorlist more dynamic

pull/32/head
Miepee 5 years ago
parent c4d4df6664
commit 33015b3990

@ -85,8 +85,8 @@ namespace AM2RLauncher
{ {
return new List<string> return new List<string>
{ {
"https://github.com/Miepee/AM2R-Autopatcher-Mac.git", "https://github.com/Miepee/AM2R-Autopatcher-Mac.git"
"https://github.com/Miepee/AM2R-Autopatcher-Mac.git" //TODO: make mac official at some point:tm:, put this on gitlab //TODO: make mac official at some point:tm:, put this on gitlab
}; };
} }

@ -229,12 +229,15 @@ namespace AM2RLauncher
// Create mirror list // Create mirror list
// We do this as a list<listItem> for 1) make this dynamic and 2) make ETO happy // We do this as a list<listItem> for 1) make this dynamic and 2) make ETO happy
mirrorDescriptionList = new List<ListItem> mirrorDescriptionList = new List<ListItem>();
{ // Add each entry dynamically instead of harcoding it to two. If we have neither a github or gitlab mirror, we use the mirror itself as text
new ListItem { Key = mirrorList[0], Text = Language.Text.MirrorGithubText }, foreach (var mirror in mirrorList)
new ListItem { Key = mirrorList[1], Text = Language.Text.MirrorGitlabText} {
}; string text = mirror;
if (text.Contains("github.com")) text = Language.Text.MirrorGithubText;
else if (text.Contains("gitlab.com")) text = Language.Text.MirrorGitlabText;
mirrorDescriptionList.Add(new ListItem() { Key = mirror, Text = text });
}
#endregion #endregion
Icon = new Icon(1f, am2rIcon); Icon = new Icon(1f, am2rIcon);

Loading…
Cancel
Save