From 730f35c33df409e0d701d8f0eab5330dafef83a2 Mon Sep 17 00:00:00 2001 From: jasonpanosso Date: Tue, 26 Mar 2024 19:34:13 -0400 Subject: [PATCH] swap contents of conditional branch to fix optional rule groups --- .../ui/modal/panel/EditAllAutoLayerRules.hx | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/electron.renderer/ui/modal/panel/EditAllAutoLayerRules.hx b/src/electron.renderer/ui/modal/panel/EditAllAutoLayerRules.hx index 911cd23d4..fd8230177 100644 --- a/src/electron.renderer/ui/modal/panel/EditAllAutoLayerRules.hx +++ b/src/electron.renderer/ui/modal/panel/EditAllAutoLayerRules.hx @@ -745,18 +745,6 @@ class EditAllAutoLayerRules extends ui.modal.Panel { }); if( rg.isOptional ) - ctx.addActionElement({ - label: L.t._("Turn into an OPTIONAL group"), - subText: L.t._("An optional group is disabled everywhere by default, and can be enabled manually only in some specific levels."), - iconId: "optional", - cb: ()->{ - invalidateRuleGroup(rg); - rg.isOptional = true; - rg.active = true; // just some cleanup - editor.ge.emit( LayerRuleGroupChanged(rg) ); - }, - }); - else ctx.addActionElement({ label: L.t._("Disable OPTIONAL state"), cb: ()->{ @@ -772,6 +760,18 @@ class EditAllAutoLayerRules extends ui.modal.Panel { ); }, }); + else + ctx.addActionElement({ + label: L.t._("Turn into an OPTIONAL group"), + subText: L.t._("An optional group is disabled everywhere by default, and can be enabled manually only in some specific levels."), + iconId: "optional", + cb: ()->{ + invalidateRuleGroup(rg); + rg.isOptional = true; + rg.active = true; // just some cleanup + editor.ge.emit( LayerRuleGroupChanged(rg) ); + }, + }); }); // Wizard mode explanation