diff --git a/PCK-Studio/Features/CemuPanel.Designer.cs b/PCK-Studio/Features/CemuPanel.Designer.cs index 36b4d612..95cb58fb 100644 --- a/PCK-Studio/Features/CemuPanel.Designer.cs +++ b/PCK-Studio/Features/CemuPanel.Designer.cs @@ -30,6 +30,9 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.Windows.Forms.TableLayoutPanel layoutPanel; + this.gameDirectoryContextMenu = new MetroFramework.Controls.MetroContextMenu(this.components); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.radioButtonEur = new System.Windows.Forms.RadioButton(); this.radioButtonUs = new System.Windows.Forms.RadioButton(); this.radioButtonJap = new System.Windows.Forms.RadioButton(); @@ -43,6 +46,7 @@ private void InitializeComponent() this.removePckToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); layoutPanel = new System.Windows.Forms.TableLayoutPanel(); layoutPanel.SuspendLayout(); + this.gameDirectoryContextMenu.SuspendLayout(); this.DLCContextMenu.SuspendLayout(); this.SuspendLayout(); // @@ -53,6 +57,7 @@ private void InitializeComponent() layoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33332F)); layoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33334F)); layoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33334F)); + layoutPanel.ContextMenuStrip = this.gameDirectoryContextMenu; layoutPanel.Controls.Add(this.radioButtonEur, 0, 1); layoutPanel.Controls.Add(this.radioButtonUs, 1, 1); layoutPanel.Controls.Add(this.radioButtonJap, 2, 1); @@ -71,6 +76,28 @@ private void InitializeComponent() layoutPanel.Size = new System.Drawing.Size(430, 550); layoutPanel.TabIndex = 4; // + // gameDirectoryContextMenu + // + this.gameDirectoryContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.openToolStripMenuItem, + this.copyToolStripMenuItem}); + this.gameDirectoryContextMenu.Name = "gameDirectoryContextMenu"; + this.gameDirectoryContextMenu.Size = new System.Drawing.Size(155, 48); + // + // openToolStripMenuItem + // + this.openToolStripMenuItem.Name = "openToolStripMenuItem"; + this.openToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.openToolStripMenuItem.Text = "Open Directory"; + this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); + // + // copyToolStripMenuItem + // + this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; + this.copyToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.copyToolStripMenuItem.Text = "Copy Path"; + this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); + // // radioButtonEur // this.radioButtonEur.Appearance = System.Windows.Forms.Appearance.Button; @@ -180,7 +207,6 @@ private void InitializeComponent() this.GameDirectoryTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); this.GameDirectoryTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); this.GameDirectoryTextBox.TextChanged += new System.EventHandler(this.GameDirectoryTextBox_TextChanged); - this.GameDirectoryTextBox.Click += new System.EventHandler(this.GameDirectoryTextBox_Click); // // BrowseDirectoryBtn // @@ -265,6 +291,7 @@ private void InitializeComponent() this.Size = new System.Drawing.Size(430, 550); layoutPanel.ResumeLayout(false); layoutPanel.PerformLayout(); + this.gameDirectoryContextMenu.ResumeLayout(false); this.DLCContextMenu.ResumeLayout(false); this.ResumeLayout(false); @@ -283,5 +310,8 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem openTexturePackToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem addCustomPckToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem removePckToolStripMenuItem; + private MetroFramework.Controls.MetroContextMenu gameDirectoryContextMenu; + private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem; } } diff --git a/PCK-Studio/Features/CemuPanel.cs b/PCK-Studio/Features/CemuPanel.cs index 296d65c9..e4e7d215 100644 --- a/PCK-Studio/Features/CemuPanel.cs +++ b/PCK-Studio/Features/CemuPanel.cs @@ -54,7 +54,7 @@ private bool TryApplyCemuConfig(string settingsPath) var xml = new XmlDocument(); xml.Load(settingsPath); GameDirectoryTextBox.Text = xml.SelectSingleNode("content").SelectSingleNode("mlc_path").InnerText; - GameDirectoryTextBox.ReadOnly = true; + GameDirectoryTextBox.Enabled = false; BrowseDirectoryBtn.Enabled = false; } catch (Exception ex) @@ -83,7 +83,7 @@ private bool TryApplyPermanentCemuConfig() var configNode = xml.SelectSingleNode("config"); var mlcpathNode = configNode.SelectSingleNode("MlcPath"); GameDirectoryTextBox.Text = mlcpathNode.InnerText; - GameDirectoryTextBox.ReadOnly = true; + GameDirectoryTextBox.Enabled = false; BrowseDirectoryBtn.Enabled = false; return true; } @@ -311,14 +311,6 @@ private void GameDirectoryTextBox_TextChanged(object sender, EventArgs e) ListDLCs(); } - private void GameDirectoryTextBox_Click(object sender, EventArgs e) - { - if (GameDirectoryTextBox.ReadOnly) - { - Process.Start(GetContentSubDirectory("WiiU", "DLC")); - } - } - private void DLCTreeView_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.KeyCode == Keys.Enter && DLCTreeView.SelectedNode is not null) @@ -332,5 +324,15 @@ private void DLCTreeView_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = true; } + + private void openToolStripMenuItem_Click(object sender, EventArgs e) + { + Process.Start(GetContentSubDirectory("WiiU", "DLC")); + } + + private void copyToolStripMenuItem_Click(object sender, EventArgs e) + { + Clipboard.SetText(GameDirectoryTextBox.Text); + } } } diff --git a/PCK-Studio/Features/CemuPanel.resx b/PCK-Studio/Features/CemuPanel.resx index e04b8618..7d5bcc05 100644 --- a/PCK-Studio/Features/CemuPanel.resx +++ b/PCK-Studio/Features/CemuPanel.resx @@ -120,6 +120,9 @@ False + + 165, 17 + 17, 17