From 33015b39906221757aa2064127ea327c490a5da0 Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Wed, 26 Jan 2022 21:00:57 +0100 Subject: [PATCH] Make mirrorlist more dynamic --- .../AM2RLauncher/CrossPlatformOperations.cs | 4 ++-- AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/AM2RLauncher/AM2RLauncher/CrossPlatformOperations.cs b/AM2RLauncher/AM2RLauncher/CrossPlatformOperations.cs index 5f89725..7efb56d 100644 --- a/AM2RLauncher/AM2RLauncher/CrossPlatformOperations.cs +++ b/AM2RLauncher/AM2RLauncher/CrossPlatformOperations.cs @@ -85,8 +85,8 @@ namespace AM2RLauncher { return new List { - "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 + "https://github.com/Miepee/AM2R-Autopatcher-Mac.git" + //TODO: make mac official at some point:tm:, put this on gitlab }; } diff --git a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs index 82d784b..7cc9aac 100644 --- a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs +++ b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs @@ -229,12 +229,15 @@ namespace AM2RLauncher // Create mirror list // We do this as a list for 1) make this dynamic and 2) make ETO happy - mirrorDescriptionList = new List - { - new ListItem { Key = mirrorList[0], Text = Language.Text.MirrorGithubText }, - new ListItem { Key = mirrorList[1], Text = Language.Text.MirrorGitlabText} - }; - + mirrorDescriptionList = new List(); + // 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 + foreach (var mirror in mirrorList) + { + 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 Icon = new Icon(1f, am2rIcon);