1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 00:28:20 +08:00

Refactor: 抽象出处理确认弹窗的逻辑

- 删除了一些无用的assets
- 纠正了一些拼写错误
This commit is contained in:
LmeSzinc
2020-04-13 23:00:19 +08:00
parent 5b3dc4ec85
commit ad73de92dd
22 changed files with 49 additions and 35 deletions

View File

@@ -9,7 +9,6 @@ EQUIP_1 = Button(area=(1218, 249, 1274, 302), color=(102, 152, 219), button=(121
EQUIP_2 = Button(area=(1218, 349, 1274, 402), color=(101, 150, 215), button=(1218, 349, 1274, 402), file='./assets/equipment/EQUIP_2.png')
EQUIP_3 = Button(area=(1218, 450, 1274, 503), color=(98, 145, 211), button=(1218, 450, 1274, 503), file='./assets/equipment/EQUIP_3.png')
EQUIP_OFF = Button(area=(933, 548, 1063, 593), color=(107, 151, 216), button=(933, 548, 1063, 593), file='./assets/equipment/EQUIP_OFF.png')
EQUIP_OFF_CONFIRM = Button(area=(703, 492, 877, 550), color=(96, 144, 204), button=(703, 492, 877, 550), file='./assets/equipment/EQUIP_OFF_CONFIRM.png')
FLEET_ENTER = Button(area=(502, 474, 517, 489), color=(58, 62, 77), button=(502, 474, 517, 489), file='./assets/equipment/FLEET_ENTER.png')
FLEET_NEXT = Button(area=(1234, 327, 1254, 356), color=(72, 93, 125), button=(1234, 327, 1254, 356), file='./assets/equipment/FLEET_NEXT.png')
FLEET_PREV = Button(area=(26, 327, 46, 356), color=(72, 93, 125), button=(26, 327, 46, 356), file='./assets/equipment/FLEET_PREV.png')

View File

@@ -1,6 +1,7 @@
from module.base.timer import Timer
from module.equipment.assets import *
from module.handler.info_bar import InfoBarHandler
from module.handler.popup import PopupHandler
from module.logger import logger
from module.ui.assets import BACK_ARROW
@@ -8,7 +9,7 @@ SWIPE_DISTANCE = 250
SWIPE_RANDOM_RANGE = (-40, -20, 40, 20)
class Equipment(InfoBarHandler):
class Equipment(InfoBarHandler, PopupHandler):
equipment_has_take_on = False
def _view_swipe(self, distance):
@@ -78,7 +79,7 @@ class Equipment(InfoBarHandler):
off_timer.reset()
continue
if confirm_timer.reached() and self.appear_then_click(EQUIP_OFF_CONFIRM, offset=10):
if confirm_timer.reached() and self.handle_popup_confirm():
confirm_timer.reset()
continue