From 792cb46ce6951a7a7a6e1fea0310ff836600e73c Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Fri, 19 May 2023 17:38:08 -0400 Subject: [PATCH] resolved register simplification --- coordinator/ui/components/unit_detail.lua | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/coordinator/ui/components/unit_detail.lua b/coordinator/ui/components/unit_detail.lua index 12dc6b2..30e2044 100644 --- a/coordinator/ui/components/unit_detail.lua +++ b/coordinator/ui/components/unit_detail.lua @@ -522,15 +522,11 @@ local function init(parent, id) end) -- enable/disable controls based on group assignment (start button is separate) - -- REGISTER_NOTE: register to parent element for brevity - burn_control.register(u_ps, "auto_group_id", function (gid) - if gid == 0 then - burn_rate.enable() - set_burn_btn.enable() - else - burn_rate.disable() - set_burn_btn.disable() - end + burn_rate.register(u_ps, "auto_group_id", function (gid) + if gid == 0 then burn_rate.enable() else burn_rate.disable() end + end) + set_burn_btn.register(u_ps, "auto_group_id", function (gid) + if gid == 0 then set_burn_btn.enable() else set_burn_btn.disable() end end) -- can't change group if auto is engaged regardless of if this unit is part of auto control