summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Src/Frame.cpp
diff options
context:
space:
mode:
authorRachel Bryk <RachelBryk@gmail.com>2013-07-23 20:44:21 -0400
committerRachel Bryk <RachelBryk@gmail.com>2013-07-23 20:44:21 -0400
commit7a6eeb5fbd5de1a65aae04ebc7be0b9ea400a337 (patch)
treec9c6ef31df44362842639add44f1476f443b5968 /Source/Core/DolphinWX/Src/Frame.cpp
parent8a4b6f3d73944d84df5c1ae70ec3d331c6f78009 (diff)
parent3f03588decc18ddb4441cd6480eb36885eae7f8a (diff)
Merge branch 'multi-tas-input'
Diffstat (limited to 'Source/Core/DolphinWX/Src/Frame.cpp')
-rw-r--r--Source/Core/DolphinWX/Src/Frame.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp
index aaa16d80cb..af71066314 100644
--- a/Source/Core/DolphinWX/Src/Frame.cpp
+++ b/Source/Core/DolphinWX/Src/Frame.cpp
@@ -327,7 +327,11 @@ CFrame::CFrame(wxFrame* parent,
m_LogWindow->Hide();
m_LogWindow->Disable();
- g_TASInputDlg = 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);
@@ -784,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);
@@ -794,13 +798,24 @@ void OnAfterLoadCallback()
void TASManipFunction(SPADStatus *PadStatus, int controllerID)
{
if (main_frame)
- main_frame->g_TASInputDlg->GetValues(PadStatus, controllerID);
+ main_frame->g_TASInputDlg[controllerID]->GetValues(PadStatus, controllerID);
}
+bool TASInputHasFocus()
+{
+ for (int i = 0; i < 4; i++)
+ {
+ if (main_frame->g_TASInputDlg[i]->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 +849,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++)
{