1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

add odyssey ranks to status page

This commit is contained in:
A_D 2022-01-25 17:39:44 +02:00
parent 109f964fc3
commit 626fb0cb87
No known key found for this signature in database
GPG Key ID: 4BE9EB7DF45076C4

View File

@ -56,15 +56,17 @@ def status(data: Dict[str, Any]) -> List[List[str]]:
RANKS = [ # noqa: N806 # Its a constant, just needs to be updated at runtime
# in output order
(_('Combat'), 'combat'), # LANG: Ranking
(_('Trade'), 'trade'), # LANG: Ranking
(_('Explorer'), 'explore'), # LANG: Ranking
(_('CQC'), 'cqc'), # LANG: Ranking
(_('Federation'), 'federation'), # LANG: Ranking
(_('Empire'), 'empire'), # LANG: Ranking
(_('Powerplay'), 'power'), # LANG: Ranking
# ??? , 'crime'), # LANG: Ranking
# ??? , 'service'), # LANG: Ranking
(_('Combat'), 'combat'), # LANG: Ranking
(_('Trade'), 'trade'), # LANG: Ranking
(_('Explorer'), 'explore'), # LANG: Ranking
(_('Mercenary'), 'mercenary'), # LANG: Ranking
(_('Exobiologist'), 'exobiologist'), # LANG: Ranking
(_('CQC'), 'cqc'), # LANG: Ranking
(_('Federation'), 'federation'), # LANG: Ranking
(_('Empire'), 'empire'), # LANG: Ranking
(_('Powerplay'), 'power'), # LANG: Ranking
# ??? , 'crime'), # LANG: Ranking
# ??? , 'service'), # LANG: Ranking
]
RANK_NAMES = { # noqa: N806 # Its a constant, just needs to be updated at runtime
@ -102,6 +104,28 @@ def status(data: Dict[str, Any]) -> List[List[str]]:
_('Pioneer'), # LANG: Explorer rank
_('Elite') # LANG: Top rank
],
'mercenary': [
_('Defenceless'), # LANG: Mercenary rank
_('Mostly Defenceless'), # LANG: Mercenary rank
_('Rookie'), # LANG: Mercenary rank
_('Soldier'), # LANG: Mercenary rank
_('Gunslinger'), # LANG: Mercenary rank
_('Warrior'), # LANG: Mercenary rank
_('Gunslinger'), # LANG: Mercenary rank
_('Deadeye'), # LANG: Mercenary rank
_('Elite'), # LANG: Top rank
],
'exobiologist': [
_('Directionless'), # LANG: Exobiologist rank
_('Mostly Directionless'), # LANG: Exobiologist rank
_('Compiler'), # LANG: Exobiologist rank
_('Collector'), # LANG: Exobiologist rank
_('Cataloguer'), # LANG: Exobiologist rank
_('Taxonomist'), # LANG: Exobiologist rank
_('Ecologist'), # LANG: Exobiologist rank
_('Geneticist'), # LANG: Exobiologist rank
_('Elite'), # LANG: Top rank
],
'cqc': [
_('Helpless'), # LANG: CQC rank
_('Mostly Helpless'), # LANG: CQC rank
@ -167,6 +191,7 @@ def status(data: Dict[str, Any]) -> List[List[str]]:
for title, thing in RANKS:
rank = ranks.get(thing)
names = RANK_NAMES[thing]
# TODO: handle Elite I-V here.
if isinstance(rank, int):
res.append([title, names[rank] if rank < len(names) else f'Rank {rank}'])
@ -357,7 +382,13 @@ class StatsResults(tk.Toplevel):
# assumes things two and three are money
self.addpagerow(page, [thing[0], self.credits(int(thing[1]))], with_copy=True)
for thing in stats[3:]:
# TODO: Headers, and a bit saner of some splitting up of things here
self.addpagespacer(page)
for thing in stats[3:9]:
self.addpagerow(page, thing, with_copy=True)
self.addpagespacer(page)
for thing in stats[9:]:
self.addpagerow(page, thing, with_copy=True)
ttk.Frame(page).grid(pady=5) # bottom spacer