From 571104831d3d0974a06b252aee4edc0dc0f2541b Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:38:31 +0800 Subject: [PATCH] Fix: Accept `area` attribute in ClickButton --- module/base/button.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/module/base/button.py b/module/base/button.py index 0846696c2..0f9671a32 100644 --- a/module/base/button.py +++ b/module/base/button.py @@ -308,9 +308,12 @@ class ButtonWrapper(Resource): class ClickButton: - def __init__(self, button, name='CLICK_BUTTON'): - self.area = button - self.button = button + def __init__(self, area, button=None, name='CLICK_BUTTON'): + self.area = area + if button is None: + self.button = area + else: + self.button = button self.name = name def __str__(self):