Skip to content

Commit

Permalink
gui: Add Screenshot As... option
Browse files Browse the repository at this point in the history
  • Loading branch information
xTVaser authored and refractionpcsx2 committed Oct 16, 2020
1 parent 152d1d8 commit 9da0cc6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
2 changes: 2 additions & 0 deletions pcsx2/gui/App.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions pcsx2/gui/MainFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions pcsx2/gui/MainFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ class MainEmuFrame : public wxFrame,
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;
Expand Down Expand Up @@ -248,6 +249,7 @@ class MainEmuFrame : public wxFrame,
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);
Expand Down
11 changes: 11 additions & 0 deletions pcsx2/gui/MainMenuClicks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 9da0cc6

Please sign in to comment.