Beispiel #1
0
 def update_sys(self, index, new_sys):
     self.data_values[index][0] = new_sys
     self.systems[index] = new_sys.casefold()
     if self.route_index == index:
         if self.copy:
             set_clip(self.systems[self.route_index])
         else:
             self.reset_ahk()
Beispiel #2
0
    def set_index(self, index):
        self.route_index = index
        if self.copy:
            set_clip(self.systems[self.route_index])
        else:
            self.reset_ahk()

        self.sys_signal.emit(self.route_index)
Beispiel #3
0
 def set_copy(self, setting):
     if setting is not self.copy:
         self.copy = setting
         if self.copy:
             self.close_ahk()
             set_clip(self.systems[self.route_index])
         else:
             self.ahk = AHK(executable_path=self.hub.get_ahk_path())
             self.reset_ahk()
Beispiel #4
0
    def run(self):
        if self.check_shutdown():
            self.game_shut_signal.emit(self.data_values, self.route_index)

        else:
            if self.copy:
                set_clip(self.systems[self.route_index])
            else:
                self.hotkey = Hotkey(
                    self.ahk, self.bind,
                    self.script.replace("|SYSTEMDATA|",
                                        self.systems[self.route_index]))
                self.hotkey.start()
            self.sys_signal.emit(self.route_index)
            for line in self.follow_file(self.journal):
                loaded = json.loads(line)

                if (loaded['event'] == "FSDJump"
                        and loaded['StarSystem'].casefold()
                        in self.systems[self.route_index:]):
                    self.route_index = self.systems.index(
                        loaded['StarSystem'].casefold()) + 1
                    # if index is last, stop
                    if self.route_index == len(self.data_values):
                        self.close_ahk()
                        self.route_finished_signal.emit()
                        break
                    if self.copy:
                        set_clip(self.systems[self.route_index])
                    else:
                        self.reset_ahk()
                    self.sys_signal.emit(self.route_index)

                elif loaded['event'] == "Loadout":
                    # update max fuel for alerts
                    self.fuel_signal.emit(loaded)

                elif loaded['event'] == "Shutdown":
                    self.game_shut_signal.emit(self.data_values,
                                               self.route_index)
                    self.close_ahk()
                    break
Beispiel #5
0
 def copy(self):
     if self.MainTable.currentItem() is not None:
         set_clip(self.MainTable.currentItem().text())