gui: Add `Screenshot As...` option

This commit is contained in:
Tyler Wilding 2020-07-28 20:16:32 -04:00 committed by refractionpcsx2
parent 152d1d8ac4
commit 9da0cc6a91
4 changed files with 23 additions and 4 deletions

View File

@ -196,6 +196,8 @@ enum MenuIdentifiers
MenuId_Capture_Video_Record,
MenuId_Capture_Video_Stop,
MenuId_Capture_Screenshot,
MenuId_Capture_Screenshot_Screenshot,
MenuId_Capture_Screenshot_Screenshot_As,
#ifndef DISABLE_RECORDING
// Input Recording Subsection

View File

@ -279,7 +279,8 @@ void MainEmuFrame::ConnectMenus()
// Capture
Bind(wxEVT_MENU, &MainEmuFrame::Menu_Capture_Video_Record_Click, this, MenuId_Capture_Video_Record);
Bind(wxEVT_MENU, &MainEmuFrame::Menu_Capture_Video_Stop_Click, this, MenuId_Capture_Video_Stop);
Bind(wxEVT_MENU, &MainEmuFrame::Menu_Capture_Screenshot_Screenshot_Click, this, MenuId_Capture_Screenshot);
Bind(wxEVT_MENU, &MainEmuFrame::Menu_Capture_Screenshot_Screenshot_Click, this, MenuId_Capture_Screenshot_Screenshot);
Bind(wxEVT_MENU, &MainEmuFrame::Menu_Capture_Screenshot_Screenshot_As_Click, this, MenuId_Capture_Screenshot_Screenshot_As);
#ifndef DISABLE_RECORDING
// Recording
@ -474,7 +475,9 @@ void MainEmuFrame::CreateCaptureMenu()
m_submenuVideoCapture.Append(MenuId_Capture_Video_Record, _("Start Screenrecorder"));
m_submenuVideoCapture.Append(MenuId_Capture_Video_Stop, _("Stop Screenrecorder"))->Enable(false);
m_menuCapture.Append(MenuId_Capture_Screenshot, _("Screenshot"));
m_menuCapture.Append(MenuId_Capture_Screenshot, _("Screenshot"), &m_submenuScreenshot);
m_submenuScreenshot.Append(MenuId_Capture_Screenshot_Screenshot, _("Screenshot"));
m_submenuScreenshot.Append(MenuId_Capture_Screenshot_Screenshot_As, _("Screenshot As..."));
}
void MainEmuFrame::CreateRecordMenu()
@ -523,6 +526,7 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title)
, m_menuWindow(*new wxMenu())
, m_menuCapture(*new wxMenu())
, m_submenuVideoCapture(*new wxMenu())
, m_submenuScreenshot(*new wxMenu())
#ifndef DISABLE_RECORDING
, m_menuRecording(*new wxMenu())
#endif

View File

@ -115,8 +115,9 @@ protected:
wxMenu& m_menuConfig;
wxMenu& m_menuWindow;
wxMenu& m_menuCapture;
wxMenu& m_submenuVideoCapture;
wxMenu& m_menuCapture;
wxMenu& m_submenuVideoCapture;
wxMenu& m_submenuScreenshot;
#ifndef DISABLE_RECORDING
wxMenu& m_menuRecording;
@ -248,6 +249,7 @@ protected:
void Menu_Capture_Video_Stop_Click(wxCommandEvent& event);
void VideoCaptureUpdate();
void Menu_Capture_Screenshot_Screenshot_Click(wxCommandEvent& event);
void Menu_Capture_Screenshot_Screenshot_As_Click(wxCommandEvent& event);
#ifndef DISABLE_RECORDING
void Menu_Recording_New_Click(wxCommandEvent& event);

View File

@ -919,6 +919,17 @@ void MainEmuFrame::Menu_Capture_Screenshot_Screenshot_Click(wxCommandEvent& even
GSmakeSnapshot(g_Conf->Folders.Snapshots.ToAscii());
}
void MainEmuFrame::Menu_Capture_Screenshot_Screenshot_As_Click(wxCommandEvent &event)
{
if (!CoreThread.IsOpen())
return;
wxFileDialog fileDialog(this, "Select a file", g_Conf->Folders.Snapshots.ToAscii(), wxEmptyString, "PNG files (*.png)|*.png", wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
if (fileDialog.ShowModal() == wxID_OK)
GSmakeSnapshot(fileDialog.GetPath());
}
#ifndef DISABLE_RECORDING
void MainEmuFrame::Menu_Recording_New_Click(wxCommandEvent& event)
{