@@ -22,7 +22,7 @@ public partial class Form1 : Form
22
22
const string githubReleaseAPICheckURL = "https://api.github.com/repos/unitycoder/unitylauncher/releases/latest" ;
23
23
const string githubReleasesLinkURL = "https://github.com/unitycoder/UnityLauncher/releases" ;
24
24
25
- bool isDownloadUnityList = false ;
25
+ bool isDownloadingUnityList = false ;
26
26
string previousGitRelease = "0" ;
27
27
28
28
@@ -1145,12 +1145,12 @@ void DisplayUpgradeDialog(string currentVersion, string projectPath, bool launch
1145
1145
1146
1146
private void FetchListOfUnityUpdates ( )
1147
1147
{
1148
- if ( isDownloadUnityList == true )
1148
+ if ( isDownloadingUnityList == true )
1149
1149
{
1150
1150
SetStatus ( "We are already downloading ..." ) ;
1151
1151
return ;
1152
1152
}
1153
- isDownloadUnityList = true ;
1153
+ isDownloadingUnityList = true ;
1154
1154
SetStatus ( "Downloading list of Unity versions ..." ) ;
1155
1155
1156
1156
// download list of Unity versions
@@ -1166,15 +1166,21 @@ private void UnityVersionsListDownloaded(object sender, DownloadStringCompletedE
1166
1166
{
1167
1167
// TODO check for error..
1168
1168
SetStatus ( "Downloading list of Unity versions ... done" ) ;
1169
- isDownloadUnityList = false ;
1169
+ isDownloadingUnityList = false ;
1170
+
1170
1171
// 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 ) ;
1173
1174
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 ++ )
1175
1177
{
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 ;
1178
1184
}
1179
1185
}
1180
1186
0 commit comments