Address more reviews

This commit is contained in:
fearlessTobi 2019-02-26 23:36:58 +01:00
parent 781d4b787a
commit 1517d2fef7
3 changed files with 9 additions and 5 deletions

View File

@ -26,7 +26,8 @@ QtMiiSelectorDialog::QtMiiSelectorDialog(QWidget* parent, QtMiiSelector* mii_sel
buttons->addButton(tr(MII_BUTTON_CANCEL), QDialogButtonBox::ButtonRole::RejectRole);
}
setWindowTitle(config.title.empty() ? tr("Mii Selector")
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);
@ -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();

View File

@ -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<const char16_t*>(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<char16_t>(static_cast<u16>(character));
});
frontend_config.initially_selected_mii_index = config.initially_selected_mii_index;
return frontend_config;
}

View File

@ -24,7 +24,7 @@ struct MiiConfig {
u8 enable_guest_mii;
u8 show_on_top_screen;
INSERT_PADDING_BYTES(5);
std::array<u16, 0x40> title;
std::array<u16_le, 0x40> title;
INSERT_PADDING_BYTES(4);
u8 show_guest_miis;
INSERT_PADDING_BYTES(3);