From d24450f4a965f5456efbb8d6c5538faf02b6f458 Mon Sep 17 00:00:00 2001 From: Gauvain 'GovanifY' Roussel-Tarbouriech Date: Sat, 6 Mar 2021 16:48:50 +0100 Subject: [PATCH] IPC: Fix type polymorphism & checkbox --- pcsx2/gui/Dialogs/IPCDialog.cpp | 6 +++--- pcsx2/gui/MainFrame.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pcsx2/gui/Dialogs/IPCDialog.cpp b/pcsx2/gui/Dialogs/IPCDialog.cpp index 34f6df2a4b..c9806d1bff 100644 --- a/pcsx2/gui/Dialogs/IPCDialog.cpp +++ b/pcsx2/gui/Dialogs/IPCDialog.cpp @@ -49,10 +49,10 @@ Dialogs::IPCDialog::IPCDialog(wxWindow* parent) void Dialogs::IPCDialog::OnConfirm(wxCommandEvent& evt) { - wxTextCtrl* textbox = dynamic_cast(evt.GetEventObject()); - if (textbox) + wxTextCtrl* obj = static_cast(evt.GetEventObject()); + if (obj != nullptr) { - IPCSettings::slot = (unsigned int)atoi(textbox->GetValue().ToUTF8().data()); + IPCSettings::slot = (unsigned int)atoi(obj->GetValue().ToUTF8().data()); Destroy(); } } diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index c668b0a47f..42292612a2 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -394,9 +394,9 @@ void MainEmuFrame::CreatePcsx2Menu() m_GameSettingsSubmenu.Append(MenuId_EnableCheats, _("Enable &Cheats"), _("Use cheats otherwise known as pnachs from the cheats folder."), wxITEM_CHECK); - m_GameSettingsSubmenu.Append(MenuId_IPC_Enable, _("Configure &IPC"), &m_submenuIPC); + m_GameSettingsSubmenu.Append(MenuId_IPC, _("Configure &IPC"), &m_submenuIPC); - m_submenuIPC.Append(MenuId_IPC, _("&Enable IPC"), + m_submenuIPC.Append(MenuId_IPC_Enable, _("&Enable IPC"), wxEmptyString, wxITEM_CHECK); m_submenuIPC.Append(MenuId_IPC_Settings, _("IPC &Settings"));