aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex-TIMEHACK <[email protected]>2017-06-28 17:59:04 +0100
committerAlex-TIMEHACK <[email protected]>2017-06-28 17:59:04 +0100
commit576326f8efc305c80ab45a44aad43d1f2a66e2b7 (patch)
treebe5fc6bb6bf2720ed4c07a438b008e4a28836e7f
parent2044d74cbb23890440c066ad89c25d7b7eb4237e (diff)
downloadhistacom2-576326f8efc305c80ab45a44aad43d1f2a66e2b7.tar.gz
histacom2-576326f8efc305c80ab45a44aad43d1f2a66e2b7.tar.bz2
histacom2-576326f8efc305c80ab45a44aad43d1f2a66e2b7.zip
Increased startup performance
-rw-r--r--TimeHACK.Main/Program.cs59
-rw-r--r--TimeHACK.Main/TitleScreen.Designer.cs401
-rw-r--r--TimeHACK.Main/TitleScreen.cs76
-rw-r--r--TimeHACK.Main/TitleScreen.resx6
4 files changed, 292 insertions, 250 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";
+ }
+
+ }
}
}
diff --git a/TimeHACK.Main/TitleScreen.Designer.cs b/TimeHACK.Main/TitleScreen.Designer.cs
index 3407357..26861fd 100644
--- a/TimeHACK.Main/TitleScreen.Designer.cs
+++ b/TimeHACK.Main/TitleScreen.Designer.cs
@@ -32,20 +32,8 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TitleScreen));
this.vmModeTimer = new System.Windows.Forms.Timer(this.components);
this.program = new System.Windows.Forms.Panel();
- this.toprightcorner = new System.Windows.Forms.Panel();
- this.bottomrightcorner = new System.Windows.Forms.Panel();
- this.bottomleftcorner = new System.Windows.Forms.Panel();
- this.topleftcorner = new System.Windows.Forms.Panel();
- this.panel2 = new System.Windows.Forms.Panel();
- this.startbutton = new System.Windows.Forms.PictureBox();
- this.gameversion = new System.Windows.Forms.Label();
- this.pictureBox1 = new System.Windows.Forms.PictureBox();
- this.vm_mode = new System.Windows.Forms.CheckBox();
- this.VM_Width = new System.Windows.Forms.NumericUpDown();
- this.VM_Height = new System.Windows.Forms.NumericUpDown();
+ this.programContent = new System.Windows.Forms.Panel();
this.startmenu = new System.Windows.Forms.Panel();
- this.ossidestartmenu = new System.Windows.Forms.Panel();
- this.osimage = new System.Windows.Forms.PictureBox();
this.startmenuitems = new System.Windows.Forms.MenuStrip();
this.DocumentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ProgramsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -55,18 +43,31 @@
this.TaskbarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.HelpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ShutdownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.programContent = new System.Windows.Forms.Panel();
+ this.ossidestartmenu = new System.Windows.Forms.Panel();
+ this.osimage = new System.Windows.Forms.PictureBox();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.VM_Height = new System.Windows.Forms.NumericUpDown();
+ this.VM_Width = new System.Windows.Forms.NumericUpDown();
+ this.vm_mode = new System.Windows.Forms.CheckBox();
+ this.pictureBox1 = new System.Windows.Forms.PictureBox();
+ this.gameversion = new System.Windows.Forms.Label();
+ this.startbutton = new System.Windows.Forms.PictureBox();
+ this.toprightcorner = new System.Windows.Forms.Panel();
+ this.bottomrightcorner = new System.Windows.Forms.Panel();
+ this.bottomleftcorner = new System.Windows.Forms.Panel();
+ this.topleftcorner = new System.Windows.Forms.Panel();
+ this.updateText = new System.Windows.Forms.Timer(this.components);
this.program.SuspendLayout();
- this.panel2.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.startbutton)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.VM_Width)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.VM_Height)).BeginInit();
+ this.programContent.SuspendLayout();
this.startmenu.SuspendLayout();
+ this.startmenuitems.SuspendLayout();
this.ossidestartmenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.osimage)).BeginInit();
- this.startmenuitems.SuspendLayout();
- this.programContent.SuspendLayout();
+ this.panel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.VM_Height)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.VM_Width)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.startbutton)).BeginInit();
this.SuspendLayout();
//
// vmModeTimer
@@ -87,145 +88,16 @@
this.program.Size = new System.Drawing.Size(800, 600);
this.program.TabIndex = 11;
//
- // toprightcorner
- //
- this.toprightcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.toprightcorner.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("toprightcorner.BackgroundImage")));
- this.toprightcorner.Location = new System.Drawing.Point(796, 0);
- this.toprightcorner.Name = "toprightcorner";
- this.toprightcorner.Size = new System.Drawing.Size(4, 4);
- this.toprightcorner.TabIndex = 6;
- //
- // bottomrightcorner
- //
- this.bottomrightcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.bottomrightcorner.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("bottomrightcorner.BackgroundImage")));
- this.bottomrightcorner.Cursor = System.Windows.Forms.Cursors.SizeNWSE;
- this.bottomrightcorner.Location = new System.Drawing.Point(796, 596);
- this.bottomrightcorner.Name = "bottomrightcorner";
- this.bottomrightcorner.Size = new System.Drawing.Size(4, 4);
- this.bottomrightcorner.TabIndex = 4;
- //
- // bottomleftcorner
- //
- this.bottomleftcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.bottomleftcorner.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("bottomleftcorner.BackgroundImage")));
- this.bottomleftcorner.Location = new System.Drawing.Point(0, 596);
- this.bottomleftcorner.Name = "bottomleftcorner";
- this.bottomleftcorner.Size = new System.Drawing.Size(4, 4);
- this.bottomleftcorner.TabIndex = 2;
- //
- // topleftcorner
- //
- this.topleftcorner.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("topleftcorner.BackgroundImage")));
- this.topleftcorner.Location = new System.Drawing.Point(0, 0);
- this.topleftcorner.Name = "topleftcorner";
- this.topleftcorner.Size = new System.Drawing.Size(4, 4);
- this.topleftcorner.TabIndex = 1;
- //
- // panel2
- //
- this.panel2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel2.BackgroundImage")));
- this.panel2.Controls.Add(this.VM_Height);
- this.panel2.Controls.Add(this.VM_Width);
- this.panel2.Controls.Add(this.vm_mode);
- this.panel2.Controls.Add(this.pictureBox1);
- this.panel2.Controls.Add(this.gameversion);
- this.panel2.Controls.Add(this.startbutton);
- this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.panel2.Location = new System.Drawing.Point(0, 572);
- this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(800, 28);
- this.panel2.TabIndex = 10;
- //
- // startbutton
- //
- this.startbutton.Image = ((System.Drawing.Image)(resources.GetObject("startbutton.Image")));
- this.startbutton.Location = new System.Drawing.Point(2, 4);
- this.startbutton.Name = "startbutton";
- this.startbutton.Size = new System.Drawing.Size(279, 22);
- this.startbutton.TabIndex = 12;
- this.startbutton.TabStop = false;
- this.startbutton.Click += new System.EventHandler(this.startbutton_Click);
- //
- // gameversion
- //
- this.gameversion.AutoSize = true;
- this.gameversion.BackColor = System.Drawing.Color.Transparent;
- this.gameversion.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.gameversion.Location = new System.Drawing.Point(25, 8);
- this.gameversion.Name = "gameversion";
- this.gameversion.Size = new System.Drawing.Size(78, 13);
- this.gameversion.TabIndex = 0;
- this.gameversion.Text = "gameversion";
- this.gameversion.Click += new System.EventHandler(this.startbutton_Click);
- this.gameversion.MouseLeave += new System.EventHandler(this.gameversion_MouseLeave);
- this.gameversion.MouseHover += new System.EventHandler(this.gameversion_MouseHover);
- //
- // pictureBox1
- //
- this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
- this.pictureBox1.Location = new System.Drawing.Point(603, 0);
- this.pictureBox1.Name = "pictureBox1";
- this.pictureBox1.Size = new System.Drawing.Size(187, 28);
- this.pictureBox1.TabIndex = 13;
- this.pictureBox1.TabStop = false;
- //
- // vm_mode
- //
- this.vm_mode.AutoSize = true;
- this.vm_mode.BackColor = System.Drawing.Color.Transparent;
- this.vm_mode.ForeColor = System.Drawing.Color.Black;
- this.vm_mode.Location = new System.Drawing.Point(712, 7);
- this.vm_mode.Name = "vm_mode";
- this.vm_mode.Size = new System.Drawing.Size(72, 17);
- this.vm_mode.TabIndex = 4;
- this.vm_mode.Text = "VM Mode";
- this.vm_mode.UseVisualStyleBackColor = false;
- //
- // VM_Width
- //
- this.VM_Width.Location = new System.Drawing.Point(605, 5);
- this.VM_Width.Maximum = new decimal(new int[] {
- 3840,
- 0,
- 0,
- 0});
- this.VM_Width.Minimum = new decimal(new int[] {
- 640,
- 0,
- 0,
- 0});
- this.VM_Width.Name = "VM_Width";
- this.VM_Width.Size = new System.Drawing.Size(50, 20);
- this.VM_Width.TabIndex = 14;
- this.VM_Width.Value = new decimal(new int[] {
- 640,
- 0,
- 0,
- 0});
- //
- // VM_Height
+ // programContent
//
- this.VM_Height.Location = new System.Drawing.Point(658, 5);
- this.VM_Height.Maximum = new decimal(new int[] {
- 2160,
- 0,
- 0,
- 0});
- this.VM_Height.Minimum = new decimal(new int[] {
- 480,
- 0,
- 0,
- 0});
- this.VM_Height.Name = "VM_Height";
- this.VM_Height.Size = new System.Drawing.Size(50, 20);
- this.VM_Height.TabIndex = 15;
- this.VM_Height.Value = new decimal(new int[] {
- 480,
- 0,
- 0,
- 0});
+ this.programContent.BackColor = System.Drawing.Color.Teal;
+ this.programContent.Controls.Add(this.startmenu);
+ this.programContent.Controls.Add(this.panel2);
+ this.programContent.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.programContent.Location = new System.Drawing.Point(0, 0);
+ this.programContent.Name = "programContent";
+ this.programContent.Size = new System.Drawing.Size(800, 600);
+ this.programContent.TabIndex = 9;
//
// startmenu
//
@@ -238,25 +110,6 @@
this.startmenu.Size = new System.Drawing.Size(174, 290);
this.startmenu.TabIndex = 11;
//
- // ossidestartmenu
- //
- this.ossidestartmenu.Controls.Add(this.osimage);
- this.ossidestartmenu.Location = new System.Drawing.Point(0, 0);
- this.ossidestartmenu.Name = "ossidestartmenu";
- this.ossidestartmenu.Size = new System.Drawing.Size(26, 297);
- this.ossidestartmenu.TabIndex = 4;
- //
- // osimage
- //
- this.osimage.BackColor = System.Drawing.Color.Gray;
- this.osimage.Dock = System.Windows.Forms.DockStyle.Fill;
- this.osimage.Location = new System.Drawing.Point(0, 0);
- this.osimage.Name = "osimage";
- this.osimage.Size = new System.Drawing.Size(26, 297);
- this.osimage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
- this.osimage.TabIndex = 0;
- this.osimage.TabStop = false;
- //
// startmenuitems
//
this.startmenuitems.BackColor = System.Drawing.Color.Silver;
@@ -375,16 +228,169 @@
this.ShutdownToolStripMenuItem.Text = "Shut Down...";
this.ShutdownToolStripMenuItem.Click += new System.EventHandler(this.Exit_Click);
//
- // programContent
+ // ossidestartmenu
//
- this.programContent.BackColor = System.Drawing.Color.Teal;
- this.programContent.Controls.Add(this.startmenu);
- this.programContent.Controls.Add(this.panel2);
- this.programContent.Dock = System.Windows.Forms.DockStyle.Fill;
- this.programContent.Location = new System.Drawing.Point(0, 0);
- this.programContent.Name = "programContent";
- this.programContent.Size = new System.Drawing.Size(800, 600);
- this.programContent.TabIndex = 9;
+ this.ossidestartmenu.Controls.Add(this.osimage);
+ this.ossidestartmenu.Location = new System.Drawing.Point(0, 0);
+ this.ossidestartmenu.Name = "ossidestartmenu";
+ this.ossidestartmenu.Size = new System.Drawing.Size(26, 297);
+ this.ossidestartmenu.TabIndex = 4;
+ //
+ // osimage
+ //
+ this.osimage.BackColor = System.Drawing.Color.Gray;
+ this.osimage.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.osimage.Location = new System.Drawing.Point(0, 0);
+ this.osimage.Name = "osimage";
+ this.osimage.Size = new System.Drawing.Size(26, 297);
+ this.osimage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
+ this.osimage.TabIndex = 0;
+ this.osimage.TabStop = false;
+ //
+ // panel2
+ //
+ this.panel2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel2.BackgroundImage")));
+ this.panel2.Controls.Add(this.VM_Height);
+ this.panel2.Controls.Add(this.VM_Width);
+ this.panel2.Controls.Add(this.vm_mode);
+ this.panel2.Controls.Add(this.pictureBox1);
+ this.panel2.Controls.Add(this.gameversion);
+ this.panel2.Controls.Add(this.startbutton);
+ this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.panel2.Location = new System.Drawing.Point(0, 572);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(800, 28);
+ this.panel2.TabIndex = 10;
+ //
+ // VM_Height
+ //
+ this.VM_Height.Location = new System.Drawing.Point(658, 5);
+ this.VM_Height.Maximum = new decimal(new int[] {
+ 2160,
+ 0,
+ 0,
+ 0});
+ this.VM_Height.Minimum = new decimal(new int[] {
+ 480,
+ 0,
+ 0,
+ 0});
+ this.VM_Height.Name = "VM_Height";
+ this.VM_Height.Size = new System.Drawing.Size(50, 20);
+ this.VM_Height.TabIndex = 15;
+ this.VM_Height.Value = new decimal(new int[] {
+ 480,
+ 0,
+ 0,
+ 0});
+ //
+ // VM_Width
+ //
+ this.VM_Width.Location = new System.Drawing.Point(605, 5);
+ this.VM_Width.Maximum = new decimal(new int[] {
+ 3840,
+ 0,
+ 0,
+ 0});
+ this.VM_Width.Minimum = new decimal(new int[] {
+ 640,
+ 0,
+ 0,
+ 0});
+ this.VM_Width.Name = "VM_Width";
+ this.VM_Width.Size = new System.Drawing.Size(50, 20);
+ this.VM_Width.TabIndex = 14;
+ this.VM_Width.Value = new decimal(new int[] {
+ 640,
+ 0,
+ 0,
+ 0});
+ //
+ // vm_mode
+ //
+ this.vm_mode.AutoSize = true;
+ this.vm_mode.BackColor = System.Drawing.Color.Transparent;
+ this.vm_mode.ForeColor = System.Drawing.Color.Black;
+ this.vm_mode.Location = new System.Drawing.Point(712, 7);
+ this.vm_mode.Name = "vm_mode";
+ this.vm_mode.Size = new System.Drawing.Size(72, 17);
+ this.vm_mode.TabIndex = 4;
+ this.vm_mode.Text = "VM Mode";
+ this.vm_mode.UseVisualStyleBackColor = false;
+ //
+ // pictureBox1
+ //
+ this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
+ this.pictureBox1.Location = new System.Drawing.Point(603, 0);
+ this.pictureBox1.Name = "pictureBox1";
+ this.pictureBox1.Size = new System.Drawing.Size(187, 28);
+ this.pictureBox1.TabIndex = 13;
+ this.pictureBox1.TabStop = false;
+ //
+ // gameversion
+ //
+ this.gameversion.AutoSize = true;
+ this.gameversion.BackColor = System.Drawing.Color.Transparent;
+ this.gameversion.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.gameversion.Location = new System.Drawing.Point(25, 8);
+ this.gameversion.Name = "gameversion";
+ this.gameversion.Size = new System.Drawing.Size(78, 13);
+ this.gameversion.TabIndex = 0;
+ this.gameversion.Text = "gameversion";
+ this.gameversion.Click += new System.EventHandler(this.startbutton_Click);
+ this.gameversion.MouseLeave += new System.EventHandler(this.gameversion_MouseLeave);
+ this.gameversion.MouseHover += new System.EventHandler(this.gameversion_MouseHover);
+ //
+ // startbutton
+ //
+ this.startbutton.Image = ((System.Drawing.Image)(resources.GetObject("startbutton.Image")));
+ this.startbutton.Location = new System.Drawing.Point(2, 4);
+ this.startbutton.Name = "startbutton";
+ this.startbutton.Size = new System.Drawing.Size(279, 22);
+ this.startbutton.TabIndex = 12;
+ this.startbutton.TabStop = false;
+ this.startbutton.Click += new System.EventHandler(this.startbutton_Click);
+ //
+ // toprightcorner
+ //
+ this.toprightcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.toprightcorner.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("toprightcorner.BackgroundImage")));
+ this.toprightcorner.Location = new System.Drawing.Point(796, 0);
+ this.toprightcorner.Name = "toprightcorner";
+ this.toprightcorner.Size = new System.Drawing.Size(4, 4);
+ this.toprightcorner.TabIndex = 6;
+ //
+ // bottomrightcorner
+ //
+ this.bottomrightcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.bottomrightcorner.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("bottomrightcorner.BackgroundImage")));
+ this.bottomrightcorner.Cursor = System.Windows.Forms.Cursors.SizeNWSE;
+ this.bottomrightcorner.Location = new System.Drawing.Point(796, 596);
+ this.bottomrightcorner.Name = "bottomrightcorner";
+ this.bottomrightcorner.Size = new System.Drawing.Size(4, 4);
+ this.bottomrightcorner.TabIndex = 4;
+ //
+ // bottomleftcorner
+ //
+ this.bottomleftcorner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.bottomleftcorner.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("bottomleftcorner.BackgroundImage")));
+ this.bottomleftcorner.Location = new System.Drawing.Point(0, 596);
+ this.bottomleftcorner.Name = "bottomleftcorner";
+ this.bottomleftcorner.Size = new System.Drawing.Size(4, 4);
+ this.bottomleftcorner.TabIndex = 2;
+ //
+ // topleftcorner
+ //
+ this.topleftcorner.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("topleftcorner.BackgroundImage")));
+ this.topleftcorner.Location = new System.Drawing.Point(0, 0);
+ this.topleftcorner.Name = "topleftcorner";
+ this.topleftcorner.Size = new System.Drawing.Size(4, 4);
+ this.topleftcorner.TabIndex = 1;
+ //
+ // updateText
+ //
+ this.updateText.Enabled = true;
+ this.updateText.Tick += new System.EventHandler(this.updateText_Tick);
//
// TitleScreen
//
@@ -399,19 +405,19 @@
this.Text = "TimeHACK Launcher";
this.Load += new System.EventHandler(this.TitleScreen_Load);
this.program.ResumeLayout(false);
- this.panel2.ResumeLayout(false);
- this.panel2.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.startbutton)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.VM_Width)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.VM_Height)).EndInit();
+ this.programContent.ResumeLayout(false);
this.startmenu.ResumeLayout(false);
this.startmenu.PerformLayout();
- this.ossidestartmenu.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.osimage)).EndInit();
this.startmenuitems.ResumeLayout(false);
this.startmenuitems.PerformLayout();
- this.programContent.ResumeLayout(false);
+ this.ossidestartmenu.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.osimage)).EndInit();
+ this.panel2.ResumeLayout(false);
+ this.panel2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.VM_Height)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.VM_Width)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.startbutton)).EndInit();
this.ResumeLayout(false);
}
@@ -441,7 +447,8 @@
private System.Windows.Forms.NumericUpDown VM_Width;
private System.Windows.Forms.CheckBox vm_mode;
internal System.Windows.Forms.PictureBox pictureBox1;
- private System.Windows.Forms.Label gameversion;
+ public System.Windows.Forms.Label gameversion;
internal System.Windows.Forms.PictureBox startbutton;
+ private System.Windows.Forms.Timer updateText;
}
} \ No newline at end of file
diff --git a/TimeHACK.Main/TitleScreen.cs b/TimeHACK.Main/TitleScreen.cs
index 977f1e5..cdf6ec2 100644
--- a/TimeHACK.Main/TitleScreen.cs
+++ b/TimeHACK.Main/TitleScreen.cs
@@ -44,14 +44,43 @@ namespace TimeHACK
[DllImportAttribute("user32.dll")]
public static extern bool ReleaseCapture();
+
+ public TitleScreen()
+ {
+ InitializeComponent();
+
+ // Add the WINDOWS BORDERS from the Window Manager
+
+ FieldInfo f1 = typeof(Control).GetField("EventMouseDown",
+ BindingFlags.Static | BindingFlags.NonPublic);
+ object obj = f1.GetValue(borders.programtopbar);
+ PropertyInfo pi = borders.programtopbar.GetType().GetProperty("Events",
+ BindingFlags.NonPublic | BindingFlags.Instance);
+ EventHandlerList list = (EventHandlerList)pi.GetValue(borders.programtopbar, null);
+ list.RemoveHandler(obj, list[obj]);
+
+ borders.programtopbar.MouseDown += new MouseEventHandler(TitleBarDrag);
+ borders.programtopbar.Controls.Find("closebutton", false)[0].MouseClick += new MouseEventHandler(closeButton);
+ borders.programtopbar.Controls.Find("maximizebutton", false)[0].MouseClick += new MouseEventHandler(MaximiseButton);
+
+ this.Controls.Add(borders.programtopbar);
+ this.Controls.Add(borders.top);
+ this.Controls.Add(borders.right);
+ this.Controls.Add(borders.left);
+ this.Controls.Add(borders.bottom);
+
+
+ }
+
public void StartGame()
- {
+ {
//TODO: You may want to handle story stuff to decide what OS to boot here.
if (Convert.ToInt32(VM_Width.Text) == 1337 && Convert.ToInt32(VM_Height.Text) == 1337)
{
leet();
}
- else {
+ else
+ {
// Time to decide which OS to start up!
switch (CurrentSave.CurrentOS)
@@ -93,35 +122,13 @@ namespace TimeHACK
troubleshooter.ShowDialog();
break;
}
-
- }
- }
+ }
+ }
- public TitleScreen()
+ public void UpdateGameVersionText()
{
- InitializeComponent();
-
- // Add the WINDOWS BORDERS from the Window Manager
-
- FieldInfo f1 = typeof(Control).GetField("EventMouseDown",
- BindingFlags.Static | BindingFlags.NonPublic);
- object obj = f1.GetValue(borders.programtopbar);
- PropertyInfo pi = borders.programtopbar.GetType().GetProperty("Events",
- BindingFlags.NonPublic | BindingFlags.Instance);
- EventHandlerList list = (EventHandlerList)pi.GetValue(borders.programtopbar, null);
- list.RemoveHandler(obj, list[obj]);
-
- borders.programtopbar.MouseDown += new MouseEventHandler(TitleBarDrag);
- borders.programtopbar.Controls.Find("closebutton", false)[0].MouseClick += new MouseEventHandler(closeButton);
- borders.programtopbar.Controls.Find("maximizebutton", false)[0].MouseClick += new MouseEventHandler(MaximiseButton);
-
- this.Controls.Add(borders.programtopbar);
- this.Controls.Add(borders.right);
- this.Controls.Add(borders.left);
- this.Controls.Add(borders.bottom);
-
-
+ gameversion.Text = Program.gameID;
}
void TitleBarDrag(object sender, MouseEventArgs e)
@@ -189,7 +196,7 @@ namespace TimeHACK
// Set GameVersion
- gameversion.Text = "TimeHACK " + Program.gameID;
+ gameversion.Text = Program.gameID;
// Initialize Font
File.WriteAllBytes(Data + "\\LeviWindows.ttf", Resources.LeviWindows);
@@ -333,7 +340,7 @@ namespace TimeHACK
private void gameversion_MouseLeave(object sender, EventArgs e)
{
- gameversion.Text = "TimeHACK " + Program.gameID;
+ gameversion.Text = Program.gameID;
}
private void startbutton_Click(object sender, EventArgs e)
@@ -353,5 +360,14 @@ namespace TimeHACK
{
Application.Exit();
}
+
+ private void updateText_Tick(object sender, EventArgs e)
+ {
+ if (gameversion.Text != Program.gameID)
+ {
+ gameversion.Text = Program.gameID;
+ updateText.Stop();
+ }
+ }
}
}
diff --git a/TimeHACK.Main/TitleScreen.resx b/TimeHACK.Main/TitleScreen.resx
index 590f57a..9d7a9cb 100644
--- a/TimeHACK.Main/TitleScreen.resx
+++ b/TimeHACK.Main/TitleScreen.resx
@@ -123,6 +123,9 @@
<metadata name="startmenuitems.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>153, 17</value>
</metadata>
+ <metadata name="startmenuitems.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>153, 17</value>
+ </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="ControlPanelToolStripMenuItem.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
@@ -199,6 +202,9 @@
/DQcgTj/YQDKQZEBcY6fBgAaSCiZEc9BxAAAAABJRU5ErkJggg==
</value>
</data>
+ <metadata name="updateText.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>289, 17</value>
+ </metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>47</value>
</metadata>