From ec0cba444e2eafee2209e20e1dfb520e9bb50895 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 6 Jul 2014 14:16:59 +0000 Subject: [PATCH] Gui option to start in full screen --- BizHawk.Client.Common/config/Config.cs | 1 + BizHawk.Client.EmuHawk/MainForm.cs | 8 +++++++- .../config/GuiOptions.Designer.cs | 13 +++++++++++++ BizHawk.Client.EmuHawk/config/GuiOptions.cs | 2 ++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.Common/config/Config.cs b/BizHawk.Client.Common/config/Config.cs index bf13eae389..8a02edf7f1 100644 --- a/BizHawk.Client.Common/config/Config.cs +++ b/BizHawk.Client.Common/config/Config.cs @@ -67,6 +67,7 @@ namespace BizHawk.Client.Common public bool PauseWhenMenuActivated = true; public bool SaveWindowPosition = true; public bool StartPaused = false; + public bool StartFullscreen = false; public int MainWndx = -1; // Negative numbers will be ignored public int MainWndy = -1; public bool RunInBackground = true; diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 293b6ea562..13e820698c 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -210,6 +210,7 @@ namespace BizHawk.Client.EmuHawk Location = new Point(Global.Config.MainWndx, Global.Config.MainWndy); } + bool startFullscreen = false; for (int i = 0; i < args.Length; i++) { // For some reason sometimes visual studio will pass this to us on the commandline. it makes no sense. @@ -248,7 +249,7 @@ namespace BizHawk.Client.EmuHawk } else if (arg.StartsWith("--fullscreen")) { - ToggleFullscreen(); + startFullscreen = true; } else { @@ -303,6 +304,11 @@ namespace BizHawk.Client.EmuHawk } } + if (startFullscreen || Global.Config.StartFullscreen) + { + ToggleFullscreen(); + } + if (cmdLoadState != null && Global.Game != null) { LoadQuickSave("QuickSave" + cmdLoadState); diff --git a/BizHawk.Client.EmuHawk/config/GuiOptions.Designer.cs b/BizHawk.Client.EmuHawk/config/GuiOptions.Designer.cs index 96ac661c5d..d5f60d235d 100644 --- a/BizHawk.Client.EmuHawk/config/GuiOptions.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/GuiOptions.Designer.cs @@ -88,6 +88,7 @@ this.RecentRomsNumeric = new System.Windows.Forms.NumericUpDown(); this.label11 = new System.Windows.Forms.Label(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.StartFullScreenCheckbox = new System.Windows.Forms.CheckBox(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage3.SuspendLayout(); @@ -144,6 +145,7 @@ // // tabPage1 // + this.tabPage1.Controls.Add(this.StartFullScreenCheckbox); this.tabPage1.Controls.Add(this.label14); this.tabPage1.Controls.Add(this.label3); this.tabPage1.Controls.Add(this.SingleInstanceModeCheckbox); @@ -844,6 +846,16 @@ this.label11.TabIndex = 0; this.label11.Text = "Roms"; // + // StartFullScreenCheckbox + // + this.StartFullScreenCheckbox.AutoSize = true; + this.StartFullScreenCheckbox.Location = new System.Drawing.Point(104, 100); + this.StartFullScreenCheckbox.Name = "StartFullScreenCheckbox"; + this.StartFullScreenCheckbox.Size = new System.Drawing.Size(107, 17); + this.StartFullScreenCheckbox.TabIndex = 13; + this.StartFullScreenCheckbox.Text = "Start in fullscreen"; + this.StartFullScreenCheckbox.UseVisualStyleBackColor = true; + // // EmuHawkOptions // this.AcceptButton = this.OkBtn; @@ -942,5 +954,6 @@ private System.Windows.Forms.CheckBox SaveLargeScreenshotsCheckbox; private System.Windows.Forms.NumericUpDown BigScreenshotNumeric; private System.Windows.Forms.Label KbLabel; + private System.Windows.Forms.CheckBox StartFullScreenCheckbox; } } \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/config/GuiOptions.cs b/BizHawk.Client.EmuHawk/config/GuiOptions.cs index 08265f8737..80bb5dc8d9 100644 --- a/BizHawk.Client.EmuHawk/config/GuiOptions.cs +++ b/BizHawk.Client.EmuHawk/config/GuiOptions.cs @@ -20,6 +20,7 @@ namespace BizHawk.Client.EmuHawk private void GuiOptions_Load(object sender, EventArgs e) { + StartFullScreenCheckbox.Checked = Global.Config.StartFullscreen; StartPausedCheckbox.Checked = Global.Config.StartPaused; PauseWhenMenuActivatedCheckbox.Checked = Global.Config.PauseWhenMenuActivated; EnableContextMenuCheckbox.Checked = Global.Config.ShowContextMenu; @@ -63,6 +64,7 @@ namespace BizHawk.Client.EmuHawk private void OkBtn_Click(object sender, EventArgs e) { + Global.Config.StartFullscreen = StartFullScreenCheckbox.Checked; Global.Config.StartPaused = StartPausedCheckbox.Checked; Global.Config.PauseWhenMenuActivated = PauseWhenMenuActivatedCheckbox.Checked; Global.Config.ShowContextMenu = EnableContextMenuCheckbox.Checked;