mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-16 06:25:24 +00:00
Opt: Faster camera module
This commit is contained in:
parent
71b02ae767
commit
c793a6ad3d
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
@ -63,16 +63,6 @@ CONSUMABLES_TRICK_SNACK_CHECK = ButtonWrapper(
|
|||||||
button=(593, 188, 678, 267),
|
button=(593, 188, 678, 267),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
PICTURE_TAKEN = ButtonWrapper(
|
|
||||||
name='PICTURE_TAKEN',
|
|
||||||
cn=Button(
|
|
||||||
file='./assets/cn/daily/PICTURE_TAKEN.png',
|
|
||||||
area=(1030, 620, 1069, 639),
|
|
||||||
search=(1010, 600, 1089, 659),
|
|
||||||
color=(153, 153, 155),
|
|
||||||
button=(1030, 620, 1069, 639),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
RECIPE_UNLOCK = ButtonWrapper(
|
RECIPE_UNLOCK = ButtonWrapper(
|
||||||
name='RECIPE_UNLOCK',
|
name='RECIPE_UNLOCK',
|
||||||
cn=Button(
|
cn=Button(
|
||||||
@ -123,13 +113,3 @@ SYNTHESIZE_GOTO_CONSUMABLES = ButtonWrapper(
|
|||||||
button=(38, 120, 78, 141),
|
button=(38, 120, 78, 141),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
TAKE_PICTURE = ButtonWrapper(
|
|
||||||
name='TAKE_PICTURE',
|
|
||||||
share=Button(
|
|
||||||
file='./assets/share/daily/TAKE_PICTURE.png',
|
|
||||||
area=(1120, 344, 1160, 375),
|
|
||||||
search=(1100, 324, 1180, 395),
|
|
||||||
color=(172, 173, 172),
|
|
||||||
button=(1120, 344, 1160, 375),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
25
tasks/daily/assets/assets_daily_camera.py
Normal file
25
tasks/daily/assets/assets_daily_camera.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
from module.base.button import Button, ButtonWrapper
|
||||||
|
|
||||||
|
# This file was auto-generated, do not modify it manually. To generate:
|
||||||
|
# ``` python -m dev_tools.button_extract ```
|
||||||
|
|
||||||
|
PICTURE_TAKEN = ButtonWrapper(
|
||||||
|
name='PICTURE_TAKEN',
|
||||||
|
cn=Button(
|
||||||
|
file='./assets/cn/daily/camera/PICTURE_TAKEN.png',
|
||||||
|
area=(1030, 620, 1069, 639),
|
||||||
|
search=(1010, 600, 1089, 659),
|
||||||
|
color=(153, 153, 155),
|
||||||
|
button=(1030, 620, 1069, 639),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
TAKE_PICTURE = ButtonWrapper(
|
||||||
|
name='TAKE_PICTURE',
|
||||||
|
share=Button(
|
||||||
|
file='./assets/share/daily/camera/TAKE_PICTURE.png',
|
||||||
|
area=(1120, 344, 1160, 375),
|
||||||
|
search=(1100, 324, 1180, 395),
|
||||||
|
color=(172, 173, 172),
|
||||||
|
button=(1120, 344, 1160, 375),
|
||||||
|
),
|
||||||
|
)
|
@ -1,8 +1,8 @@
|
|||||||
from module.logger import logger
|
from module.logger import logger
|
||||||
from tasks.base.assets.assets_base_page import CLOSE
|
from tasks.base.assets.assets_base_page import CLOSE
|
||||||
from tasks.base.page import page_camera
|
from tasks.base.page import page_camera, page_main
|
||||||
from tasks.base.ui import UI
|
from tasks.base.ui import UI
|
||||||
from tasks.daily.assets.assets_daily import *
|
from tasks.daily.assets.assets_daily_camera import PICTURE_TAKEN, TAKE_PICTURE
|
||||||
|
|
||||||
|
|
||||||
class CameraUI(UI):
|
class CameraUI(UI):
|
||||||
@ -25,7 +25,7 @@ class CameraUI(UI):
|
|||||||
skip_first_screenshot = False
|
skip_first_screenshot = False
|
||||||
else:
|
else:
|
||||||
self.device.screenshot()
|
self.device.screenshot()
|
||||||
if self.appear_then_click(TAKE_PICTURE):
|
if self.appear_then_click(TAKE_PICTURE, interval=1):
|
||||||
logger.info('Taking picture')
|
logger.info('Taking picture')
|
||||||
continue
|
continue
|
||||||
if self.appear(PICTURE_TAKEN):
|
if self.appear(PICTURE_TAKEN):
|
||||||
@ -38,9 +38,15 @@ class CameraUI(UI):
|
|||||||
skip_first_screenshot = False
|
skip_first_screenshot = False
|
||||||
else:
|
else:
|
||||||
self.device.screenshot()
|
self.device.screenshot()
|
||||||
if self.appear(TAKE_PICTURE):
|
if self.appear(page_main.check_button):
|
||||||
logger.info('Back to camera main page')
|
logger.info('Back to camera main page')
|
||||||
break
|
break
|
||||||
if self.appear_then_click(CLOSE):
|
if self.appear(PICTURE_TAKEN, interval=1):
|
||||||
logger.info('Photo page was exited')
|
self.device.click(CLOSE)
|
||||||
|
logger.info(f'{PICTURE_TAKEN} -> {CLOSE}')
|
||||||
|
self.interval_reset(TAKE_PICTURE)
|
||||||
|
continue
|
||||||
|
if self.appear(TAKE_PICTURE, interval=1):
|
||||||
|
self.device.click(CLOSE)
|
||||||
|
logger.info(f'{TAKE_PICTURE} -> {CLOSE}')
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user