Skip to content
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
9 changes: 8 additions & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import json
from typing import Callable, Optional
import webbrowser

import requests
import Utils
Expand Down Expand Up @@ -456,15 +457,21 @@ def add_client_to_launcher() -> None:
with open(icon_paths["manual"], 'wb') as f:
f.write(requests.get(icon_url).content)

discord_component = None
for c in components:
if c.display_name == "Manual Client":
found = True
if getattr(c, "version", 0) < version: # We have a newer version of the Manual Client than the one the last apworld added
c.version = version
c.func = launch_client
c.icon = "manual"
return
elif c.display_name == "Manual Discord Server":
discord_component = c

if not found:
components.append(VersionedComponent("Manual Client", "ManualClient", func=launch_client, version=version, file_identifier=SuffixIdentifier('.apmanual'), icon="manual"))
if not discord_component:
components.append(Component("Manual Discord Server", "ManualDiscord", func=lambda: webbrowser.open("https://discord.gg/hm4rQnTzQ5"), icon="discord", component_type=Type.ADJUSTER))


add_client_to_launcher()