mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-17 05:15:25 +08:00
Fix: Add support to 150% scaling combat joystick
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from module.base.base import ModuleBase
|
||||
from module.base.timer import Timer
|
||||
from module.combat.assets import COMBAT_AUTO, COMBAT_AUTO_2X, COMBAT_AUTO_SWITCH
|
||||
from module.combat.assets import COMBAT_AUTO, COMBAT_AUTO_133, COMBAT_AUTO_150, COMBAT_AUTO_SWITCH
|
||||
from module.logger import logger
|
||||
|
||||
|
||||
@@ -10,6 +10,18 @@ class CombatAuto(ModuleBase):
|
||||
auto_mode_checked = False
|
||||
auto_mode_click_timer = Timer(5)
|
||||
|
||||
def combat_joystick_appear(self) -> bool:
|
||||
"""
|
||||
If joystick appear, combat is under manual mode.
|
||||
"""
|
||||
if self.appear(COMBAT_AUTO, offset=(20, 20)):
|
||||
return True
|
||||
if self.appear(COMBAT_AUTO_133, offset=(20, 20)):
|
||||
return True
|
||||
if self.appear(COMBAT_AUTO_150, offset=(20, 20)):
|
||||
return True
|
||||
return False
|
||||
|
||||
def combat_auto_reset(self):
|
||||
self.auto_mode_click_timer.reset()
|
||||
self.auto_skip_timer.reset()
|
||||
@@ -35,7 +47,7 @@ class CombatAuto(ModuleBase):
|
||||
return False
|
||||
|
||||
auto = auto == 'combat_auto'
|
||||
if self.appear(COMBAT_AUTO, offset=(20, 20)) or self.appear(COMBAT_AUTO_2X, offset=(20, 20)):
|
||||
if self.combat_joystick_appear():
|
||||
if auto:
|
||||
self.device.click(COMBAT_AUTO_SWITCH)
|
||||
self.auto_click_interval_timer.reset()
|
||||
|
||||
Reference in New Issue
Block a user