From 1517d2fef79f674fd3cc5361e4ada369a69be963 Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Tue, 26 Feb 2019 23:36:58 +0100 Subject: [PATCH] Address more reviews --- src/citra_qt/applets/mii_selector.cpp | 7 ++++--- src/core/hle/applets/mii_selector.cpp | 5 ++++- src/core/hle/applets/mii_selector.h | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/citra_qt/applets/mii_selector.cpp b/src/citra_qt/applets/mii_selector.cpp index 811804ea5..c7723dd42 100644 --- a/src/citra_qt/applets/mii_selector.cpp +++ b/src/citra_qt/applets/mii_selector.cpp @@ -26,8 +26,9 @@ QtMiiSelectorDialog::QtMiiSelectorDialog(QWidget* parent, QtMiiSelector* mii_sel buttons->addButton(tr(MII_BUTTON_CANCEL), QDialogButtonBox::ButtonRole::RejectRole); } - setWindowTitle(config.title.empty() ? tr("Mii Selector") - : QString::fromStdU16String(config.title)); + setWindowTitle(config.title.empty() || config.title.at(0) == '\x0000' + ? tr("Mii Selector") + : QString::fromStdU16String(config.title)); miis.push_back(HLE::Applets::MiiSelector::GetStandardMiiResult().selected_mii_data); combobox->addItem(tr("Standard Mii")); @@ -35,7 +36,7 @@ QtMiiSelectorDialog::QtMiiSelectorDialog(QWidget* parent, QtMiiSelector* mii_sel std::string nand_directory{FileUtil::GetUserPath(FileUtil::UserPath::NANDDir)}; FileSys::ArchiveFactory_ExtSaveData extdata_archive_factory(nand_directory, true); - auto archive_result = extdata_archive_factory.Open(Service::PTM::ptm_shared_extdata_id); + auto archive_result = extdata_archive_factory.Open(Service::PTM::ptm_shared_extdata_id, 0); if (archive_result.Succeeded()) { auto archive = std::move(archive_result).Unwrap(); diff --git a/src/core/hle/applets/mii_selector.cpp b/src/core/hle/applets/mii_selector.cpp index c606c95f8..cda28ffc3 100644 --- a/src/core/hle/applets/mii_selector.cpp +++ b/src/core/hle/applets/mii_selector.cpp @@ -142,7 +142,10 @@ MiiResult MiiSelector::GetStandardMiiResult() { Frontend::MiiSelectorConfig MiiSelector::ToFrontendConfig(const MiiConfig& config) const { Frontend::MiiSelectorConfig frontend_config; frontend_config.enable_cancel_button = config.enable_cancel_button == 1; - frontend_config.title = reinterpret_cast(config.title.data()); + std::transform(config.title.begin(), config.title.end(), + std::back_inserter(frontend_config.title), [](u16_le character) -> char16_t { + return static_cast(static_cast(character)); + }); frontend_config.initially_selected_mii_index = config.initially_selected_mii_index; return frontend_config; } diff --git a/src/core/hle/applets/mii_selector.h b/src/core/hle/applets/mii_selector.h index d25f972a1..0a8b8113c 100644 --- a/src/core/hle/applets/mii_selector.h +++ b/src/core/hle/applets/mii_selector.h @@ -24,7 +24,7 @@ struct MiiConfig { u8 enable_guest_mii; u8 show_on_top_screen; INSERT_PADDING_BYTES(5); - std::array title; + std::array title; INSERT_PADDING_BYTES(4); u8 show_guest_miis; INSERT_PADDING_BYTES(3);