From f0094e1b099c38084d439f3da08ea3bb6fd92712 Mon Sep 17 00:00:00 2001 From: Slornie Date: Sat, 22 Jul 2023 15:42:01 +0100 Subject: [PATCH] Pass campaignSetName into plotGalaxy --- ui/mainwindow_presenter.py | 1 + ui/qtgalacticplot.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/mainwindow_presenter.py b/ui/mainwindow_presenter.py index b53fb8d..f6b6e15 100644 --- a/ui/mainwindow_presenter.py +++ b/ui/mainwindow_presenter.py @@ -588,6 +588,7 @@ def __updateGalacticPlot(self): if not self.__showAutoConnections: autoConnectionDistance = 0 self.__plot.plotGalaxy( + self.getSelectedCampaign().setName, self.__checkedPlanets, self.__checkedTradeRoutes, self.__planets, diff --git a/ui/qtgalacticplot.py b/ui/qtgalacticplot.py index 09b8151..13c9a18 100644 --- a/ui/qtgalacticplot.py +++ b/ui/qtgalacticplot.py @@ -33,7 +33,7 @@ def __init__(self, parent: QWidget = None): self.__planetOwners = [] self.__planetsScatter = None - def plotGalaxy(self, planets, tradeRoutes, allPlanets, planetOwners = [], autoPlanetConnectionDistance: int = 0) -> None: + def plotGalaxy(self, campaignSetName, planets, tradeRoutes, allPlanets, planetOwners = [], autoPlanetConnectionDistance: int = 0) -> None: '''Plots all planets as alpha = 0.1, then overlays all selected planets and trade routes''' if self.__is_first_run: x = [p.x for p in allPlanets] @@ -43,6 +43,8 @@ def plotGalaxy(self, planets, tradeRoutes, allPlanets, planetOwners = [], autoPl self.__is_first_run = False + self.__galacticPlotCanvas.get_default_filename = lambda: campaignSetName + '.png' + xlim = self.__axes.get_xlim() ylim = self.__axes.get_ylim() self.__axes.autoscale(False)