mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-03 22:14:02 +00:00
Fix async OSK loading (#2531)
This commit is contained in:
parent
1b5a479bbd
commit
c5e6665010
@ -79,6 +79,7 @@ public:
|
|||||||
MsgDialogType type{};
|
MsgDialogType type{};
|
||||||
|
|
||||||
std::function<void(s32 status)> on_close;
|
std::function<void(s32 status)> on_close;
|
||||||
|
std::function<void()> on_osk_input_entered;
|
||||||
|
|
||||||
virtual ~MsgDialogBase();
|
virtual ~MsgDialogBase();
|
||||||
virtual void Create(const std::string& msg) = 0;
|
virtual void Create(const std::string& msg) = 0;
|
||||||
|
@ -21,7 +21,7 @@ s32 cellOskDialogLoadAsync(u32 container, vm::ptr<CellOskDialogParam> dialogPara
|
|||||||
|
|
||||||
osk->on_close = [&](s32 status)
|
osk->on_close = [&](s32 status)
|
||||||
{
|
{
|
||||||
if (status == 1) {
|
if (status == CELL_MSGDIALOG_BUTTON_OK) {
|
||||||
sysutil_send_system_cmd(CELL_SYSUTIL_OSKDIALOG_FINISHED, 0);
|
sysutil_send_system_cmd(CELL_SYSUTIL_OSKDIALOG_FINISHED, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -30,11 +30,18 @@ s32 cellOskDialogLoadAsync(u32 container, vm::ptr<CellOskDialogParam> dialogPara
|
|||||||
result = true;
|
result = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
osk->on_osk_input_entered = [&]()
|
||||||
|
{
|
||||||
|
sysutil_send_system_cmd(CELL_SYSUTIL_OSKDIALOG_INPUT_ENTERED, 0);
|
||||||
|
};
|
||||||
|
|
||||||
Emu.CallAfter([&]()
|
Emu.CallAfter([&]()
|
||||||
{
|
{
|
||||||
osk->CreateOsk("On Screen Keyboard", s_osk_text);
|
osk->CreateOsk("On Screen Keyboard", s_osk_text);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
sysutil_send_system_cmd(CELL_SYSUTIL_OSKDIALOG_LOADED, 0);
|
||||||
|
|
||||||
while (!result)
|
while (!result)
|
||||||
{
|
{
|
||||||
thread_ctrl::wait_for(1000);
|
thread_ctrl::wait_for(1000);
|
||||||
@ -52,6 +59,8 @@ s32 cellOskDialogUnloadAsync(vm::ptr<CellOskDialogCallbackReturnParam> OutputInf
|
|||||||
*(OutputInfo->pResultString + i) = (be_t<u16>)*(s_osk_text + i);
|
*(OutputInfo->pResultString + i) = (be_t<u16>)*(s_osk_text + i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sysutil_send_system_cmd(CELL_SYSUTIL_OSKDIALOG_UNLOADED, 0);
|
||||||
|
|
||||||
return CELL_OSKDIALOG_OK;
|
return CELL_OSKDIALOG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +26,13 @@ void MsgDialogFrame::CreateOsk(const std::string& msg, char16_t* osk_text)
|
|||||||
osk_text_input->SetFocus();
|
osk_text_input->SetFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
osk_text_input->Bind(wxEVT_TEXT, [&](wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
wxUString wx_osk_string = osk_text_input->GetValue();
|
||||||
|
std::memcpy(osk_text_return, wx_osk_string.utf16_str(), wx_osk_string.size() * 2);
|
||||||
|
on_osk_input_entered();
|
||||||
|
});
|
||||||
|
|
||||||
osk_button_ok = new wxButton(m_dialog, wxID_OK);
|
osk_button_ok = new wxButton(m_dialog, wxID_OK);
|
||||||
osk_button_sizer->Add(osk_button_ok, 0, wxLEFT | wxRIGHT | wxBOTTOM, 4);
|
osk_button_sizer->Add(osk_button_ok, 0, wxLEFT | wxRIGHT | wxBOTTOM, 4);
|
||||||
|
|
||||||
@ -39,8 +46,6 @@ void MsgDialogFrame::CreateOsk(const std::string& msg, char16_t* osk_text)
|
|||||||
|
|
||||||
m_dialog->Bind(wxEVT_BUTTON, [&](wxCommandEvent& event)
|
m_dialog->Bind(wxEVT_BUTTON, [&](wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
wxUString wx_osk_string = osk_text_input->GetValue();
|
|
||||||
std::memcpy(osk_text_return, wx_osk_string.utf16_str(), wx_osk_string.size() * 2);
|
|
||||||
on_close(CELL_MSGDIALOG_BUTTON_OK);
|
on_close(CELL_MSGDIALOG_BUTTON_OK);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user