1
0
mirror of synced 2025-02-26 14:21:39 +01:00

fix: Resetting shortcuts not saving change to settings

This commit is contained in:
WerWolv 2023-11-19 18:22:57 +01:00
parent 836d66a150
commit 4b13cd666b

View File

@ -224,10 +224,14 @@ namespace hex::plugin::builtin {
if (this->m_hasDuplicate) if (this->m_hasDuplicate)
ImGui::PopStyleColor(); ImGui::PopStyleColor();
bool settingChanged = false;
ImGui::BeginDisabled(this->m_shortcut == this->m_defaultShortcut); ImGui::BeginDisabled(this->m_shortcut == this->m_defaultShortcut);
if (ImGuiExt::IconButton(ICON_VS_X, ImGui::GetStyleColorVec4(ImGuiCol_Text))) { if (ImGuiExt::IconButton(ICON_VS_X, ImGui::GetStyleColorVec4(ImGuiCol_Text))) {
this->m_hasDuplicate = !ShortcutManager::updateShortcut(this->m_shortcut, this->m_defaultShortcut, this->m_view); this->m_hasDuplicate = !ShortcutManager::updateShortcut(this->m_shortcut, this->m_defaultShortcut, this->m_view);
this->m_shortcut = this->m_defaultShortcut; this->m_shortcut = this->m_defaultShortcut;
settingChanged = true;
} }
ImGui::EndDisabled(); ImGui::EndDisabled();
@ -247,11 +251,11 @@ namespace hex::plugin::builtin {
this->m_editing = false; this->m_editing = false;
ShortcutManager::resumeShortcuts(); ShortcutManager::resumeShortcuts();
return true; settingChanged = true;
} }
} }
return false; return settingChanged;
} }
void load(const nlohmann::json &data) override { void load(const nlohmann::json &data) override {