From fa107c00db55f1cd1ecd61f904a3bf7ee984edcb Mon Sep 17 00:00:00 2001 From: Dregu Date: Mon, 9 Oct 2023 09:34:52 +0300 Subject: [PATCH] Added warning about using old playlunky version --- src/modlunky2/ui/play/releases.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/modlunky2/ui/play/releases.py b/src/modlunky2/ui/play/releases.py index bc135b4fe..14ea2e301 100644 --- a/src/modlunky2/ui/play/releases.py +++ b/src/modlunky2/ui/play/releases.py @@ -263,6 +263,9 @@ def __init__(self, parent, modlunky_config: Config, task_manager): self.bold_font = tk_font.Font(font="TkDefaultFont") self.bold_font.configure(weight="bold") + self.warning = ttk.Label(self, text="Nightly is probably the version you want to use! Stable doesn't receive regular updates for the modding API!", wraplength=220, font=self.bold_font, foreground="darkred") + self.warning.grid(row=1, column=0, pady=(5, 0), padx=10, sticky="w") + self.selected_label = ttk.Label(self, text="Playlunky Version") self.selected_label.grid(row=2, column=0, pady=(5, 0), padx=10, sticky="w") self.selected_var = tk.StringVar() @@ -284,6 +287,12 @@ def show_uninstall_frame(self): self.download_frame.grid_forget() self.uninstall_frame.grid(row=4, column=0, padx=10, sticky="ew") + def show_warning(self): + self.warning.grid(row=1, column=0, pady=(5, 0), padx=10, sticky="w") + + def hide_warning(self): + self.warning.grid_forget() + def get_available_releases(self): available_releases = {} @@ -346,7 +355,7 @@ def release_selected(self, value): def render(self): self.available_releases = self.get_available_releases() - available_releases = ["stable", "nightly"] + [ + available_releases = ["nightly", "stable"] + [ release for release in self.available_releases if release not in ["nightly", "stable"] @@ -395,6 +404,11 @@ def render(self): else: self.show_download_frame() + if selected_version == "nightly": + self.hide_warning() + else: + self.show_warning() + self.parent.enable_button() def on_cache_releases_updated(self):