@@ -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
0 commit comments