From 9853fdbaf4446c5cdccf91e3148178e8d4c14b63 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Mon, 24 Jul 2023 21:15:41 +0200 Subject: [PATCH] early-access version 3777 --- README.md | 2 +- src/common/settings_common.h | 17 +++++----- src/yuzu/configuration/shared_widget.cpp | 41 +++++++++++++----------- src/yuzu/game_list_worker.cpp | 6 +++- 4 files changed, 37 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 5f9c786ab..f2d6af7f4 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3776. +This is the source code for early-access 3777. ## Legal Notice diff --git a/src/common/settings_common.h b/src/common/settings_common.h index 6f90ae90d..2efb329b0 100755 --- a/src/common/settings_common.h +++ b/src/common/settings_common.h @@ -46,17 +46,18 @@ constexpr u8 SpecializationTypeMask = 0xf; constexpr u8 SpecializationAttributeMask = 0xf0; constexpr u8 SpecializationAttributeOffset = 4; +// Scalar and countable could have better names enum Specialization : u8 { Default = 0, - Time = 1, - Hex = 2, - List = 3, - RuntimeList = 4, - Scalar = 5, - Countable = 6, - Paired = 7, + Time = 1, // Duration or specific moment in time + Hex = 2, // Hexadecimal number + List = 3, // Setting has specific members + RuntimeList = 4, // Members of the list are determined during runtime + Scalar = 5, // Values are continuous + Countable = 6, // Can be stepped through + Paired = 7, // Another setting is associated with this setting - Percentage = (1 << SpecializationAttributeOffset), + Percentage = (1 << SpecializationAttributeOffset), // Should be represented as a percentage }; class BasicSetting; diff --git a/src/yuzu/configuration/shared_widget.cpp b/src/yuzu/configuration/shared_widget.cpp index 74985129b..410fa80cd 100755 --- a/src/yuzu/configuration/shared_widget.cpp +++ b/src/yuzu/configuration/shared_widget.cpp @@ -390,25 +390,6 @@ void Widget::SetupComponent(const QString& label, std::function& load_fu QWidget* data_component{nullptr}; - if (!Settings::IsConfiguringGlobal() && managed) { - restore_button = CreateRestoreGlobalButton(setting.UsingGlobal(), this); - - touch = [this]() { - LOG_DEBUG(Frontend, "Enabling custom setting for \"{}\"", setting.GetLabel()); - restore_button->setEnabled(true); - restore_button->setVisible(true); - }; - } - - if (require_checkbox) { - QWidget* lhs = - CreateCheckBox(other_setting, label, checkbox_serializer, checkbox_restore_func, touch); - layout->addWidget(lhs); - } else if (setting.TypeId() != typeid(bool)) { - QLabel* qt_label = CreateLabel(label); - layout->addWidget(qt_label); - } - request = [&]() { if (request != RequestType::Default) { return request; @@ -435,6 +416,25 @@ void Widget::SetupComponent(const QString& label, std::function& load_fu return request; }(); + if (!Settings::IsConfiguringGlobal() && managed) { + restore_button = CreateRestoreGlobalButton(setting.UsingGlobal(), this); + + touch = [this]() { + LOG_DEBUG(Frontend, "Enabling custom setting for \"{}\"", setting.GetLabel()); + restore_button->setEnabled(true); + restore_button->setVisible(true); + }; + } + + if (require_checkbox) { + QWidget* lhs = + CreateCheckBox(other_setting, label, checkbox_serializer, checkbox_restore_func, touch); + layout->addWidget(lhs); + } else if (setting.TypeId() != typeid(bool)) { + QLabel* qt_label = CreateLabel(label); + layout->addWidget(qt_label); + } + if (setting.TypeId() == typeid(bool)) { data_component = CreateCheckBox(&setting, label, serializer, restore_func, touch); } else if (setting.IsEnum()) { @@ -505,6 +505,9 @@ void Widget::SetupComponent(const QString& label, std::function& load_fu QObject::connect(restore_button, &QAbstractButton::clicked, [this, restore_func, checkbox_restore_func](bool) { + LOG_DEBUG(Frontend, "Restore global state for \"{}\"", + setting.GetLabel()); + restore_button->setEnabled(false); restore_button->setVisible(false); diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp index d266320d3..e72dbef9c 100755 --- a/src/yuzu/game_list_worker.cpp +++ b/src/yuzu/game_list_worker.cpp @@ -265,7 +265,11 @@ void GameListWorker::AddTitlesToGameList(GameListDir* parent_dir) { std::vector icon; std::string name; u64 program_id = 0; - loader->ReadProgramId(program_id); + const auto result = loader->ReadProgramId(program_id); + + if (result != Loader::ResultStatus::Success) { + continue; + } const PatchManager patch{program_id, system.GetFileSystemController(), system.GetContentProvider()};