diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-11-08 20:57:53 +0100 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-11-08 20:57:53 +0100 |
commit | 3af2117c886a7751a45ae6bb26216a686b3057ba (patch) | |
tree | fc34ff9929b59a913f2c555dcf8067fff5c9e5bf /src/core/hle/service/am | |
parent | applets/swkbd: Skip text checking if the text has been confirmed (diff) | |
download | yuzu-3af2117c886a7751a45ae6bb26216a686b3057ba.tar yuzu-3af2117c886a7751a45ae6bb26216a686b3057ba.tar.gz yuzu-3af2117c886a7751a45ae6bb26216a686b3057ba.tar.bz2 yuzu-3af2117c886a7751a45ae6bb26216a686b3057ba.tar.lz yuzu-3af2117c886a7751a45ae6bb26216a686b3057ba.tar.xz yuzu-3af2117c886a7751a45ae6bb26216a686b3057ba.tar.zst yuzu-3af2117c886a7751a45ae6bb26216a686b3057ba.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/am/applets/applet_software_keyboard.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/core/hle/service/am/applets/applet_software_keyboard.cpp b/src/core/hle/service/am/applets/applet_software_keyboard.cpp index 1f21cee91..f38f53f69 100644 --- a/src/core/hle/service/am/applets/applet_software_keyboard.cpp +++ b/src/core/hle/service/am/applets/applet_software_keyboard.cpp @@ -278,13 +278,21 @@ void SoftwareKeyboard::ProcessTextCheck() { std::memcpy(&swkbd_text_check, text_check_data.data(), sizeof(SwkbdTextCheck)); - std::u16string text_check_message = - swkbd_text_check.text_check_result == SwkbdTextCheckResult::Failure || - swkbd_text_check.text_check_result == SwkbdTextCheckResult::Confirm - ? Common::UTF16StringFromFixedZeroTerminatedBuffer( - swkbd_text_check.text_check_message.data(), - swkbd_text_check.text_check_message.size()) - : u""; + std::u16string text_check_message = [this, &swkbd_text_check]() -> std::u16string { + if (swkbd_text_check.text_check_result == SwkbdTextCheckResult::Failure || + swkbd_text_check.text_check_result == SwkbdTextCheckResult::Confirm) { + return swkbd_config_common.use_utf8 + ? Common::UTF8ToUTF16(Common::StringFromFixedZeroTerminatedBuffer( + reinterpret_cast<const char*>( + swkbd_text_check.text_check_message.data()), + swkbd_text_check.text_check_message.size() * sizeof(char16_t))) + : Common::UTF16StringFromFixedZeroTerminatedBuffer( + swkbd_text_check.text_check_message.data(), + swkbd_text_check.text_check_message.size()); + } else { + return u""; + } + }(); LOG_INFO(Service_AM, "\nTextCheckResult: {}\nTextCheckMessage: {}", GetTextCheckResultName(swkbd_text_check.text_check_result), |