Skip to content

Commit ea2c9e2

Browse files
committed
Merge branch 'client-cleanup' into newmain
2 parents 0e2f86d + 65f17c0 commit ea2c9e2

35 files changed

Lines changed: 948 additions & 936 deletions

AHITClient.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

KH1Client.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

KH2Client.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

Starcraft2Client.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

Utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,10 @@ def store_data_package_for_checksum(game: str, data: typing.Dict[str, Any]) -> N
389389

390390

391391
def get_default_adjuster_settings(game_name: str) -> Namespace:
392-
import LttPAdjuster
392+
from worlds.alttp import Adjuster
393393
adjuster_settings = Namespace()
394-
if game_name == LttPAdjuster.GAME_ALTTP:
395-
return LttPAdjuster.get_argparser().parse_known_args(args=[])[0]
394+
if game_name == Adjuster.GAME_ALTTP:
395+
return Adjuster.get_argparser().parse_known_args(args=[])[0]
396396

397397
return adjuster_settings
398398

WebHostLib/lttpsprites.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
def update_sprites_lttp():
1010
from tkinter import Tk
11-
from LttPAdjuster import get_image_for_sprite
12-
from LttPAdjuster import BackgroundTaskProgress
13-
from LttPAdjuster import BackgroundTaskProgressNullWindow
14-
from LttPAdjuster import update_sprites
11+
from worlds.alttp.Adjuster import get_image_for_sprite
12+
from worlds.alttp.Adjuster import BackgroundTaskProgress
13+
from worlds.alttp.Adjuster import BackgroundTaskProgressNullWindow
14+
from worlds.alttp.Adjuster import update_sprites
1515

1616
# Target directories
1717
input_dir = user_path("data", "sprites", "alttpr")

ZillionClient.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

worlds/LauncherComponents.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -218,25 +218,6 @@ def install_apworld(apworld_path: str = "") -> None:
218218
description="Install an APWorld to play games not included with Archipelago by default."),
219219
Component('Text Client', 'CommonClient', 'ArchipelagoTextClient', func=launch_textclient,
220220
description="Connect to a multiworld using the text client."),
221-
Component('Links Awakening DX Client', 'LinksAwakeningClient',
222-
file_identifier=SuffixIdentifier('.apladx')),
223-
Component('LttP Adjuster', 'LttPAdjuster'),
224-
# Ocarina of Time
225-
Component('OoT Client', 'OoTClient',
226-
file_identifier=SuffixIdentifier('.apz5')),
227-
Component('OoT Adjuster', 'OoTAdjuster'),
228-
# TLoZ
229-
Component('Zelda 1 Client', 'Zelda1Client', file_identifier=SuffixIdentifier('.aptloz')),
230-
# ChecksFinder
231-
Component('ChecksFinder Client', 'ChecksFinderClient'),
232-
# Starcraft 2
233-
Component('Starcraft 2 Client', 'Starcraft2Client'),
234-
# Zillion
235-
Component('Zillion Client', 'ZillionClient',
236-
file_identifier=SuffixIdentifier('.apzl')),
237-
238-
#MegaMan Battle Network 3
239-
Component('MMBN3 Client', 'MMBN3Client', file_identifier=SuffixIdentifier('.apbn3'))
240221
]
241222

242223

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ async def patch_and_run_game(patch_file, ctx):
473473
async_start(run_game(comp_path))
474474

475475

476-
if __name__ == '__main__':
476+
def main(*launch_args: str):
477477

478478
Utils.init_logging("AdventureClient")
479479

@@ -483,7 +483,7 @@ async def main():
483483
help='Path to an ADVNTURE.BIN rom file')
484484
parser.add_argument('port', default=17242, type=int, nargs="?",
485485
help='port for adventure_connector connection')
486-
args = parser.parse_args()
486+
args = parser.parse_args(launch_args)
487487

488488
ctx = AdventureContext(args.connect, args.password)
489489
ctx.server_task = asyncio.create_task(server_loop(ctx), name="ServerLoop")

worlds/adventure/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from BaseClasses import Item, ItemClassification, MultiWorld, Tutorial, LocationProgressType
99
from Utils import __version__
1010
from worlds.AutoWorld import WebWorld, World
11-
from worlds.LauncherComponents import Component, components, SuffixIdentifier
11+
from worlds.LauncherComponents import Component, components, SuffixIdentifier, launch, Type
1212
from .Items import item_table, ItemData, nothing_item_id, event_table, AdventureItem, standard_item_max
1313
from .Locations import location_table, base_location_id, LocationData, get_random_room_in_regions
1414
from .Offsets import static_item_data_location, items_ram_start, static_item_element_size, item_position_table, \
@@ -19,8 +19,14 @@
1919
from .Rom import get_base_rom_bytes, get_base_rom_path, AdventureDeltaPatch, apply_basepatch, AdventureAutoCollectLocation
2020
from .Rules import set_rules
2121

22-
# Adventure
23-
components.append(Component('Adventure Client', 'AdventureClient', file_identifier=SuffixIdentifier('.apadvn')))
22+
23+
def launch_client(*args):
24+
from .Client import main
25+
launch(main, name="AdventureClient", args=args)
26+
27+
28+
components.append(Component(display_name='Adventure Client', func=launch_client, component_type=Type.CLIENT,
29+
file_identifier=SuffixIdentifier('.apadvn')))
2430

2531

2632
class AdventureSettings(settings.Group):

0 commit comments

Comments
 (0)