Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: gui images #22

Merged
merged 2 commits into from
Nov 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ def __init__(self, *args, **kwargs):
self.settings["center_location"] = False
if "iss_size" not in self.settings:
self.settings["iss_size"] = 0.5
if "iss_icon" not in self.settings:
self.settings["iss_icon"] = f"{self.root_dir}/ui/iss3.png"
if "iss_bg" not in self.settings:
self.settings["iss_bg"] = f"{self.root_dir}/ui/iss.png"
if "dpi" not in self.settings:
self.settings["dpi"] = 500

Expand Down Expand Up @@ -128,7 +124,7 @@ def generate_map(self, lat, lon):
m.bluemarble()
x, y = m(lon, lat)

iss = plt.imread(self.settings["iss_icon"])
iss = plt.imread(self.settings.get("iss_icon", f"{self.root_dir}/gui/all/iss3.png"))
im = OffsetImage(iss, zoom=self.settings["iss_size"])
ab = AnnotationBbox(im, (x, y), xycoords='data', frameon=False)

Expand All @@ -145,7 +141,7 @@ def generate_map(self, lat, lon):
@intent_handler("about.intent")
def handle_about_iss_intent(self, message):
utterance = self.dialog_renderer.render("about", {})
self.gui.show_image(self.settings["iss_bg"],
self.gui.show_image(self.settings.get("iss_bg", "iss.png"),
override_idle=True,
fill='PreserveAspectFit',
caption=utterance)
Expand Down
Loading