Esempio n. 1
0
    def callback_start_pushButton_clicked(self):
        self.setEnabledStartButton(False)
        pass_config = copy.deepcopy(self.configure)

        pass_config.window_config[self.appPlayer_comboBox.currentText()][self.game_comboBox.currentText()]['schedule_list'] = \
         copy.deepcopy(pass_config.window_config['custom_config_dic'][self.config_comboBox.currentText()]['schedule_list'])

        dogfootermacro_logger.debug(
            pass_config.window_config[self.appPlayer_comboBox.currentText()][
                self.game_comboBox.currentText()]['schedule_list'])

        self.worker_thread = likeyoubot_worker.LYBWorker(
            'Worker', pass_config, queue.Queue(), queue.Queue())
        self.worker_thread.daemon = True
        self.worker_thread.start()

        hwnd = self.hwnd_dic[self.appPlayer_comboBox.currentText()]

        side_hwnd = None
        if hwnd in self.win.side_window_dic:
            side_hwnd = self.win.side_window_dic[hwnd]

        parent_hwnd = None
        if hwnd in self.win.parent_handle_dic:
            parent_hwnd = self.win.parent_handle_dic[hwnd]

        started_window_name = self.appPlayer_comboBox.currentText()
        started_game_name = self.game_comboBox.currentText()

        if started_game_name in pass_config.window_config[started_window_name]:
            started_option = pass_config.get_window_config(
                started_window_name, started_game_name)
        else:
            started_option = pass_config.common_config[started_game_name]

        for key, value in pass_config.common_config[started_game_name].items():
            dogfootermacro_logger.debug(key)

        self.worker_thread.command_queue.put_nowait(
            likeyoubot_message.LYBMessage('start', [
                self.schedule_comboBox.currentIndex() + 1,
                hwnd,
                self.appPlayer_comboBox.currentText(),
                self.game_comboBox.currentText(),
                started_option,
                pass_config,
                pass_config.window_config[
                    self.appPlayer_comboBox.currentText()],
                side_hwnd,
                parent_hwnd,
                self.win.multi_window_handle_dic,
                None,
            ]))

        self.setWindowTitle(dogfootermacro_title + ' - ' +
                            self.appPlayer_comboBox.currentText() + ' : ' +
                            self.game_comboBox.currentText())

        self.play_thread = PlayThread(self)
        self.play_thread.start()
Esempio n. 2
0
 def callback_hide_pushButton_clicked(self):
     worker_thread = likeyoubot_worker.LYBWorker('Worker', self.configure,
                                                 queue.Queue(),
                                                 queue.Queue())
     worker_thread.daemon = True
     worker_thread.start()
     worker_thread.command_queue.put_nowait(
         likeyoubot_message.LYBMessage('watchout2', [
             self.configure, 'hide',
             self.appPlayer_comboBox.currentText(), self.win, self.hwnd_dic
         ]))