Skip to content
Open
Show file tree
Hide file tree
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
16 changes: 6 additions & 10 deletions worlds/tww/TWWClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,12 +696,11 @@ async def dolphin_sync_task(ctx: TWWContext) -> None:
continue


def main(connect: Optional[str] = None, password: Optional[str] = None) -> None:
def main(*args: str) -> None:
"""
Run the main async loop for the Wind Waker client.

:param connect: Address of the Archipelago server.
:param password: Password for server authentication.
:param *args: Command line arguments passed to the client.
"""
Utils.init_logging("The Wind Waker Client")

Expand All @@ -726,14 +725,11 @@ async def _main(connect: Optional[str], password: Optional[str]) -> None:
if ctx.dolphin_sync_task:
await ctx.dolphin_sync_task

parser = get_base_parser()
parsed_args = parser.parse_args(args)

import colorama

colorama.init()
asyncio.run(_main(connect, password))
asyncio.run(_main(parsed_args.connect, parsed_args.password))
colorama.deinit()


if __name__ == "__main__":
parser = get_base_parser()
args = parser.parse_args()
main(args.connect, args.password)
8 changes: 5 additions & 3 deletions worlds/tww/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from worlds.AutoWorld import WebWorld, World
from worlds.Files import APPlayerContainer
from worlds.generic.Rules import add_item_rule
from worlds.LauncherComponents import Component, SuffixIdentifier, Type, components, icon_paths, launch_subprocess
from worlds.LauncherComponents import Component, SuffixIdentifier, Type, components, icon_paths, launch

from .Items import ISLAND_NUMBER_TO_CHART_NAME, ITEM_TABLE, TWWItem, item_name_groups
from .Locations import LOCATION_TABLE, TWWFlag, TWWLocation
Expand All @@ -29,14 +29,16 @@
VERSION: tuple[int, int, int] = (3, 0, 0)


def run_client() -> None:
def run_client(*args: str) -> None:
"""
Launch the The Wind Waker client.

:param *args: Variable length argument list passed to the client.
"""
print("Running The Wind Waker Client")
from .TWWClient import main

launch_subprocess(main, name="TheWindWakerClient")
launch(main, name="TheWindWakerClient", args=args)


components.append(
Expand Down
Loading