Skip to content

Commit f7ec679

Browse files
authored
Merge pull request #150 from SixParQuatre/master
Alpha Release Notes: Add support for 6000.0f version and fix bugs in comparison.
2 parents 8056e1e + bbf6a64 commit f7ec679

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

Diff for: UnityLauncherPro/GetUnityUpdates.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ public static async Task<string> Scan()
4444
return result;
4545
}
4646

47-
public static Updates[] Parse(string items)
47+
public static Updates[] Parse(string items, ref List<string> updatesAsString)
4848
{
49+
if (updatesAsString == null)
50+
updatesAsString = new List<string>();
51+
updatesAsString.Clear();
52+
4953
isDownloadingUnityList = false;
5054
//SetStatus("Downloading list of Unity versions ... done");
5155
var receivedList = items.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
@@ -68,6 +72,7 @@ public static Updates[] Parse(string items)
6872
u.ReleaseDate = DateTime.ParseExact(row[3], "MM/dd/yyyy", CultureInfo.InvariantCulture);
6973
u.Version = versionTemp;
7074
releases.Add(versionTemp, u);
75+
updatesAsString.Add(versionTemp);
7176
}
7277

7378
prevVersion = versionTemp;

Diff for: UnityLauncherPro/MainWindow.xaml.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public partial class MainWindow : Window
4646
System.Windows.Forms.NotifyIcon notifyIcon;
4747

4848
Updates[] updatesSource;
49+
public static List<string> updatesAsStrings;
4950

5051
string _filterString = null;
5152
bool multiWordSearch = false;
@@ -744,7 +745,7 @@ async Task CallGetUnityUpdates()
744745
var items = await task;
745746
//Console.WriteLine("CallGetUnityUpdates=" + items == null);
746747
if (items == null) return;
747-
updatesSource = GetUnityUpdates.Parse(items);
748+
updatesSource = GetUnityUpdates.Parse(items, ref updatesAsStrings);
748749
if (updatesSource == null) return;
749750
dataGridUpdates.ItemsSource = updatesSource;
750751
}
@@ -1034,7 +1035,7 @@ private async void OnTabSelectionChanged(object sender, SelectionChangedEventArg
10341035
var items = await task;
10351036
if (task.IsCompleted == false || task.IsFaulted == true) return;
10361037
if (items == null) return;
1037-
updatesSource = GetUnityUpdates.Parse(items);
1038+
updatesSource = GetUnityUpdates.Parse(items, ref updatesAsStrings);
10381039
if (updatesSource == null) return;
10391040
dataGridUpdates.ItemsSource = updatesSource;
10401041
}

Diff for: UnityLauncherPro/Tools.cs

+8-3
Original file line numberDiff line numberDiff line change
@@ -593,12 +593,17 @@ public static bool OpenReleaseNotes(string version)
593593

594594
//var url = Tools.GetUnityReleaseURL(version);
595595
string url = null;
596-
if (Properties.Settings.Default.useAlphaReleaseNotes && !version.Contains("6000"))
596+
bool noAlphaReleaseNotesPage = version.Contains("6000") && !version.Contains("f");
597+
if (Properties.Settings.Default.useAlphaReleaseNotes && !noAlphaReleaseNotesPage)
597598
{
599+
//with the alpha release notes, we want a diff between the 2 versions, but the site just shows all the changes inclusive of from
600+
// so we need to compare the currently selected version to the one right after it that is available (installed or not)
601+
598602
var closestVersion = Tools.FindNearestVersion(version, MainWindow.unityInstalledVersions.Keys.ToList(), true);
599-
if (closestVersion == null) closestVersion = version;
603+
var getNextVersionToClosest = closestVersion == null ? null : Tools.FindNearestVersion(version, MainWindow.updatesAsStrings);
604+
if (getNextVersionToClosest == null) getNextVersionToClosest = version;
600605

601-
url = "https://alpha.release-notes.ds.unity3d.com/search?fromVersion=" + closestVersion + "&toVersion=" + version;
606+
url = "https://alpha.release-notes.ds.unity3d.com/search?fromVersion=" + getNextVersionToClosest + "&toVersion=" + version;
602607
}
603608
else
604609
{

0 commit comments

Comments
 (0)