summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2015-05-31 23:24:40 -0400
committerLioncash <mathew1800@gmail.com>2015-05-31 23:24:40 -0400
commit2cb073291ce6fc9aa7ee8d09af3d9a315970b451 (patch)
treed2c9c799b5793eae016e382b69f69839b9ce989d /Source/Core
parentda97d77e08a14c295d78ab5e7db47aab3ef92aaf (diff)
parent704f787c5a4fa90e50928174b4fe71eedfc93383 (diff)
Merge pull request #2490 from endrift/fix-tas-threading
DolphinWX: Fix threading issues with TAS pad updates
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinWX/TASInputDlg.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/Source/Core/DolphinWX/TASInputDlg.cpp b/Source/Core/DolphinWX/TASInputDlg.cpp
index 92227406d8..40ced03275 100644
--- a/Source/Core/DolphinWX/TASInputDlg.cpp
+++ b/Source/Core/DolphinWX/TASInputDlg.cpp
@@ -67,6 +67,7 @@ void TASInputDlg::CreateBaseLayout()
m_buttons_dpad->AddSpacer(20);
Bind(wxEVT_CLOSE_WINDOW, &TASInputDlg::OnCloseWindow, this);
+ Bind(wxEVT_TEXT, &TASInputDlg::UpdateFromText, this);
}
const int TASInputDlg::m_gc_pad_buttons_bitmask[12] = {
@@ -471,14 +472,21 @@ void TASInputDlg::SetStickValue(bool* ActivatedByKeyboard, int* AmountPressed, w
{
*AmountPressed = CurrentValue;
*ActivatedByKeyboard = true;
- Textbox->SetValue(std::to_string(*AmountPressed));
}
else if (*ActivatedByKeyboard)
{
*AmountPressed = center;
*ActivatedByKeyboard = false;
- Textbox->SetValue(std::to_string(*AmountPressed));
}
+ else
+ {
+ return;
+ }
+
+ Textbox->ChangeValue(std::to_string(*AmountPressed));
+ wxCommandEvent* evt = new wxCommandEvent(wxEVT_TEXT, Textbox->GetId());
+ evt->SetEventObject(Textbox);
+ wxQueueEvent(this, evt);
}
void TASInputDlg::SetSliderValue(Control* control, int CurrentValue)
@@ -487,14 +495,22 @@ void TASInputDlg::SetSliderValue(Control* control, int CurrentValue)
{
control->value = CurrentValue;
control->set_by_keyboard = true;
- control->text->SetValue(std::to_string(CurrentValue));
+ control->text->ChangeValue(std::to_string(CurrentValue));
}
else if (control->set_by_keyboard)
{
control->value = control->default_value;
control->set_by_keyboard = false;
- control->text->SetValue(std::to_string(control->default_value));
+ control->text->ChangeValue(std::to_string(control->default_value));
}
+ else
+ {
+ return;
+ }
+
+ wxCommandEvent* evt = new wxCommandEvent(wxEVT_TEXT, control->text_id);
+ evt->SetEventObject(control->text);
+ wxQueueEvent(this, evt);
}
void TASInputDlg::SetButtonValue(Button* button, bool CurrentState)