diff --git a/BizHawk.Client.Common/config/Config.cs b/BizHawk.Client.Common/config/Config.cs index fc6d618128..f3e34b79d1 100644 --- a/BizHawk.Client.Common/config/Config.cs +++ b/BizHawk.Client.Common/config/Config.cs @@ -349,6 +349,10 @@ namespace BizHawk.Client.Common public ToolDialogSettings SmsVdpSettings = new ToolDialogSettings(); public bool SmsVdpAutoLoad = false; + // PCE VDP Viewer Settings + public ToolDialogSettings PceVdpSettings = new ToolDialogSettings(); + public bool PceVdpAutoLoad = false; + // NESPPU Settings public ToolDialogSettings NesPPUSettings = new ToolDialogSettings(); public bool AutoLoadNESPPU = false; diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 6056658d6e..8f3704ad98 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -349,6 +349,11 @@ namespace BizHawk.Client.EmuHawk GlobalWin.Tools.Load(); } + if (Global.Config.PceVdpAutoLoad && Global.Emulator is PCEngine) + { + GlobalWin.Tools.Load(); + } + if (Global.Config.RecentPceCdlFiles.AutoLoad && Global.Emulator is PCEngine) { GlobalWin.Tools.Load(); diff --git a/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.Designer.cs b/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.Designer.cs index 696b546e37..b06a73a3ea 100644 --- a/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.Designer.cs @@ -37,15 +37,27 @@ this.bmpViewSP = new BizHawk.Client.EmuHawk.BmpView(); this.checkBoxVDC2 = new System.Windows.Forms.CheckBox(); this.label1 = new System.Windows.Forms.Label(); + this.menuStrip1 = new MenuStripEx(); + this.FileSubMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.saveBackgroundScreenshotToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveSpriteScreenshotToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.OptionsSubMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.autoloadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.alwaysOnTopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.floatingWindowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); + this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // // groupBox1 // this.groupBox1.Controls.Add(this.bmpViewBGPal); this.groupBox1.Controls.Add(this.bmpViewBG); - this.groupBox1.Location = new System.Drawing.Point(12, 12); + this.groupBox1.Location = new System.Drawing.Point(12, 25); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(786, 281); this.groupBox1.TabIndex = 4; @@ -73,7 +85,7 @@ // this.groupBox2.Controls.Add(this.bmpViewSPPal); this.groupBox2.Controls.Add(this.bmpViewSP); - this.groupBox2.Location = new System.Drawing.Point(12, 299); + this.groupBox2.Location = new System.Drawing.Point(12, 312); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(786, 281); this.groupBox2.TabIndex = 5; @@ -100,7 +112,7 @@ // checkBoxVDC2 // this.checkBoxVDC2.AutoSize = true; - this.checkBoxVDC2.Location = new System.Drawing.Point(12, 586); + this.checkBoxVDC2.Location = new System.Drawing.Point(12, 599); this.checkBoxVDC2.Name = "checkBoxVDC2"; this.checkBoxVDC2.Size = new System.Drawing.Size(57, 17); this.checkBoxVDC2.TabIndex = 6; @@ -111,28 +123,123 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(504, 593); + this.label1.Location = new System.Drawing.Point(504, 599); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(294, 13); this.label1.TabIndex = 7; this.label1.Text = "CTRL + C copies the pane under the mouse to the clipboard."; // + // menuStrip1 + // + this.menuStrip1.ClickThrough = true; + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.FileSubMenu, + this.OptionsSubMenu}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(810, 24); + this.menuStrip1.TabIndex = 8; + this.menuStrip1.Text = "menuStrip1"; + // + // FileSubMenu + // + this.FileSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.saveBackgroundScreenshotToolStripMenuItem, + this.saveSpriteScreenshotToolStripMenuItem, + this.toolStripSeparator1, + this.closeToolStripMenuItem}); + this.FileSubMenu.Name = "FileSubMenu"; + this.FileSubMenu.Size = new System.Drawing.Size(37, 20); + this.FileSubMenu.Text = "&File"; + // + // saveBackgroundScreenshotToolStripMenuItem + // + this.saveBackgroundScreenshotToolStripMenuItem.Name = "saveBackgroundScreenshotToolStripMenuItem"; + this.saveBackgroundScreenshotToolStripMenuItem.Size = new System.Drawing.Size(201, 22); + this.saveBackgroundScreenshotToolStripMenuItem.Text = "Save BG Screenshot..."; + this.saveBackgroundScreenshotToolStripMenuItem.Click += new System.EventHandler(this.saveBackgroundScreenshotToolStripMenuItem_Click); + // + // saveSpriteScreenshotToolStripMenuItem + // + this.saveSpriteScreenshotToolStripMenuItem.Name = "saveSpriteScreenshotToolStripMenuItem"; + this.saveSpriteScreenshotToolStripMenuItem.Size = new System.Drawing.Size(201, 22); + this.saveSpriteScreenshotToolStripMenuItem.Text = "Save Sprite Screenshot..."; + this.saveSpriteScreenshotToolStripMenuItem.Click += new System.EventHandler(this.saveSpriteScreenshotToolStripMenuItem_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(198, 6); + // + // closeToolStripMenuItem + // + this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; + this.closeToolStripMenuItem.ShortcutKeyDisplayString = "Alt+F4"; + this.closeToolStripMenuItem.Size = new System.Drawing.Size(201, 22); + this.closeToolStripMenuItem.Text = "&Close"; + this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click); + // + // OptionsSubMenu + // + this.OptionsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.autoloadToolStripMenuItem, + this.saveWindowPositionToolStripMenuItem, + this.alwaysOnTopToolStripMenuItem, + this.floatingWindowToolStripMenuItem}); + this.OptionsSubMenu.Name = "OptionsSubMenu"; + this.OptionsSubMenu.Size = new System.Drawing.Size(61, 20); + this.OptionsSubMenu.Text = "&Options"; + this.OptionsSubMenu.DropDownOpened += new System.EventHandler(this.OptionsSubMenu_DropDownOpened); + // + // autoloadToolStripMenuItem + // + this.autoloadToolStripMenuItem.Name = "autoloadToolStripMenuItem"; + this.autoloadToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.autoloadToolStripMenuItem.Text = "&Autoload"; + this.autoloadToolStripMenuItem.Click += new System.EventHandler(this.autoloadToolStripMenuItem_Click); + // + // saveWindowPositionToolStripMenuItem + // + this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem"; + this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.saveWindowPositionToolStripMenuItem.Text = "Save Window Position"; + this.saveWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click); + // + // alwaysOnTopToolStripMenuItem + // + this.alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem"; + this.alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.alwaysOnTopToolStripMenuItem.Text = "Always On Top"; + this.alwaysOnTopToolStripMenuItem.Click += new System.EventHandler(this.alwaysOnTopToolStripMenuItem_Click); + // + // floatingWindowToolStripMenuItem + // + this.floatingWindowToolStripMenuItem.Name = "floatingWindowToolStripMenuItem"; + this.floatingWindowToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.floatingWindowToolStripMenuItem.Text = "Floating Window"; + this.floatingWindowToolStripMenuItem.Click += new System.EventHandler(this.floatingWindowToolStripMenuItem_Click); + // // PCETileViewer // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(810, 615); + this.ClientSize = new System.Drawing.Size(810, 624); this.Controls.Add(this.label1); this.Controls.Add(this.checkBoxVDC2); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); + this.Controls.Add(this.menuStrip1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.KeyPreview = true; + this.MainMenuStrip = this.menuStrip1; this.Name = "PCETileViewer"; this.Text = "Tile Viewer"; + this.Load += new System.EventHandler(this.PCETileViewer_Load); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PCETileViewer_KeyDown); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -148,5 +255,16 @@ private BmpView bmpViewSPPal; private BmpView bmpViewSP; private System.Windows.Forms.Label label1; + private MenuStripEx menuStrip1; + private System.Windows.Forms.ToolStripMenuItem FileSubMenu; + private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveBackgroundScreenshotToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveSpriteScreenshotToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem OptionsSubMenu; + private System.Windows.Forms.ToolStripMenuItem autoloadToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveWindowPositionToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem alwaysOnTopToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem floatingWindowToolStripMenuItem; } } \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.cs b/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.cs index 575352c2d9..6042eb4eee 100644 --- a/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.cs +++ b/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.cs @@ -219,5 +219,69 @@ namespace BizHawk.Client.EmuHawk } } } + + private void closeToolStripMenuItem_Click(object sender, EventArgs e) + { + Close(); + } + + private void saveBackgroundScreenshotToolStripMenuItem_Click(object sender, EventArgs e) + { + bmpViewBG.SaveFile(); + } + + private void saveSpriteScreenshotToolStripMenuItem_Click(object sender, EventArgs e) + { + bmpViewSP.SaveFile(); + } + + private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e) + { + autoloadToolStripMenuItem.Checked = Global.Config.PceVdpAutoLoad; + saveWindowPositionToolStripMenuItem.Checked = Global.Config.PceVdpSettings.SaveWindowPosition; + alwaysOnTopToolStripMenuItem.Checked = Global.Config.PceVdpSettings.TopMost; + floatingWindowToolStripMenuItem.Checked = Global.Config.PceVdpSettings.FloatingWindow; + } + + private void autoloadToolStripMenuItem_Click(object sender, EventArgs e) + { + Global.Config.PceVdpAutoLoad ^= true; + } + + private void saveWindowPositionToolStripMenuItem_Click(object sender, EventArgs e) + { + Global.Config.PceVdpSettings.SaveWindowPosition ^= true; + } + + private void alwaysOnTopToolStripMenuItem_Click(object sender, EventArgs e) + { + TopMost = Global.Config.PceVdpSettings.TopMost ^= true; + } + + private void floatingWindowToolStripMenuItem_Click(object sender, EventArgs e) + { + Global.Config.PceVdpSettings.FloatingWindow ^= true; + RefreshFloatingWindowControl(); + } + + private void PCETileViewer_Load(object sender, EventArgs e) + { + TopMost = Global.Config.PceVdpSettings.TopMost; + if (Global.Config.PceVdpSettings.UseWindowPosition) + { + Location = Global.Config.PceVdpSettings.WindowPosition; + } + } + + private void RefreshFloatingWindowControl() + { + Owner = Global.Config.PceVdpSettings.FloatingWindow ? null : GlobalWin.MainForm; + } + + protected override void OnShown(EventArgs e) + { + RefreshFloatingWindowControl(); + base.OnShown(e); + } } } diff --git a/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.resx b/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.resx index fcdd3450fb..9d64fd2552 100644 --- a/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.resx +++ b/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + diff --git a/BizHawk.Client.EmuHawk/tools/ToolBox.Designer.cs b/BizHawk.Client.EmuHawk/tools/ToolBox.Designer.cs index 30c0912dad..ca9109e117 100644 --- a/BizHawk.Client.EmuHawk/tools/ToolBox.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/ToolBox.Designer.cs @@ -52,6 +52,7 @@ this.GbaGpuViewerToolBarItem = new System.Windows.Forms.ToolStripButton(); this.GenesisGameGenieToolBarItem = new System.Windows.Forms.ToolStripButton(); this.SmsVdpToolbarItem = new System.Windows.Forms.ToolStripButton(); + this.PceTileToolbarItem = new System.Windows.Forms.ToolStripButton(); this.ToolBoxStrip.SuspendLayout(); this.SuspendLayout(); // @@ -83,6 +84,7 @@ this.GGGameGenieToolbarItem, this.GbGpuViewerToolBarItem, this.GBGameGenieToolbarItem, + this.PceTileToolbarItem, this.PceCdlToolbarItem, this.PceBgViewerToolbarItem, this.GbaGpuViewerToolBarItem, @@ -92,7 +94,7 @@ this.ToolBoxStrip.Location = new System.Drawing.Point(2, 2); this.ToolBoxStrip.Name = "ToolBoxStrip"; this.ToolBoxStrip.Padding = new System.Windows.Forms.Padding(0); - this.ToolBoxStrip.Size = new System.Drawing.Size(137, 175); + this.ToolBoxStrip.Size = new System.Drawing.Size(137, 179); this.ToolBoxStrip.Stretch = true; this.ToolBoxStrip.TabIndex = 0; this.ToolBoxStrip.TabStop = true; @@ -306,13 +308,24 @@ this.SmsVdpToolbarItem.Name = "SmsVdpToolbarItem"; this.SmsVdpToolbarItem.Size = new System.Drawing.Size(49, 20); this.SmsVdpToolbarItem.Text = "VDP"; + this.SmsVdpToolbarItem.ToolTipText = "SMS VDP Viewer"; this.SmsVdpToolbarItem.Click += new System.EventHandler(this.SmsVdpToolbarItem_Click); // + // PceTileToolbarItem + // + this.PceTileToolbarItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.pcejin1; + this.PceTileToolbarItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.PceTileToolbarItem.Name = "PceTileToolbarItem"; + this.PceTileToolbarItem.Size = new System.Drawing.Size(46, 20); + this.PceTileToolbarItem.Text = "Tile"; + this.PceTileToolbarItem.ToolTipText = "PC Engine Tile Viewer"; + this.PceTileToolbarItem.Click += new System.EventHandler(this.PceTileToolbarItem_Click); + // // ToolBox // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(140, 179); + this.ClientSize = new System.Drawing.Size(140, 183); this.Controls.Add(this.ToolBoxStrip); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximumSize = new System.Drawing.Size(270, 600); @@ -351,6 +364,7 @@ private System.Windows.Forms.ToolStripButton GenesisGameGenieToolBarItem; private System.Windows.Forms.ToolStripButton PceCdlToolbarItem; private System.Windows.Forms.ToolStripButton SmsVdpToolbarItem; + private System.Windows.Forms.ToolStripButton PceTileToolbarItem; } } \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/tools/ToolBox.cs b/BizHawk.Client.EmuHawk/tools/ToolBox.cs index 82896c8227..f2e2059a01 100644 --- a/BizHawk.Client.EmuHawk/tools/ToolBox.cs +++ b/BizHawk.Client.EmuHawk/tools/ToolBox.cs @@ -64,6 +64,7 @@ namespace BizHawk.Client.EmuHawk PceCdlToolbarItem.Visible = PceBgViewerToolbarItem.Visible = + PceTileToolbarItem.Visible = Global.Emulator is PCEngine; GBGameGenieToolbarItem.Visible = @@ -228,6 +229,11 @@ namespace BizHawk.Client.EmuHawk GlobalWin.Tools.Load(); } + private void PceTileToolbarItem_Click(object sender, EventArgs e) + { + GlobalWin.Tools.Load(); + } + #endregion } }