summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinWX/Src/Frame.cpp44
-rw-r--r--Source/Core/DolphinWX/Src/Frame.h5
-rw-r--r--Source/Core/DolphinWX/Src/FrameTools.cpp33
3 files changed, 25 insertions, 57 deletions
diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp
index 287bb6b2f3..af71066314 100644
--- a/Source/Core/DolphinWX/Src/Frame.cpp
+++ b/Source/Core/DolphinWX/Src/Frame.cpp
@@ -327,11 +327,11 @@ CFrame::CFrame(wxFrame* parent,
m_LogWindow->Hide();
m_LogWindow->Disable();
- g_TASInputDlg = new TASInputDlg(this);
- g_TASInputDlg1 = new TASInputDlg(this);
- g_TASInputDlg2 = new TASInputDlg(this);
- g_TASInputDlg3 = new TASInputDlg(this);
-
+ g_TASInputDlg[0] = new TASInputDlg(this);
+ g_TASInputDlg[1] = new TASInputDlg(this);
+ g_TASInputDlg[2] = new TASInputDlg(this);
+ g_TASInputDlg[3] = new TASInputDlg(this);
+
Movie::SetInputManip(TASManipFunction);
State::SetOnAfterLoadCallback(OnAfterLoadCallback);
@@ -788,7 +788,7 @@ int GetCmdForHotkey(unsigned int key)
void OnAfterLoadCallback()
{
// warning: this gets called from the CPU thread, so we should only queue things to do on the proper thread
- if(main_frame)
+ if (main_frame)
{
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATEGUI);
main_frame->GetEventHandler()->AddPendingEvent(event);
@@ -797,34 +797,18 @@ void OnAfterLoadCallback()
void TASManipFunction(SPADStatus *PadStatus, int controllerID)
{
- if (main_frame && controllerID == 0)
- main_frame->g_TASInputDlg->GetValues(PadStatus, controllerID);
-
- if (main_frame && controllerID == 1)
- main_frame->g_TASInputDlg1->GetValues(PadStatus, controllerID);
-
- if (main_frame && controllerID == 2)
- main_frame->g_TASInputDlg2->GetValues(PadStatus, controllerID);
-
- if (main_frame && controllerID == 3)
- main_frame->g_TASInputDlg3->GetValues(PadStatus, controllerID);
+ if (main_frame)
+ main_frame->g_TASInputDlg[controllerID]->GetValues(PadStatus, controllerID);
}
bool TASInputHasFocus()
{
- if(main_frame->g_TASInputDlg->HasFocus())
- return true;
-
- if(main_frame->g_TASInputDlg1->HasFocus())
- return true;
-
- if(main_frame->g_TASInputDlg2->HasFocus())
- return true;
-
- if(main_frame->g_TASInputDlg3->HasFocus())
- return true;
-
- return false;
+ for (int i = 0; i < 4; i++)
+ {
+ if (main_frame->g_TASInputDlg[i]->HasFocus())
+ return true;
+ }
+ return false;
}
diff --git a/Source/Core/DolphinWX/Src/Frame.h b/Source/Core/DolphinWX/Src/Frame.h
index b568f34fb9..7bfe33c1b6 100644
--- a/Source/Core/DolphinWX/Src/Frame.h
+++ b/Source/Core/DolphinWX/Src/Frame.h
@@ -110,10 +110,7 @@ public:
CCodeWindow* g_pCodeWindow;
NetPlaySetupDiag* g_NetPlaySetupDiag;
wxCheatsWindow* g_CheatsWindow;
- TASInputDlg* g_TASInputDlg;
- TASInputDlg* g_TASInputDlg1;
- TASInputDlg* g_TASInputDlg2;
- TASInputDlg* g_TASInputDlg3;
+ TASInputDlg* g_TASInputDlg[4];
void InitBitmaps();
void DoPause();
diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp
index 70b0a26f59..5409e98f6a 100644
--- a/Source/Core/DolphinWX/Src/FrameTools.cpp
+++ b/Source/Core/DolphinWX/Src/FrameTools.cpp
@@ -647,29 +647,16 @@ void CFrame::OnRecordReadOnly(wxCommandEvent& event)
void CFrame::OnTASInput(wxCommandEvent& event)
{
- if(SConfig::GetInstance().m_SIDevice[0] == SIDEVICE_GC_CONTROLLER)
- {
- g_TASInputDlg->Show(true);
- g_TASInputDlg->SetTitle("TAS Input - Controller 1");
- }
-
- if(SConfig::GetInstance().m_SIDevice[1] == SIDEVICE_GC_CONTROLLER)
- {
- g_TASInputDlg1->Show(true);
- g_TASInputDlg1->SetTitle("TAS Input - Controller 2");
- }
-
- if(SConfig::GetInstance().m_SIDevice[2] == SIDEVICE_GC_CONTROLLER)
- {
- g_TASInputDlg2->Show(true);
- g_TASInputDlg2->SetTitle("TAS Input - Controller 3");
- }
-
- if(SConfig::GetInstance().m_SIDevice[3] == SIDEVICE_GC_CONTROLLER)
- {
- g_TASInputDlg3->Show(true);
- g_TASInputDlg3->SetTitle("TAS Input - Controller 4");
- }
+ std::string number[4] = {"1","2","3","4"};
+
+ for(int i = 0; i < 4; i++)
+ {
+ if(SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_CONTROLLER)
+ {
+ g_TASInputDlg[i]->Show(true);
+ g_TASInputDlg[i]->SetTitle("TAS Input - Controller " + number[i]);
+ }
+ }
}
void CFrame::OnTogglePauseMovie(wxCommandEvent& WXUNUSED (event))