about summary refs log tree commit diff stats
path: root/apworld/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'apworld/__init__.py')
-rw-r--r--apworld/__init__.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/apworld/__init__.py b/apworld/__init__.py index 2213e33..6ac2926 100644 --- a/apworld/__init__.py +++ b/apworld/__init__.py
@@ -1,7 +1,15 @@
1""" 1"""
2Archipelago init file for Lingo 2 2Archipelago init file for Lingo 2
3""" 3"""
4import asyncio
5import os.path
6import subprocess
7from typing import ClassVar
8
9import Utils
10import settings
4from BaseClasses import ItemClassification, Item, Tutorial 11from BaseClasses import ItemClassification, Item, Tutorial
12from settings import Group, UserFilePath
5from worlds.AutoWorld import WebWorld, World 13from worlds.AutoWorld import WebWorld, World
6from .items import Lingo2Item, ANTI_COLLECTABLE_TRAPS 14from .items import Lingo2Item, ANTI_COLLECTABLE_TRAPS
7from .options import Lingo2Options 15from .options import Lingo2Options
@@ -9,6 +17,30 @@ from .player_logic import Lingo2PlayerLogic
9from .regions import create_regions, shuffle_entrances, connect_ports_from_ut 17from .regions import create_regions, shuffle_entrances, connect_ports_from_ut
10from .static_logic import Lingo2StaticLogic 18from .static_logic import Lingo2StaticLogic
11from .version import APWORLD_VERSION 19from .version import APWORLD_VERSION
20from ..LauncherComponents import Component, Type, components
21
22
23async def run_game():
24 exe_file = settings.get_settings().lingo2_options.exe_file
25
26 subprocess.Popen(
27 [
28 exe_file,
29 "--scene",
30 Utils.local_path("worlds", "lingo2", "client", "run_from_source.tscn"),
31 "--",
32 Utils.local_path("worlds", "lingo2", "client"),
33 ],
34 cwd=os.path.dirname(exe_file),
35 )
36
37
38async def client_main():
39 Utils.async_start(run_game())
40
41
42def launch_client(*args):
43 asyncio.run(client_main())
12 44
13 45
14class Lingo2WebWorld(WebWorld): 46class Lingo2WebWorld(WebWorld):
@@ -24,6 +56,14 @@ class Lingo2WebWorld(WebWorld):
24 )] 56 )]
25 57
26 58
59class Lingo2Settings(Group):
60 class ExecutableFile(UserFilePath):
61 """Path to the Lingo 2 executable"""
62 is_exe = True
63
64 exe_file: ExecutableFile = ExecutableFile()
65
66
27class Lingo2World(World): 67class Lingo2World(World):
28 """ 68 """
29 Lingo 2 is a first person indie puzzle game where you solve word puzzles in a labyrinthe world. Compared to its 69 Lingo 2 is a first person indie puzzle game where you solve word puzzles in a labyrinthe world. Compared to its
@@ -33,6 +73,9 @@ class Lingo2World(World):
33 game = "Lingo 2" 73 game = "Lingo 2"
34 web = Lingo2WebWorld() 74 web = Lingo2WebWorld()
35 75
76 settings: ClassVar[Lingo2Settings]
77 settings_key = "lingo2_options"
78
36 topology_present = True 79 topology_present = True
37 80
38 options_dataclass = Lingo2Options 81 options_dataclass = Lingo2Options