mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Clean up code for multiple GameCube Controllers
This commit is contained in:
@ -406,11 +406,11 @@ CFrame::CFrame(wxFrame* parent,
|
|||||||
m_LogWindow = new CLogWindow(this, IDM_LOGWINDOW);
|
m_LogWindow = new CLogWindow(this, IDM_LOGWINDOW);
|
||||||
m_LogWindow->Hide();
|
m_LogWindow->Hide();
|
||||||
m_LogWindow->Disable();
|
m_LogWindow->Disable();
|
||||||
|
|
||||||
g_TASInputDlg = new TASInputDlg(this);
|
g_TASInputDlg[0] = new TASInputDlg(this);
|
||||||
g_TASInputDlg1 = new TASInputDlg(this);
|
g_TASInputDlg[1] = new TASInputDlg(this);
|
||||||
g_TASInputDlg2 = new TASInputDlg(this);
|
g_TASInputDlg[2] = new TASInputDlg(this);
|
||||||
g_TASInputDlg3 = new TASInputDlg(this);
|
g_TASInputDlg[3] = new TASInputDlg(this);
|
||||||
|
|
||||||
Movie::SetInputManip(TASManipFunction);
|
Movie::SetInputManip(TASManipFunction);
|
||||||
|
|
||||||
@ -896,33 +896,17 @@ void OnAfterLoadCallback()
|
|||||||
|
|
||||||
void TASManipFunction(SPADStatus *PadStatus, int controllerID)
|
void TASManipFunction(SPADStatus *PadStatus, int controllerID)
|
||||||
{
|
{
|
||||||
if (main_frame && controllerID == 0)
|
if (main_frame)
|
||||||
main_frame->g_TASInputDlg->GetValues(PadStatus, controllerID);
|
main_frame->g_TASInputDlg[controllerID]->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()
|
bool TASInputHasFocus()
|
||||||
{
|
{
|
||||||
if(main_frame->g_TASInputDlg->TASInputDlgHasFocus())
|
for(int i = 0; i < 4; i++)
|
||||||
return true;
|
{
|
||||||
|
if(main_frame->g_TASInputDlg[i]->TASInputDlgHasFocus())
|
||||||
if(main_frame->g_TASInputDlg1->TASInputDlgHasFocus())
|
return true;
|
||||||
return true;
|
}
|
||||||
|
|
||||||
if(main_frame->g_TASInputDlg2->TASInputDlgHasFocus())
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if(main_frame->g_TASInputDlg3->TASInputDlgHasFocus())
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,10 +120,7 @@ public:
|
|||||||
CCodeWindow* g_pCodeWindow;
|
CCodeWindow* g_pCodeWindow;
|
||||||
NetPlaySetupDiag* g_NetPlaySetupDiag;
|
NetPlaySetupDiag* g_NetPlaySetupDiag;
|
||||||
wxCheatsWindow* g_CheatsWindow;
|
wxCheatsWindow* g_CheatsWindow;
|
||||||
TASInputDlg* g_TASInputDlg;
|
TASInputDlg* g_TASInputDlg[4];
|
||||||
TASInputDlg* g_TASInputDlg1;
|
|
||||||
TASInputDlg* g_TASInputDlg2;
|
|
||||||
TASInputDlg* g_TASInputDlg3;
|
|
||||||
|
|
||||||
void InitBitmaps();
|
void InitBitmaps();
|
||||||
void DoPause();
|
void DoPause();
|
||||||
|
@ -27,7 +27,6 @@ window handle that is returned by CreateWindow() can be accessed from
|
|||||||
Core::GetWindowHandle().
|
Core::GetWindowHandle().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "Setup.h" // Common
|
#include "Setup.h" // Common
|
||||||
|
|
||||||
#include "NetWindow.h"
|
#include "NetWindow.h"
|
||||||
@ -99,6 +98,8 @@ extern "C" {
|
|||||||
#include "../resources/KDE.h"
|
#include "../resources/KDE.h"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
// Create menu items
|
// Create menu items
|
||||||
// ---------------------
|
// ---------------------
|
||||||
void CFrame::CreateMenu()
|
void CFrame::CreateMenu()
|
||||||
@ -699,28 +700,15 @@ void CFrame::OnRecordReadOnly(wxCommandEvent& event)
|
|||||||
|
|
||||||
void CFrame::OnTASInput(wxCommandEvent& event)
|
void CFrame::OnTASInput(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
if(SConfig::GetInstance().m_SIDevice[0] == SIDEVICE_GC_CONTROLLER)
|
std::string number[4] = {"1","2","3","4"};
|
||||||
{
|
|
||||||
g_TASInputDlg->Show(true);
|
|
||||||
g_TASInputDlg->SetTitle("TAS Input - Controller 1");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(SConfig::GetInstance().m_SIDevice[1] == SIDEVICE_GC_CONTROLLER)
|
for(int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
g_TASInputDlg1->Show(true);
|
if(SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_CONTROLLER)
|
||||||
g_TASInputDlg1->SetTitle("TAS Input - Controller 2");
|
{
|
||||||
}
|
g_TASInputDlg[i]->Show(true);
|
||||||
|
g_TASInputDlg[i]->SetTitle("TAS Input - Controller " + number[i]);
|
||||||
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");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user