diff options
Diffstat (limited to 'ShiftOS.WinForms/MainMenu')
| -rw-r--r-- | ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs | 41 | ||||
| -rw-r--r-- | ShiftOS.WinForms/MainMenu/MainMenu.cs | 72 |
2 files changed, 101 insertions, 12 deletions
diff --git a/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs b/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs index a056866..b716b4e 100644 --- a/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs +++ b/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs @@ -49,10 +49,14 @@ this.btnnewgame = new System.Windows.Forms.Button(); this.btncontinue = new System.Windows.Forms.Button(); this.button10 = new System.Windows.Forms.Button(); + this.lbcurrentui = new System.Windows.Forms.Label(); + this.shiftos = new System.Windows.Forms.PictureBox(); + this.lbbuilddetails = new System.Windows.Forms.Label(); this.flmenu.SuspendLayout(); this.pnloptions.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout(); this.flcampaign.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.shiftos)).BeginInit(); this.SuspendLayout(); // // flmenu @@ -281,12 +285,45 @@ this.button10.UseVisualStyleBackColor = true; this.button10.Click += new System.EventHandler(this.button10_Click); // + // lbcurrentui + // + this.lbcurrentui.AutoSize = true; + this.lbcurrentui.Location = new System.Drawing.Point(704, 259); + this.lbcurrentui.Name = "lbcurrentui"; + this.lbcurrentui.Size = new System.Drawing.Size(35, 13); + this.lbcurrentui.TabIndex = 4; + this.lbcurrentui.Tag = "header2"; + this.lbcurrentui.Text = "label4"; + // + // shiftos + // + this.shiftos.Image = global::ShiftOS.WinForms.Properties.Resources.ShiftOSFull; + this.shiftos.Location = new System.Drawing.Point(432, 381); + this.shiftos.Name = "shiftos"; + this.shiftos.Size = new System.Drawing.Size(468, 109); + this.shiftos.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.shiftos.TabIndex = 5; + this.shiftos.TabStop = false; + // + // lbbuilddetails + // + this.lbbuilddetails.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lbbuilddetails.AutoSize = true; + this.lbbuilddetails.Location = new System.Drawing.Point(1, 553); + this.lbbuilddetails.Name = "lbbuilddetails"; + this.lbbuilddetails.Size = new System.Drawing.Size(35, 13); + this.lbbuilddetails.TabIndex = 6; + this.lbbuilddetails.Text = "label4"; + // // MainMenu // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Black; this.ClientSize = new System.Drawing.Size(1161, 566); + this.Controls.Add(this.lbbuilddetails); + this.Controls.Add(this.shiftos); + this.Controls.Add(this.lbcurrentui); this.Controls.Add(this.flcampaign); this.Controls.Add(this.pnloptions); this.Controls.Add(this.lbticker); @@ -301,6 +338,7 @@ this.flowLayoutPanel1.ResumeLayout(false); this.flowLayoutPanel1.PerformLayout(); this.flcampaign.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.shiftos)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -329,5 +367,8 @@ private System.Windows.Forms.Button btnnewgame; private System.Windows.Forms.Button btncontinue; private System.Windows.Forms.Button button10; + private System.Windows.Forms.Label lbcurrentui; + private System.Windows.Forms.PictureBox shiftos; + private System.Windows.Forms.Label lbbuilddetails; } }
\ No newline at end of file diff --git a/ShiftOS.WinForms/MainMenu/MainMenu.cs b/ShiftOS.WinForms/MainMenu/MainMenu.cs index 4b510e2..e11edc2 100644 --- a/ShiftOS.WinForms/MainMenu/MainMenu.cs +++ b/ShiftOS.WinForms/MainMenu/MainMenu.cs @@ -4,6 +4,7 @@ using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; @@ -18,12 +19,60 @@ namespace ShiftOS.WinForms.MainMenu { InitializeComponent(); (desk as WinformsDesktop).ParentMenu = this; + this.FormBorderStyle = FormBorderStyle.None; + this.WindowState = FormWindowState.Maximized; +#if DEBUG + var asm = Assembly.GetExecutingAssembly(); + string asmName = asm.GetName().Name; + string vstring = ""; + var version = asm.GetCustomAttributes(true).FirstOrDefault(x => x is AssemblyVersionAttribute) as AssemblyVersionAttribute; + if (version != null) + vstring = version.Version; + lbbuilddetails.Text = $"{asmName} - version number: {vstring} - THIS IS AN UNSTABLE RELEASE."; + +#else + lbbuilddetails.Hide(); +#endif + } + + public void HideOptions() + { + pnloptions.Hide(); + flmenu.BringToFront(); + flmenu.CenterParent(); + currentMenu = flmenu; + CategoryText = "Main menu"; + } + + public string CategoryText + { + get + { + return lbcurrentui.Text; + } + set + { + lbcurrentui.Text = value; + lbcurrentui.CenterParent(); + lbcurrentui.Top = currentMenu.Top - (lbcurrentui.Height * 2); + } + } + + private Control currentMenu = null; + + private void MainMenu_Load(object sender, EventArgs e) + { + Tools.ControlManager.SetupControls(this); + shiftos.CenterParent(); + shiftos.Top = 35; + + var tickermove = new Timer(); var tickerreset = new Timer(); tickermove.Tick += (o, a) => { - if(lbticker.Left <= (0 - lbticker.Width)) + if (lbticker.Left <= (0 - lbticker.Width)) { tickermove.Stop(); tickerreset.Start(); @@ -52,18 +101,9 @@ namespace ShiftOS.WinForms.MainMenu flmenu.CenterParent(); tickerreset.Start(); - } - public void HideOptions() - { - pnloptions.Hide(); - flmenu.BringToFront(); - flmenu.CenterParent(); - } - - private void MainMenu_Load(object sender, EventArgs e) - { - Tools.ControlManager.SetupControls(this); + currentMenu = flmenu; + CategoryText = "Main menu"; } @@ -110,6 +150,9 @@ namespace ShiftOS.WinForms.MainMenu flcampaign.Show(); flcampaign.BringToFront(); flcampaign.CenterParent(); + currentMenu = flcampaign; + CategoryText = "Campaign"; + } private void button5_Click(object sender, EventArgs e) @@ -135,6 +178,9 @@ namespace ShiftOS.WinForms.MainMenu pnloptions.Show(); pnloptions.BringToFront(); pnloptions.CenterParent(); + currentMenu = pnloptions; + CategoryText = "Settings"; + } private void opt_btncancel_Click(object sender, EventArgs e) @@ -187,6 +233,8 @@ namespace ShiftOS.WinForms.MainMenu flmenu.Show(); flmenu.BringToFront(); flmenu.CenterParent(); + currentMenu = flmenu; + CategoryText = "Main menu"; } private void btncontinue_Click(object sender, EventArgs e) |
