diff options
| author | lempamo <[email protected]> | 2017-07-01 11:33:34 -0400 |
|---|---|---|
| committer | lempamo <[email protected]> | 2017-07-01 11:33:34 -0400 |
| commit | 1e15555a88864a6398b3bc811cc22f62be203f7b (patch) | |
| tree | 2f5bace7a231b22ba7a74279ead0d4107df31175 /TimeHACK.Main/Program.cs | |
| parent | fc728100a39bff88215b0b21602afbda9ff6b00b (diff) | |
| parent | 6357242767ded19a6f30fc1c0ecd82c0bdc62ac4 (diff) | |
| download | histacom2-1e15555a88864a6398b3bc811cc22f62be203f7b.tar.gz histacom2-1e15555a88864a6398b3bc811cc22f62be203f7b.tar.bz2 histacom2-1e15555a88864a6398b3bc811cc22f62be203f7b.zip | |
Merge remote-tracking branch 'refs/remotes/TimeHACKDevs/master'
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"; + } + + } } } |
