1212using System . Windows ;
1313using System . Windows . Controls ;
1414using System . Windows . Input ;
15+ using System . Windows . Media ;
1516using UnityLauncherPro . Helpers ;
1617
1718namespace UnityLauncherPro
@@ -1378,6 +1379,11 @@ public static void OpenAppdataSpecialFolder(string subfolder)
13781379 public static void BuildProject ( Project proj , Platform platform )
13791380 {
13801381 Console . WriteLine ( "Building " + proj . Title + " for " + platform ) ;
1382+ SetStatus ( "Build process started: " + DateTime . Now . ToString ( "HH:mm:ss" ) ) ;
1383+
1384+ // TODO use theme colors, keep list of multiple builds, if click status button show list of builds, if click for single build (show output folder)
1385+ SetBuildStatus ( Colors . Red ) ;
1386+
13811387 if ( string . IsNullOrEmpty ( proj . Path ) ) return ;
13821388
13831389 // create builder script template (with template string, that can be replaced with project related paths or names?)
@@ -1454,7 +1460,7 @@ static string[] GetScenes()
14541460
14551461 // create commandline string for building and launch it
14561462 //var buildcmd = $"\"{unityExePath}\" -quit -batchmode -nographics -projectPath \"{proj.Path}\" -executeMethod \"Builder.BuildAndroid\" -buildTarget android -logFile -";
1457- var buildParams = $ " -quit -batchmode -nographics -projectPath \" { proj . Path } \" -executeMethod \" UnityLauncherProTools.Build{ platform } \" -buildTarget { platform } -logFile - ";
1463+ var buildParams = $ " -quit -batchmode -nographics -projectPath \" { proj . Path } \" -executeMethod \" UnityLauncherProTools.Build{ platform } \" -buildTarget { platform } -logFile \" { outputFolder } /../build.log \" ";
14581464 Console . WriteLine ( "buildcmd= " + buildParams ) ;
14591465
14601466 // launch build
@@ -1465,6 +1471,9 @@ static string[] GetScenes()
14651471 {
14661472 Console . WriteLine ( "Build process exited: " + outputFolder ) ;
14671473 Tools . ExploreFolder ( outputFolder ) ;
1474+ SetStatus ( "Build process finished: " + DateTime . Now . ToString ( "HH:mm:ss" ) ) ;
1475+ // TODO set color based on results
1476+ SetBuildStatus ( Colors . Green ) ;
14681477 } ;
14691478
14701479 }
@@ -1754,6 +1763,19 @@ internal static string GetBytesReadable(long i)
17541763 return readable . ToString ( "0.### " ) + suffix ;
17551764 }
17561765
1766+ public static MainWindow mainWindow ;
1767+
1768+ // set status bar in main thread
1769+ public static void SetStatus ( string text )
1770+ {
1771+ mainWindow . Dispatcher . Invoke ( ( ) => { mainWindow . SetStatus ( text ) ; } ) ;
1772+ }
1773+
1774+ public static void SetBuildStatus ( Color color )
1775+ {
1776+ mainWindow . Dispatcher . Invoke ( ( ) => { mainWindow . SetBuildStatus ( color ) ; } ) ;
1777+ }
1778+
17571779 } // class
17581780
17591781} // namespace
0 commit comments