@@ -24,19 +24,18 @@ def set_dpi_aware():
24
24
import queue
25
25
from logging .handlers import QueueHandler , QueueListener
26
26
from multiprocessing import Queue
27
- from pathlib import Path
28
27
from threading import Thread
29
28
from typing import Optional , Union
30
29
31
- from subot import models
30
+ from subot import models , ocr
32
31
from subot .hang_monitor import HangMonitorWorker , HangMonitorChan , HangAnnotation , HangMonitorAlert , Shutdown
33
32
34
33
import cv2
35
34
import numpy as np
36
35
import mss
37
36
from subot .settings import Session , GameControl
38
37
import subot .settings as settings
39
- from subot .ocr import recognize_cv2_image , detect_green_text , detect_dialog_text
38
+ from subot .ocr import detect_green_text , detect_dialog_text , recognize_cv2_image , english_installed
40
39
import win32gui
41
40
import pygame
42
41
import pygame .freetype
@@ -51,7 +50,7 @@ def set_dpi_aware():
51
50
from subot .audio import AudioSystem , AudioLocation , SoundType
52
51
from subot .datatypes import Rect
53
52
from subot .menu import MenuItem , Menu
54
- from subot .messageTypes import NewFrame , MessageImpl , MessageType , CheckWhatRealmIn , WindowDim , ConfigMsg , ScanForItems , \
53
+ from subot .messageTypes import NewFrame , MessageImpl , MessageType , WindowDim , ScanForItems , \
55
54
Resume , Pause
56
55
from subot .pathfinder .map import TileType , Map , Color , Movement
57
56
@@ -61,12 +60,12 @@ def set_dpi_aware():
61
60
62
61
from dataclasses import dataclass
63
62
64
- from subot .models import Sprite , SpriteFrame , Quest , FloorSprite , Realm , RealmLookup , NPCSprite , OverlaySprite , HashFrameWithFloor , \
63
+ from subot .models import Sprite , SpriteFrame , Quest , FloorSprite , Realm , RealmLookup , NPCSprite , HashFrameWithFloor , \
65
64
QuestType , ResourceNodeSprite , \
66
65
SpriteTypeLookup , SpriteType , ChestSprite
67
66
68
67
69
- from subot .utils import Point , read_version , PlayerDirection
68
+ from subot .utils import Point , read_version
70
69
import traceback
71
70
72
71
# sentry annotation for pyinstaller
@@ -1048,6 +1047,7 @@ def run(self):
1048
1047
self .activity_notify = self .hang_monitor .register_component (threading .current_thread (), 3.0 )
1049
1048
1050
1049
TARGET_MS = 1 / settings .FPS
1050
+
1051
1051
try :
1052
1052
should_stop = False
1053
1053
with mss .mss () as sct :
@@ -1434,6 +1434,11 @@ def run(self):
1434
1434
def init_bot () -> Bot :
1435
1435
config = settings .load_config ()
1436
1436
audio_system = AudioSystem (config )
1437
+ if not english_installed ():
1438
+ audio_system .speak_blocking (ocr .ENGLISH_NOT_INSTALLED_EXCEPTION .args [0 ])
1439
+ root .error (ocr .ENGLISH_NOT_INSTALLED_EXCEPTION .args [0 ])
1440
+ audio_system .speak_blocking ("Shutting down" )
1441
+ sys .exit (1 )
1437
1442
1438
1443
is_minimized = True
1439
1444
while is_minimized :
0 commit comments