Compare commits

...

4 Commits

3 changed files with 13 additions and 6 deletions

View File

@ -1,4 +1,9 @@
# EDMC_SpanshRouter # EDMC_SpanshRouter
## Note on norohind's fork
This is fork where I try to maintain working version of SpanshRouter
plugin for personal use with the latest version of EDMarketConnector.
I'm not trying to maintain README.md, CHANGELOG.md and auto-update system
of the plugin, at least now.
This plugin's purpose is to automatically copy to your clipboard the next waypoint on a route you planned using [Spansh](https://www.spansh.co.uk/plotter). This plugin's purpose is to automatically copy to your clipboard the next waypoint on a route you planned using [Spansh](https://www.spansh.co.uk/plotter).

View File

@ -4,7 +4,9 @@ import io
import json import json
import logging import logging
import os import os
import re
import subprocess import subprocess
import sys
import tkinter as tk import tkinter as tk
import tkinter.filedialog as filedialog import tkinter.filedialog as filedialog
import tkinter.messagebox as confirmDialog import tkinter.messagebox as confirmDialog
@ -14,11 +16,10 @@ from time import sleep
from tkinter import * from tkinter import *
import requests import requests
from config import appname from config import appname
from monitor import monitor from monitor import monitor
from . import AutoCompleter
from . import PlaceHolder from . import AutoCompleter, PlaceHolder
from .updater import SpanshUpdater from .updater import SpanshUpdater
# We need a name of plugin dir, not SpanshRouter.py dir # We need a name of plugin dir, not SpanshRouter.py dir
@ -160,7 +161,7 @@ class SpanshRouter():
self.csv_route_btn.grid_remove() self.csv_route_btn.grid_remove()
self.source_ac.grid() self.source_ac.grid()
# Prefill the "Source" entry with the current system # Prefill the "Source" entry with the current system
self.source_ac.set_text(monitor.system if monitor.system is not None else "Source System", monitor.system is None) self.source_ac.set_text(monitor.state['SystemName'] if monitor.state['SystemName'] is not None else "Source System", monitor.state['SystemName'] is None)
self.dest_ac.grid() self.dest_ac.grid()
self.range_entry.grid() self.range_entry.grid()
self.efficiency_slider.grid() self.efficiency_slider.grid()
@ -597,7 +598,7 @@ class SpanshRouter():
self.jumps_left += waypoint["jumps"] self.jumps_left += waypoint["jumps"]
self.enable_plot_gui(True) self.enable_plot_gui(True)
self.show_plot_gui(False) self.show_plot_gui(False)
self.offset = 1 if self.route[0][0] == monitor.system else 0 self.offset = 1 if self.route[0][0] == monitor.state['SystemName'] else 0
self.next_stop = self.route[self.offset][0] self.next_stop = self.route[self.offset][0]
self.copy_waypoint() self.copy_waypoint()
self.update_gui() self.update_gui()

View File

@ -51,6 +51,7 @@ def ask_for_update():
def plugin_app(parent): def plugin_app(parent):
global spansh_router global spansh_router
spansh_router.init_gui(parent) frame = spansh_router.init_gui(parent)
spansh_router.open_last_route() spansh_router.open_last_route()
parent.master.after_idle(ask_for_update) parent.master.after_idle(ask_for_update)
return frame