early-access version 3987
This commit is contained in:
parent
2a27dd5f8c
commit
2358e6443d
6 changed files with 38 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
||||||
yuzu emulator early access
|
yuzu emulator early access
|
||||||
=============
|
=============
|
||||||
|
|
||||||
This is the source code for early-access 3986.
|
This is the source code for early-access 3987.
|
||||||
|
|
||||||
## Legal Notice
|
## Legal Notice
|
||||||
|
|
||||||
|
|
|
@ -284,7 +284,7 @@ void Config::ReadDisabledAddOnValues() {
|
||||||
const int size = BeginArray(std::string(""));
|
const int size = BeginArray(std::string(""));
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
SetArrayIndex(i);
|
SetArrayIndex(i);
|
||||||
const auto title_id = ReadIntegerSetting(std::string("title_id"), 0);
|
const auto title_id = ReadUnsignedIntegerSetting(std::string("title_id"), 0);
|
||||||
std::vector<std::string> out;
|
std::vector<std::string> out;
|
||||||
const int d_size = BeginArray("disabled");
|
const int d_size = BeginArray("disabled");
|
||||||
for (int j = 0; j < d_size; ++j) {
|
for (int j = 0; j < d_size; ++j) {
|
||||||
|
@ -664,6 +664,33 @@ s64 Config::ReadIntegerSetting(const std::string& key, const std::optional<s64>
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u64 Config::ReadUnsignedIntegerSetting(const std::string& key,
|
||||||
|
const std::optional<u64> default_value) {
|
||||||
|
std::string full_key = GetFullKey(key, false);
|
||||||
|
if (!default_value.has_value()) {
|
||||||
|
try {
|
||||||
|
return std::stoull(
|
||||||
|
std::string(config->GetValue(GetSection().c_str(), full_key.c_str(), "0")));
|
||||||
|
} catch (...) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
u64 result = 0;
|
||||||
|
if (config->GetBoolValue(GetSection().c_str(),
|
||||||
|
std::string(full_key).append("\\default").c_str(), true)) {
|
||||||
|
result = default_value.value();
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
result = std::stoull(std::string(config->GetValue(
|
||||||
|
GetSection().c_str(), full_key.c_str(), ToString(default_value.value()).c_str())));
|
||||||
|
} catch (...) {
|
||||||
|
result = default_value.value();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
double Config::ReadDoubleSetting(const std::string& key,
|
double Config::ReadDoubleSetting(const std::string& key,
|
||||||
const std::optional<double> default_value) {
|
const std::optional<double> default_value) {
|
||||||
std::string full_key = GetFullKey(key, false);
|
std::string full_key = GetFullKey(key, false);
|
||||||
|
|
|
@ -137,6 +137,8 @@ protected:
|
||||||
bool ReadBooleanSetting(const std::string& key,
|
bool ReadBooleanSetting(const std::string& key,
|
||||||
std::optional<bool> default_value = std::nullopt);
|
std::optional<bool> default_value = std::nullopt);
|
||||||
s64 ReadIntegerSetting(const std::string& key, std::optional<s64> default_value = std::nullopt);
|
s64 ReadIntegerSetting(const std::string& key, std::optional<s64> default_value = std::nullopt);
|
||||||
|
u64 ReadUnsignedIntegerSetting(const std::string& key,
|
||||||
|
std::optional<u64> default_value = std::nullopt);
|
||||||
double ReadDoubleSetting(const std::string& key,
|
double ReadDoubleSetting(const std::string& key,
|
||||||
std::optional<double> default_value = std::nullopt);
|
std::optional<double> default_value = std::nullopt);
|
||||||
std::string ReadStringSetting(const std::string& key,
|
std::string ReadStringSetting(const std::string& key,
|
||||||
|
@ -170,6 +172,8 @@ protected:
|
||||||
return value_.has_value() ? std::to_string(*value_) : "none";
|
return value_.has_value() ? std::to_string(*value_) : "none";
|
||||||
} else if constexpr (std::is_same_v<T, bool>) {
|
} else if constexpr (std::is_same_v<T, bool>) {
|
||||||
return value_ ? "true" : "false";
|
return value_ ? "true" : "false";
|
||||||
|
} else if constexpr (std::is_same_v<T, u64>) {
|
||||||
|
return std::to_string(static_cast<u64>(value_));
|
||||||
} else {
|
} else {
|
||||||
return std::to_string(static_cast<s64>(value_));
|
return std::to_string(static_cast<s64>(value_));
|
||||||
}
|
}
|
||||||
|
|
|
@ -283,7 +283,8 @@ void QtConfig::ReadUIGamelistValues() {
|
||||||
const int favorites_size = BeginArray("favorites");
|
const int favorites_size = BeginArray("favorites");
|
||||||
for (int i = 0; i < favorites_size; i++) {
|
for (int i = 0; i < favorites_size; i++) {
|
||||||
SetArrayIndex(i);
|
SetArrayIndex(i);
|
||||||
UISettings::values.favorited_ids.append(ReadIntegerSetting(std::string("program_id")));
|
UISettings::values.favorited_ids.append(
|
||||||
|
ReadUnsignedIntegerSetting(std::string("program_id")));
|
||||||
}
|
}
|
||||||
EndArray();
|
EndArray();
|
||||||
|
|
||||||
|
|
|
@ -194,7 +194,7 @@ QWidget* Widget::CreateRadioGroup(std::function<std::string()>& serializer,
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto get_selected = [=]() -> int {
|
const auto get_selected = [this]() -> int {
|
||||||
for (const auto& [id, button] : radio_buttons) {
|
for (const auto& [id, button] : radio_buttons) {
|
||||||
if (button->isChecked()) {
|
if (button->isChecked()) {
|
||||||
return id;
|
return id;
|
||||||
|
@ -203,7 +203,7 @@ QWidget* Widget::CreateRadioGroup(std::function<std::string()>& serializer,
|
||||||
return -1;
|
return -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto set_index = [=](u32 value) {
|
const auto set_index = [this](u32 value) {
|
||||||
for (const auto& [id, button] : radio_buttons) {
|
for (const auto& [id, button] : radio_buttons) {
|
||||||
button->setChecked(id == value);
|
button->setChecked(id == value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -479,6 +479,6 @@ void GameListWorker::run() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RecordEvent([=](GameList* game_list) { game_list->DonePopulating(watch_list); });
|
RecordEvent([this](GameList* game_list) { game_list->DonePopulating(watch_list); });
|
||||||
processing_completed.Set();
|
processing_completed.Set();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue