mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-27 22:37:16 +08:00
Chore: [ALAS] Reuse Switch.get() in Switch.appear()
This commit is contained in:
@@ -11,20 +11,6 @@ from module.ui.switch import Switch
|
|||||||
|
|
||||||
|
|
||||||
class HospitalSwitch(Switch):
|
class HospitalSwitch(Switch):
|
||||||
def appear(self, main):
|
|
||||||
"""
|
|
||||||
Args:
|
|
||||||
main (ModuleBase):
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
bool
|
|
||||||
"""
|
|
||||||
for data in self.state_list:
|
|
||||||
if main.image_color_count(data['check_button'], color=(33, 77, 189), threshold=221, count=100):
|
|
||||||
return True
|
|
||||||
|
|
||||||
return False
|
|
||||||
|
|
||||||
def get(self, main):
|
def get(self, main):
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
|
|||||||
@@ -55,13 +55,9 @@ class Switch:
|
|||||||
main (ModuleBase):
|
main (ModuleBase):
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
bool
|
bool:
|
||||||
"""
|
"""
|
||||||
for data in self.state_list:
|
return self.get(main=main) != 'unknown'
|
||||||
if main.appear(data['check_button'], offset=data['offset']):
|
|
||||||
return True
|
|
||||||
|
|
||||||
return False
|
|
||||||
|
|
||||||
def get(self, main):
|
def get(self, main):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user