mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 00:28:20 +08:00
Fix: win10toast_persist import
For compatibility with older Alas, users who don't enable notifications don't need to import win10toast_persist.
This commit is contained in:
@@ -9,12 +9,9 @@ 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()
|
||||
@@ -23,8 +20,9 @@ class Device(Screenshot, Control, AppControl):
|
||||
|
||||
def send_notification(self, title, message):
|
||||
if self.config.ENABLE_NOTIFICATIONS and sys.platform == 'win32':
|
||||
from win10toast_persist import ToastNotifier
|
||||
notify = ToastNotifier()
|
||||
notify.show_toast(title, message, icon_path='assets\gooey\icon.ico', duration=None)
|
||||
notify.show_toast(title, message, icon_path='assets/gooey/icon.ico', duration=None)
|
||||
|
||||
def handle_night_commission(self, hour=21, threshold=30):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user