From 7d2af1004396954197cd288128a03a44d72d2130 Mon Sep 17 00:00:00 2001 From: break27 Date: Fri, 10 Jul 2026 17:34:31 +0800 Subject: [PATCH] fix: added 'deter' function --- src/common/actionflow.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/common/actionflow.py b/src/common/actionflow.py index cb233a0..c4cbd4f 100644 --- a/src/common/actionflow.py +++ b/src/common/actionflow.py @@ -56,9 +56,15 @@ class ActionFlow: assert index is not None, "Action '%s' is not registered" % name return index - def allow(self, action: type[Action], value=True): - index = self.index(action) - self.on[index] = False if value else None + def allow(self, *actions: type[Action]): + for Item in actions: + index = self.index(Item) + self.on[index] = False + + def deter(self, *actions: type[Action]): + for Item in actions: + index = self.index(Item) + self.on[index] = None def stage(self, *preset: type[Action]): for Props in preset: