mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-11 23:18:22 +08:00
Added: added toast notifications support to windows 10
This commit is contained in:
@@ -8,15 +8,24 @@ from module.device.screenshot import Screenshot
|
||||
from module.exception import GameStuckError
|
||||
from module.handler.assets import GET_MISSION
|
||||
from module.logger import logger
|
||||
import sys
|
||||
if sys.platform == 'win32':
|
||||
from win10toast_persist import ToastNotifier
|
||||
|
||||
|
||||
class Device(Screenshot, Control, AppControl):
|
||||
toaster = ToastNotifier()
|
||||
_screen_size_checked = False
|
||||
stuck_record = set()
|
||||
stuck_timer = Timer(60, count=60).start()
|
||||
stuck_timer_long = Timer(300, count=300).start()
|
||||
stuck_long_wait_list = ['BATTLE_STATUS_S', 'PAUSE']
|
||||
|
||||
def send_notification(self, title, message):
|
||||
if self.config.ENABLE_NOTIFICATIONS and sys.platform == 'win32':
|
||||
notify = ToastNotifier()
|
||||
notify.show_toast(title, message, icon_path='assets\gooey\icon.ico', duration=None)
|
||||
|
||||
def handle_night_commission(self, hour=21, threshold=30):
|
||||
"""
|
||||
Args:
|
||||
|
||||
Reference in New Issue
Block a user