Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on May 19, 2021. It is now read-only.

Commit ec591c9

Browse files
update lts version url, add colors to updates tab (non-installed versions as red) fixes #75
1 parent d6df006 commit ec591c9

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

‎UnityLauncher/Form1.cs‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public partial class Form1 : Form
2222
const string githubReleaseAPICheckURL = "https://api.github.com/repos/unitycoder/unitylauncher/releases/latest";
2323
const string githubReleasesLinkURL = "https://github.com/unitycoder/UnityLauncher/releases";
2424

25-
bool isDownloadUnityList = false;
25+
bool isDownloadingUnityList = false;
2626
string previousGitRelease = "0";
2727

2828

@@ -1145,12 +1145,12 @@ void DisplayUpgradeDialog(string currentVersion, string projectPath, bool launch
11451145

11461146
private void FetchListOfUnityUpdates()
11471147
{
1148-
if (isDownloadUnityList == true)
1148+
if (isDownloadingUnityList == true)
11491149
{
11501150
SetStatus("We are already downloading ...");
11511151
return;
11521152
}
1153-
isDownloadUnityList = true;
1153+
isDownloadingUnityList = true;
11541154
SetStatus("Downloading list of Unity versions ...");
11551155

11561156
// download list of Unity versions
@@ -1166,15 +1166,21 @@ private void UnityVersionsListDownloaded(object sender, DownloadStringCompletedE
11661166
{
11671167
// TODO check for error..
11681168
SetStatus("Downloading list of Unity versions ... done");
1169-
isDownloadUnityList = false;
1169+
isDownloadingUnityList = false;
1170+
11701171
// parse to list
1171-
var unityList = e.Result.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
1172-
Array.Reverse(unityList);
1172+
var receivedList = e.Result.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
1173+
Array.Reverse(receivedList);
11731174
gridUnityUpdates.Rows.Clear();
1174-
for (int i = 0, len = unityList.Length; i < len; i++)
1175+
// fill in, TODO: show only top 50 or so
1176+
for (int i = 0, len = receivedList.Length; i < len; i++)
11751177
{
1176-
var row = unityList[i].Split(',');
1177-
gridUnityUpdates.Rows.Add(row[3], row[6].Trim('"'));
1178+
var row = receivedList[i].Split(',');
1179+
var versionTemp = row[6].Trim('"');
1180+
gridUnityUpdates.Rows.Add(row[3], versionTemp);
1181+
1182+
// set color if we already have it installed
1183+
gridUnityUpdates.Rows[i].Cells[1].Style.ForeColor = unityList.ContainsKey(versionTemp) ? Color.Black : Color.Red;
11781184
}
11791185
}
11801186

‎UnityLauncher/Tools.cs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,12 @@ public static bool OpenReleaseNotes(string version)
174174
public static string GetUnityReleaseURL(string version)
175175
{
176176
string url = "";
177+
178+
177179
if (version.Contains("f")) // archived
178180
{
179181
version = Regex.Replace(version, @"f.", "", RegexOptions.IgnoreCase);
180-
string padding = "unity-";
182+
string padding = "";
181183
if (version.Contains("2018.2")) padding = "";
182184
url = "https://unity3d.com/unity/whats-new/" + padding + version;
183185
}
@@ -196,6 +198,7 @@ public static string GetUnityReleaseURL(string version)
196198
{
197199
url = "https://unity3d.com/unity/alpha/" + version;
198200
}
201+
199202
return url;
200203
}
201204

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /