-
Notifications
You must be signed in to change notification settings - Fork 10
/
load.py
70 lines (50 loc) · 1.55 KB
/
load.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
from os import path
import semantic_version
from companion import CAPIData
import bgstally.globals
from bgstally.bgstally import BGSTally
from bgstally.constants import CheckStates, UpdateUIPolicy
from bgstally.debug import Debug
PLUGIN_NAME = "BGS-Tally"
PLUGIN_VERSION = semantic_version.Version.coerce("4.2.0-dev")
# Initialise the main plugin class
bgstally.globals.this = this = BGSTally(PLUGIN_NAME, PLUGIN_VERSION)
def plugin_start3(plugin_dir):
"""
Load this plugin into EDMC
"""
this.plugin_start(plugin_dir)
this.check_tick(UpdateUIPolicy.NEVER)
return this.plugin_name
def plugin_stop():
"""
EDMC is closing
"""
this.plugin_stop()
def plugin_app(parent):
"""
Return a TK Frame for adding to the EDMC main window
"""
return this.ui.get_plugin_frame(parent)
def plugin_prefs(parent, cmdr: str, is_beta: bool):
"""
Return a TK Frame for adding to the EDMC settings dialog
"""
return this.ui.get_prefs_frame(parent)
def prefs_changed(cmdr: str, is_beta: bool) -> None:
"""
Save settings.
"""
this.ui.save_prefs()
def journal_entry(cmdr, is_beta, system, station, entry, state):
"""
Parse an incoming journal entry and store the data we need
"""
if this.state.Status.get() != CheckStates.STATE_ON: return
this.journal_entry(cmdr, is_beta, system, station, entry, state)
def capi_fleetcarrier(data: CAPIData):
"""
Handle Fleet carrier data
"""
if this.state.Status.get() != CheckStates.STATE_ON: return
this.capi_fleetcarrier(data)