Skip to content

Commit

Permalink
Added warning about using old playlunky version
Browse files Browse the repository at this point in the history
  • Loading branch information
Dregu committed Oct 9, 2023
1 parent 926c2f7 commit fa107c0
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/modlunky2/ui/play/releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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 = {}

Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit fa107c0

Please sign in to comment.