diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index aaa16d80cb..287bb6b2f3 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -328,6 +328,10 @@ CFrame::CFrame(wxFrame* parent, m_LogWindow->Disable(); g_TASInputDlg = new TASInputDlg(this); + g_TASInputDlg1 = new TASInputDlg(this); + g_TASInputDlg2 = new TASInputDlg(this); + g_TASInputDlg3 = new TASInputDlg(this); + Movie::SetInputManip(TASManipFunction); State::SetOnAfterLoadCallback(OnAfterLoadCallback); @@ -793,14 +797,41 @@ void OnAfterLoadCallback() void TASManipFunction(SPADStatus *PadStatus, int controllerID) { - if (main_frame) + 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); } +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; +} + + void CFrame::OnKeyDown(wxKeyEvent& event) { if(Core::GetState() != Core::CORE_UNINITIALIZED && - (RendererHasFocus() || g_TASInputDlg->HasFocus())) + (RendererHasFocus() || TASInputHasFocus())) { int WiimoteId = -1; // Toggle fullscreen @@ -834,7 +865,7 @@ void CFrame::OnKeyDown(wxKeyEvent& event) else { unsigned int i = NUM_HOTKEYS; - if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain || g_TASInputDlg->HasFocus()) + if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain || TASInputHasFocus()) { for (i = 0; i < NUM_HOTKEYS; i++) { diff --git a/Source/Core/DolphinWX/Src/Frame.h b/Source/Core/DolphinWX/Src/Frame.h index 0a29fffd37..b568f34fb9 100644 --- a/Source/Core/DolphinWX/Src/Frame.h +++ b/Source/Core/DolphinWX/Src/Frame.h @@ -111,7 +111,10 @@ public: NetPlaySetupDiag* g_NetPlaySetupDiag; wxCheatsWindow* g_CheatsWindow; TASInputDlg* g_TASInputDlg; - + TASInputDlg* g_TASInputDlg1; + TASInputDlg* g_TASInputDlg2; + TASInputDlg* g_TASInputDlg3; + void InitBitmaps(); void DoPause(); void DoStop(); @@ -349,6 +352,7 @@ void OnAfterLoadCallback(); // For TASInputDlg void TASManipFunction(SPADStatus *PadStatus, int controllerID); +bool TASInputHasFocus(); #endif // __FRAME_H_ diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 27a1aaa097..70b0a26f59 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -647,7 +647,29 @@ void CFrame::OnRecordReadOnly(wxCommandEvent& event) void CFrame::OnTASInput(wxCommandEvent& event) { - g_TASInputDlg->Show(true); + 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"); + } } void CFrame::OnTogglePauseMovie(wxCommandEvent& WXUNUSED (event)) diff --git a/Source/Core/DolphinWX/Src/TASInputDlg.cpp b/Source/Core/DolphinWX/Src/TASInputDlg.cpp index 5b71009644..c37a369b11 100644 --- a/Source/Core/DolphinWX/Src/TASInputDlg.cpp +++ b/Source/Core/DolphinWX/Src/TASInputDlg.cpp @@ -460,8 +460,8 @@ void TASInputDlg::GetValues(SPADStatus *PadStatus, int controllerID) SetLandRTriggers(); // TODO: implement support for more controllers - if (controllerID != 0) - return; + //if (controllerID != 0) + // return; PadStatus->stickX = mainX; PadStatus->stickY = mainY;