Skip to content

Commit

Permalink
support for messenger since it was basically already done
Browse files Browse the repository at this point in the history
  • Loading branch information
alwaysintreble committed Jul 25, 2024
1 parent 047febe commit aea33ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion worlds/messenger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .subclasses import MessengerEntrance, MessengerItem, MessengerRegion, MessengerShopLocation

components.append(
Component("The Messenger", component_type=Type.CLIENT, func=launch_game)#, game_name="The Messenger", supports_uri=True)
Component("The Messenger", component_type=Type.CLIENT, func=launch_game, game_name="The Messenger", supports_uri=True)
)


Expand Down
15 changes: 10 additions & 5 deletions worlds/messenger/client_setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import argparse
import io
import logging
import os.path
Expand All @@ -17,7 +18,7 @@
MOD_URL = "https://api.github.com/repos/alwaysintreble/TheMessengerRandomizerModAP/releases/latest"


def launch_game(url: Optional[str] = None) -> None:
def launch_game() -> None:
"""Check the game installation, then launch it"""
def courier_installed() -> bool:
"""Check if Courier is installed"""
Expand Down Expand Up @@ -150,15 +151,19 @@ def available_mod_update(latest_version: str) -> bool:
install_mod()
elif should_update is None:
return

parser = argparse.ArgumentParser(description="Messenger Client Launcher")
parser.add_argument("url", type=str, nargs="?", help="Archipelago Webhost uri to auto connect to.")
args = parser.parse_args()
if not is_windows:
if url:
open_file(f"steam://rungameid/764790//{url}/")
if args.url:
open_file(f"steam://rungameid/764790//{args.url}/")
else:
open_file("steam://rungameid/764790")
else:
os.chdir(game_folder)
if url:
subprocess.Popen([MessengerWorld.settings.game_path, str(url)])
if args.url:
subprocess.Popen([MessengerWorld.settings.game_path, str(args.url)])
else:
subprocess.Popen(MessengerWorld.settings.game_path)
os.chdir(working_directory)

0 comments on commit aea33ae

Please sign in to comment.