Skip to content

Commit

Permalink
CemuPanel.cs - Added GameDirectoryContextMenu for opening or copying …
Browse files Browse the repository at this point in the history
…the directory path
  • Loading branch information
NessieHax committed Jul 22, 2023
1 parent ada7a0c commit 22eff0d
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 11 deletions.
32 changes: 31 additions & 1 deletion PCK-Studio/Features/CemuPanel.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 12 additions & 10 deletions PCK-Studio/Features/CemuPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)
Expand All @@ -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);
}
}
}
3 changes: 3 additions & 0 deletions PCK-Studio/Features/CemuPanel.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<metadata name="layoutPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="gameDirectoryContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>165, 17</value>
</metadata>
<metadata name="DLCContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
Expand Down

0 comments on commit 22eff0d

Please sign in to comment.