mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 13:05:25 -05:00
impr: Add abstraction for common variable-saved-as-setting code pattern
This commit is contained in:
@@ -15,11 +15,7 @@ namespace hex::plugin::windows {
|
||||
|
||||
void addFooterItems() {
|
||||
|
||||
static bool showResourceUsage = true;
|
||||
ContentRegistry::Settings::onChange("hex.builtin.setting.interface", "hex.builtin.setting.interface.show_resource_usage", [](const ContentRegistry::Settings::SettingsValue &value) {
|
||||
showResourceUsage = value.get<bool>(false);
|
||||
});
|
||||
|
||||
static ContentRegistry::Settings::SettingsVariable<bool, "hex.builtin.setting.interface", "hex.builtin.setting.interface.show_resource_usage"> showResourceUsage = false;
|
||||
ContentRegistry::UserInterface::addFooterItem([] {
|
||||
if (!showResourceUsage)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user