mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 13:05:25 -05:00
fix: Handling of unchanged shortcut keys
This commit is contained in:
@@ -336,6 +336,9 @@ namespace hex::plugin::builtin {
|
||||
void load(const nlohmann::json &data) override {
|
||||
std::set<Key> keys;
|
||||
|
||||
if (data.empty())
|
||||
return;
|
||||
|
||||
for (const auto &key : data.get<std::vector<u32>>())
|
||||
keys.insert(Key(scanCodeToKey(key)));
|
||||
|
||||
|
||||
@@ -32,11 +32,13 @@ namespace hex::plugin::builtin {
|
||||
for (const auto &[unlocalizedCategory, unlocalizedDescription, subCategories] : ContentRegistry::Settings::impl::getSettings()) {
|
||||
for (const auto &[unlocalizedSubCategory, entries] : subCategories) {
|
||||
for (const auto &[unlocalizedName, widget] : entries) {
|
||||
auto defaultValue = widget->store();
|
||||
try {
|
||||
auto defaultValue = widget->store();
|
||||
widget->load(ContentRegistry::Settings::impl::getSetting(unlocalizedCategory, unlocalizedName, defaultValue));
|
||||
} catch (const std::exception &e) {
|
||||
log::error("Failed to load setting [{} / {}]: {}", unlocalizedCategory.get(), unlocalizedName.get(), e.what());
|
||||
|
||||
ContentRegistry::Settings::impl::getSetting(unlocalizedCategory, unlocalizedName, defaultValue) = defaultValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user