diff options
| author | Alex-TIMEHACK <[email protected]> | 2017-06-28 17:59:04 +0100 |
|---|---|---|
| committer | Alex-TIMEHACK <[email protected]> | 2017-06-28 17:59:04 +0100 |
| commit | 576326f8efc305c80ab45a44aad43d1f2a66e2b7 (patch) | |
| tree | be5fc6bb6bf2720ed4c07a438b008e4a28836e7f /TimeHACK.Main/Program.cs | |
| parent | 2044d74cbb23890440c066ad89c25d7b7eb4237e (diff) | |
| download | histacom2-576326f8efc305c80ab45a44aad43d1f2a66e2b7.tar.gz histacom2-576326f8efc305c80ab45a44aad43d1f2a66e2b7.tar.bz2 histacom2-576326f8efc305c80ab45a44aad43d1f2a66e2b7.zip | |
Increased startup performance
Diffstat (limited to 'TimeHACK.Main/Program.cs')
| -rw-r--r-- | TimeHACK.Main/Program.cs | 59 |
1 files changed, 36 insertions, 23 deletions
diff --git a/TimeHACK.Main/Program.cs b/TimeHACK.Main/Program.cs index 673ab07..72a7291 100644 --- a/TimeHACK.Main/Program.cs +++ b/TimeHACK.Main/Program.cs @@ -21,7 +21,7 @@ namespace TimeHACK internal static bool nightly = true; internal static string gameID; - internal static TitleScreen title = null; + internal static TitleScreen title; public static string AddressBookSelectedFolderName; public static AddressBookContact AddressBookSelectedContact; public static string WindowsExplorerReturnPath; @@ -34,26 +34,15 @@ namespace TimeHACK [STAThread] static void Main(string[] args) { - if (nightly == true) - { - try - { - WebClient wc = new WebClient(); + Application.SetCompatibleTextRenderingDefault(false); - // Set the GameID - string json = wc.DownloadString("http://ci.appveyor.com/api/projects/timehack/timehack"); - JObject j = JObject.Parse(JObject.Parse(json)["build"].ToString()); - gameID = "AppVeyor-" + j["buildNumber"].ToString(); - } - catch (WebException) - { - gameID = "AppVeyor"; - } - } - else - { - gameID = "TimeHACK 1.1"; - } + title = new TitleScreen(); + + gameID = "Getting AppVeyor..."; + System.Threading.Thread getAppVeyor = new System.Threading.Thread(GetAppVeyor); + + getAppVeyor.Start(); + System.Threading.Thread.Sleep(500); //TimeHACK.Engine.GameSave.SaveData MySaveData = new TimeHACK.Engine.GameSave.SaveData() //{ @@ -72,9 +61,8 @@ namespace TimeHACK //MySaveData = (TimeHACK.Engine.GameSave.SaveData)JsonConvert.DeserializeObject(TheJSON, MySaveData.GetType()); //MessageBox.Show(MySaveData.OS.ToString()); - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(title = new TitleScreen()); + Application.EnableVisualStyles(); + Application.Run(title); } public static String OpenFileExplorerAsDialogAndReturnGivenPath() @@ -100,5 +88,30 @@ namespace TimeHACK System.Threading.Thread.Sleep(1500); Application.Exit(); } + + public static void GetAppVeyor() + { + if (nightly == true) + { + try + { + WebClient wc = new WebClient(); + + // Set the GameID + string json = wc.DownloadString("http://ci.appveyor.com/api/projects/timehack/timehack"); + JObject j = JObject.Parse(JObject.Parse(json)["build"].ToString()); + gameID = "AppVeyor-" + j["buildNumber"].ToString(); + } + catch (WebException) + { + gameID = "AppVeyor"; + } + } + else + { + gameID = "TimeHACK 1.1"; + } + + } } } |
