Skip to content

Commit 3b30ae1

Browse files
committed
♻️ refactor(CommissionsTask): 使 find_quit_btn 支持自定义搜索区域
- 为 find_quit_btn 方法添加 box 参数,以支持在特定区域搜索退出按钮 - 当未提供 box 参数时,使用默认的预定义屏幕区域进行搜索 - 提高搜索灵活性和准确性
1 parent 8ecfeba commit 3b30ae1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/tasks/CommissionsTask.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ def setup_commission_config(self):
5353
"options": ["不使用", "战技", "终结技", "魔灵支援"],
5454
}
5555

56-
def find_quit_btn(self, threshold=0):
57-
return self.find_one("ingame_quit_icon", threshold=threshold)
56+
def find_quit_btn(self, threshold=0, box=None):
57+
if box is None:
58+
box = self.box_of_screen_scaled(2560, 1440, 729, 960, 854, 1025, name="quit_mission", hcenter=True)
59+
return self.find_one("ingame_quit_icon", threshold=threshold, box=box)
5860

5961
def find_continue_btn(self, threshold=0, box=None):
6062
if box is None:

0 commit comments

Comments
 (0)