From e55f139fca7032c3ee16c1a26b2e365177cae4cd Mon Sep 17 00:00:00 2001 From: omicron Date: Tue, 4 Apr 2023 16:31:16 +0200 Subject: [PATCH] Activate indicators when they are set while the trigger is active This fixes an issue where inverted triggers would not immediately activate the indicator when they are created --- src/types/triggers/trigger.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/types/triggers/trigger.lua b/src/types/triggers/trigger.lua index 3e18802..f991963 100644 --- a/src/types/triggers/trigger.lua +++ b/src/types/triggers/trigger.lua @@ -26,7 +26,6 @@ local types = omi.GetModule("types") local Trigger = types.CreateClass("Trigger") types.Trigger = Trigger - --- Initialize a new Trigger object ---@param invert boolean|nil function Trigger:Init(invert) @@ -41,6 +40,9 @@ end ---@param target Indicator function Trigger:SetTarget(target) self.indicator = target + if self.active then + target:Show() + end end ---Set the state of the trigger. Will activate the indicator if needed.