Skip to content

Commit

Permalink
removed script name from component, changed icon path to hopefully me…
Browse files Browse the repository at this point in the history
…rged soon:tm: apworld-compatible format, added component stripping to lauch arg parse, updated Component func to work on --nogui
  • Loading branch information
qwint committed Aug 17, 2024
1 parent 3e2eb3f commit e9cae0f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions worlds/animal_well/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ def launch_client():
Launch the Animal Well Client
"""
from .client import launch
launch_subprocess(launch, name="AnimalWellClient")
from CommonClient import gui_enabled
if gui_enabled:
launch_subprocess(launch, name="AnimalWellClient")
else:
launch()


components.append(Component("ANIMAL WELL Client", "AnimalWellClient", func=launch_client,
components.append(Component("ANIMAL WELL Client", func=launch_client,
component_type=Type.CLIENT, icon="Potate"))

icon_paths["Potate"] = local_path("data", "Potate.png")
icon_paths["Potate"] = f"ap:{__name__}/data/Potate.png"


class AnimalWellWeb(WebWorld):
Expand Down
6 changes: 5 additions & 1 deletion worlds/animal_well/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,8 +1199,12 @@ async def main():
"""
main function
"""
import sys
args = sys.argv[1:]
if "ANIMAL WELL Client" in args:
args.remove("ANIMAL WELL Client")
parser = get_base_parser()
args = parser.parse_args()
args = parser.parse_args(args)

ctx = AnimalWellContext(args.connect, args.password)
ctx.server_task = asyncio.create_task(server_loop(ctx), name="ServerLoop")
Expand Down

0 comments on commit e9cae0f

Please sign in to comment.