diff --git a/config/default.yaml b/config/default.yaml index 3ea0050..fb1bd9d 100644 --- a/config/default.yaml +++ b/config/default.yaml @@ -1,5 +1,5 @@ auto_restart: false -bn_path: C:/Program Files (x86)/Battle.net/Battle.net.exe +bn_path: F:\battle\Battle.net/Battle.net.exe boss_id: 5 confidence: 0.8 delay: 0.5 @@ -35,7 +35,7 @@ hero: - Diablo - 3, 2, 1 - 3 -hs_path: E:/Games/Hearthstone/Hearthstone.exe +hs_path: F:\battle\copy\Hearthstone/Hearthstone.exe lang: ZH-1600x900 longest_waiting: 80 reward_count: 5 diff --git a/main_gui.py b/main_gui.py index cffeef8..bf2a48c 100644 --- a/main_gui.py +++ b/main_gui.py @@ -7,7 +7,7 @@ import pinyin import yaml from PyQt5 import uic, QtCore, QtWidgets -from PyQt5.QtCore import QStringListModel +from PyQt5.QtCore import QStringListModel, QThread, pyqtSignal from PyQt5.QtWidgets import * from utils.util import HEROS @@ -22,7 +22,17 @@ if hasattr(QtCore.Qt, 'AA_UseHighDpiPixmaps'): PyQt5.QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True) - +class Thread_2(QThread): + _signal =pyqtSignal() + def __init__(self,config): + super().__init__() + self.config = config + def run(self): + + from lushi import run_from_gui + run_from_gui(self.config) + self._signal.emit() + class Ui(QMainWindow): def __init__(self): super(Ui, self).__init__() @@ -327,9 +337,10 @@ def runButtonPressed(self): reply = QMessageBox.question(self, 'CONFIRM', cfm_text, QMessageBox.Yes | QMessageBox.No, QMessageBox.No) if reply == QMessageBox.Yes: - from lushi import run_from_gui + self.save_config() - run_from_gui(self.config) + self.thread_2 =Thread_2(self.config) + self.thread_2.start() else: pass