mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Merge pull request #2123 from RachelBryk/nonmodal-isoprops
Make iso properties non modal.
This commit is contained in:
commit
2a41ac4072
@ -934,4 +934,9 @@ bool RunCode(const ARCode &arcode)
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<ARCode> GetARCodes()
|
||||
{
|
||||
return arCodes;
|
||||
}
|
||||
|
||||
} // namespace ActionReplay
|
||||
|
@ -36,4 +36,5 @@ void UpdateActiveList();
|
||||
void EnableSelfLogging(bool enable);
|
||||
const std::vector<std::string> &GetSelfLog();
|
||||
bool IsSelfLogging();
|
||||
std::vector<ARCode> GetARCodes();
|
||||
} // namespace
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Core/PatchEngine.h"
|
||||
|
||||
class IniFile;
|
||||
|
||||
|
@ -26,12 +26,12 @@
|
||||
#include "Core/ActionReplay.h"
|
||||
#include "Core/ARDecrypt.h"
|
||||
#include "DolphinWX/ARCodeAddEdit.h"
|
||||
#include "DolphinWX/ISOProperties.h"
|
||||
#include "DolphinWX/WxUtils.h"
|
||||
|
||||
CARCodeAddEdit::CARCodeAddEdit(int _selection, wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
|
||||
CARCodeAddEdit::CARCodeAddEdit(int _selection, const std::vector<ActionReplay::ARCode>& _arCodes, wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
|
||||
: wxDialog(parent, id, title, position, size, style)
|
||||
, selection(_selection)
|
||||
, arCodes(_arCodes)
|
||||
{
|
||||
Bind(wxEVT_BUTTON, &CARCodeAddEdit::SaveCheatData, this, wxID_OK);
|
||||
|
||||
|
@ -21,7 +21,8 @@ namespace ActionReplay { struct ARCode; }
|
||||
class CARCodeAddEdit : public wxDialog
|
||||
{
|
||||
public:
|
||||
CARCodeAddEdit(int _selection, wxWindow* parent,
|
||||
CARCodeAddEdit(int _selection, const std::vector<ActionReplay::ARCode>& _arCodes,
|
||||
wxWindow* parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& title = _("Edit ActionReplay Code"),
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
@ -33,6 +34,8 @@ private:
|
||||
wxSpinButton* EntrySelection;
|
||||
wxTextCtrl* EditCheatCode;
|
||||
|
||||
std::vector<ActionReplay::ARCode> arCodes;
|
||||
|
||||
void SaveCheatData(wxCommandEvent& event);
|
||||
void ChangeEntry(wxSpinEvent& event);
|
||||
void UpdateTextCtrl(ActionReplay::ARCode arCode);
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "Common/CommonFuncs.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Core/ActionReplay.h"
|
||||
#include "Core/HW/Memmap.h"
|
||||
#include "DolphinWX/WxUtils.h"
|
||||
#include "DolphinWX/Cheats/CheatSearchTab.h"
|
||||
@ -308,7 +309,7 @@ void CheatSearchTab::CreateARCode(wxCommandEvent&)
|
||||
{
|
||||
const u32 address = m_search_results[sel].address | ((m_search_type_size & ~1) << 24);
|
||||
|
||||
CreateCodeDialog arcode_dlg(this, address);
|
||||
CreateCodeDialog arcode_dlg(this, address, ActionReplay::GetARCodes());
|
||||
arcode_dlg.SetExtraStyle(arcode_dlg.GetExtraStyle() & ~wxWS_EX_BLOCK_EVENTS);
|
||||
arcode_dlg.ShowModal();
|
||||
}
|
||||
|
@ -20,9 +20,10 @@
|
||||
// Fired when an ActionReplay code is created.
|
||||
wxDEFINE_EVENT(UPDATE_CHEAT_LIST_EVENT, wxCommandEvent);
|
||||
|
||||
CreateCodeDialog::CreateCodeDialog(wxWindow* const parent, const u32 address)
|
||||
CreateCodeDialog::CreateCodeDialog(wxWindow* const parent, const u32 address, const std::vector<ActionReplay::ARCode>& _arCodes)
|
||||
: wxDialog(parent, wxID_ANY, _("Create AR Code"))
|
||||
, m_code_address(address)
|
||||
, arCodes(_arCodes)
|
||||
{
|
||||
wxStaticText* const label_name = new wxStaticText(this, wxID_ANY, _("Name: "));
|
||||
m_textctrl_name = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(256, -1));
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <wx/event.h>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Core/ActionReplay.h"
|
||||
|
||||
class wxCheckBox;
|
||||
class wxTextCtrl;
|
||||
@ -18,10 +19,11 @@ wxDECLARE_EVENT(UPDATE_CHEAT_LIST_EVENT, wxCommandEvent);
|
||||
class CreateCodeDialog final : public wxDialog
|
||||
{
|
||||
public:
|
||||
CreateCodeDialog(wxWindow* const parent, const u32 address);
|
||||
CreateCodeDialog(wxWindow* const parent, const u32 address, const std::vector<ActionReplay::ARCode>& _arCodes);
|
||||
|
||||
private:
|
||||
const u32 m_code_address;
|
||||
std::vector<ActionReplay::ARCode> arCodes;
|
||||
|
||||
wxTextCtrl* m_textctrl_name;
|
||||
wxTextCtrl* m_textctrl_code;
|
||||
|
@ -1099,9 +1099,8 @@ void CGameListCtrl::OnProperties(wxCommandEvent& WXUNUSED (event))
|
||||
if (!iso)
|
||||
return;
|
||||
|
||||
CISOProperties ISOProperties(iso->GetFileName(), this);
|
||||
if (ISOProperties.ShowModal() == wxID_OK)
|
||||
Update();
|
||||
CISOProperties* ISOProperties = new CISOProperties(iso->GetFileName(), this);
|
||||
ISOProperties->Show();
|
||||
}
|
||||
|
||||
void CGameListCtrl::OnWiki(wxCommandEvent& WXUNUSED (event))
|
||||
|
@ -71,6 +71,8 @@
|
||||
#include "DiscIO/Volume.h"
|
||||
#include "DiscIO/VolumeCreator.h"
|
||||
#include "DolphinWX/ARCodeAddEdit.h"
|
||||
#include "DolphinWX/GameListCtrl.h"
|
||||
//#include "DolphinWX/Frame.h"
|
||||
#include "DolphinWX/ISOFile.h"
|
||||
#include "DolphinWX/ISOProperties.h"
|
||||
#include "DolphinWX/PatchAddEdit.h"
|
||||
@ -80,22 +82,6 @@
|
||||
#include "DolphinWX/resources/isoprop_file.xpm"
|
||||
#include "DolphinWX/resources/isoprop_folder.xpm"
|
||||
|
||||
struct WiiPartition
|
||||
{
|
||||
DiscIO::IVolume *Partition;
|
||||
DiscIO::IFileSystem *FileSystem;
|
||||
std::vector<const DiscIO::SFileInfo *> Files;
|
||||
};
|
||||
static std::vector<WiiPartition> WiiDisc;
|
||||
|
||||
static DiscIO::IVolume *OpenISO = nullptr;
|
||||
static DiscIO::IFileSystem *pFileSystem = nullptr;
|
||||
|
||||
std::vector<PatchEngine::Patch> onFrame;
|
||||
std::vector<ActionReplay::ARCode> arCodes;
|
||||
PHackData PHack_Data;
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE(CISOProperties, wxDialog)
|
||||
EVT_CLOSE(CISOProperties::OnClose)
|
||||
EVT_BUTTON(wxID_OK, CISOProperties::OnCloseClick)
|
||||
@ -675,8 +661,9 @@ void CISOProperties::OnClose(wxCloseEvent& WXUNUSED (event))
|
||||
{
|
||||
if (!SaveGameConfig())
|
||||
WxUtils::ShowErrorDialog(wxString::Format(_("Could not save %s."), GameIniFileLocal.c_str()));
|
||||
|
||||
EndModal(bRefreshList ? wxID_OK : wxID_CANCEL);
|
||||
if (bRefreshList)
|
||||
((CGameListCtrl*)GetParent())->Update();
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void CISOProperties::OnCloseClick(wxCommandEvent& WXUNUSED (event))
|
||||
@ -1059,20 +1046,20 @@ void CISOProperties::LoadGameConfig()
|
||||
|
||||
int iTemp;
|
||||
default_video->Get("ProjectionHack", &iTemp);
|
||||
default_video->Get("PH_SZNear", &PHack_Data.PHackSZNear);
|
||||
default_video->Get("PH_SZNear", &m_PHack_Data.PHackSZNear);
|
||||
if (GameIniLocal.GetIfExists("Video", "PH_SZNear", &iTemp))
|
||||
PHack_Data.PHackSZNear = !!iTemp;
|
||||
default_video->Get("PH_SZFar", &PHack_Data.PHackSZFar);
|
||||
m_PHack_Data.PHackSZNear = !!iTemp;
|
||||
default_video->Get("PH_SZFar", &m_PHack_Data.PHackSZFar);
|
||||
if (GameIniLocal.GetIfExists("Video", "PH_SZFar", &iTemp))
|
||||
PHack_Data.PHackSZFar = !!iTemp;
|
||||
m_PHack_Data.PHackSZFar = !!iTemp;
|
||||
|
||||
std::string sTemp;
|
||||
default_video->Get("PH_ZNear", &PHack_Data.PHZNear);
|
||||
default_video->Get("PH_ZNear", &m_PHack_Data.PHZNear);
|
||||
if (GameIniLocal.GetIfExists("Video", "PH_ZNear", &sTemp))
|
||||
PHack_Data.PHZNear = sTemp;
|
||||
default_video->Get("PH_ZFar", &PHack_Data.PHZFar);
|
||||
m_PHack_Data.PHZNear = sTemp;
|
||||
default_video->Get("PH_ZFar", &m_PHack_Data.PHZFar);
|
||||
if (GameIniLocal.GetIfExists("Video", "PH_ZFar", &sTemp))
|
||||
PHack_Data.PHZFar = sTemp;
|
||||
m_PHack_Data.PHZFar = sTemp;
|
||||
|
||||
IniFile::Section* default_emustate = GameIniDefault.GetOrCreateSection("EmuState");
|
||||
default_emustate->Get("EmulationStateId", &iTemp, 0/*Not Set*/);
|
||||
@ -1163,10 +1150,10 @@ bool CISOProperties::SaveGameConfig()
|
||||
GameIniLocal.DeleteKey((section), (key)); \
|
||||
} while (0)
|
||||
|
||||
SAVE_IF_NOT_DEFAULT("Video", "PH_SZNear", (PHack_Data.PHackSZNear ? 1 : 0), 0);
|
||||
SAVE_IF_NOT_DEFAULT("Video", "PH_SZFar", (PHack_Data.PHackSZFar ? 1 : 0), 0);
|
||||
SAVE_IF_NOT_DEFAULT("Video", "PH_ZNear", PHack_Data.PHZNear, "");
|
||||
SAVE_IF_NOT_DEFAULT("Video", "PH_ZFar", PHack_Data.PHZFar, "");
|
||||
SAVE_IF_NOT_DEFAULT("Video", "PH_SZNear", (m_PHack_Data.PHackSZNear ? 1 : 0), 0);
|
||||
SAVE_IF_NOT_DEFAULT("Video", "PH_SZFar", (m_PHack_Data.PHackSZFar ? 1 : 0), 0);
|
||||
SAVE_IF_NOT_DEFAULT("Video", "PH_ZNear", m_PHack_Data.PHZNear, "");
|
||||
SAVE_IF_NOT_DEFAULT("Video", "PH_ZFar", m_PHack_Data.PHZFar, "");
|
||||
SAVE_IF_NOT_DEFAULT("EmuState", "EmulationStateId", EmuState->GetSelection(), 0);
|
||||
|
||||
std::string emu_issues = EmuIssues->GetValue().ToStdString();
|
||||
@ -1386,13 +1373,13 @@ void CISOProperties::PatchButtonClicked(wxCommandEvent& event)
|
||||
{
|
||||
case ID_EDITPATCH:
|
||||
{
|
||||
CPatchAddEdit dlg(selection, this);
|
||||
CPatchAddEdit dlg(selection, onFrame, this);
|
||||
dlg.ShowModal();
|
||||
}
|
||||
break;
|
||||
case ID_ADDPATCH:
|
||||
{
|
||||
CPatchAddEdit dlg(-1, this, 1, _("Add Patch"));
|
||||
CPatchAddEdit dlg(-1, onFrame, this, 1, _("Add Patch"));
|
||||
if (dlg.ShowModal() == wxID_OK)
|
||||
{
|
||||
Patches->Append(StrToWxStr(onFrame.back().name));
|
||||
@ -1466,13 +1453,13 @@ void CISOProperties::ActionReplayButtonClicked(wxCommandEvent& event)
|
||||
{
|
||||
case ID_EDITCHEAT:
|
||||
{
|
||||
CARCodeAddEdit dlg(selection, this);
|
||||
CARCodeAddEdit dlg(selection, arCodes, this);
|
||||
dlg.ShowModal();
|
||||
}
|
||||
break;
|
||||
case ID_ADDCHEAT:
|
||||
{
|
||||
CARCodeAddEdit dlg(-1, this, 1, _("Add ActionReplay Code"));
|
||||
CARCodeAddEdit dlg(-1, arCodes, this, 1, _("Add ActionReplay Code"));
|
||||
if (dlg.ShowModal() == wxID_OK)
|
||||
{
|
||||
Cheats->Append(StrToWxStr(arCodes.back().name));
|
||||
|
@ -20,6 +20,11 @@
|
||||
|
||||
#include "Common/IniFile.h"
|
||||
#include "Core/ActionReplay.h"
|
||||
#include "DiscIO/Filesystem.h"
|
||||
#include "DiscIO/Volume.h"
|
||||
#include "DiscIO/VolumeCreator.h"
|
||||
#include "DolphinWX/ARCodeAddEdit.h"
|
||||
#include "DolphinWX/PatchAddEdit.h"
|
||||
|
||||
class GameListItem;
|
||||
class wxButton;
|
||||
@ -37,6 +42,13 @@ namespace Gecko { class CodeConfigPanel; }
|
||||
|
||||
extern std::vector<ActionReplay::ARCode> arCodes;
|
||||
|
||||
struct WiiPartition
|
||||
{
|
||||
DiscIO::IVolume *Partition;
|
||||
DiscIO::IFileSystem *FileSystem;
|
||||
std::vector<const DiscIO::SFileInfo *> Files;
|
||||
};
|
||||
|
||||
struct PHackData
|
||||
{
|
||||
bool PHackSZNear;
|
||||
@ -68,6 +80,15 @@ public:
|
||||
private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
std::vector<WiiPartition> WiiDisc;
|
||||
|
||||
DiscIO::IVolume *OpenISO;
|
||||
DiscIO::IFileSystem *pFileSystem;
|
||||
|
||||
std::vector<PatchEngine::Patch> onFrame;
|
||||
std::vector<ActionReplay::ARCode> arCodes;
|
||||
PHackData m_PHack_Data;
|
||||
|
||||
// Core
|
||||
wxCheckBox *CPUThread, *SkipIdle, *MMU, *DCBZOFF, *FPRF;
|
||||
wxCheckBox *SyncGPU, *FastDiscSpeed, *DSPHLE;
|
||||
|
@ -28,11 +28,12 @@
|
||||
#include "DolphinWX/PatchAddEdit.h"
|
||||
#include "DolphinWX/WxUtils.h"
|
||||
|
||||
CPatchAddEdit::CPatchAddEdit(int _selection, wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
|
||||
CPatchAddEdit::CPatchAddEdit(int _selection, const std::vector<PatchEngine::Patch>& _onFrame, wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
|
||||
: wxDialog(parent, id, title, position, size, style)
|
||||
{
|
||||
selection = _selection;
|
||||
CreateGUIControls(selection);
|
||||
onFrame = _onFrame;
|
||||
|
||||
Bind(wxEVT_BUTTON, &CPatchAddEdit::SavePatchData, this, wxID_OK);
|
||||
}
|
||||
|
@ -25,7 +25,8 @@ class wxWindow;
|
||||
class CPatchAddEdit : public wxDialog
|
||||
{
|
||||
public:
|
||||
CPatchAddEdit(int _selection, wxWindow* parent,
|
||||
CPatchAddEdit(int _selection, const std::vector<PatchEngine::Patch>& _onFrame,
|
||||
wxWindow* parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& title = _("Edit Patch"),
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
@ -42,6 +43,7 @@ private:
|
||||
wxButton* EntryAdd;
|
||||
wxButton* EntryRemove;
|
||||
wxStaticBoxSizer* sbEntry;
|
||||
std::vector<PatchEngine::Patch> onFrame;
|
||||
|
||||
void CreateGUIControls(int selection);
|
||||
void ChangeEntry(wxSpinEvent& event);
|
||||
|
Loading…
Reference in New Issue
Block a user