25
25
sc2_logger = logging .getLogger ("Starcraft2" )
26
26
27
27
import nest_asyncio
28
- import sc2
29
- from sc2 .bot_ai import BotAI
30
- from sc2 .data import Race
31
- from sc2 .main import run_game
32
- from sc2 .player import Bot
28
+ from worlds ._sc2common import bot
29
+ from worlds ._sc2common .bot .data import Race
30
+ from worlds ._sc2common .bot .main import run_game
31
+ from worlds ._sc2common .bot .player import Bot
33
32
from worlds .sc2wol import SC2WoLWorld
34
33
from worlds .sc2wol .Items import lookup_id_to_name , item_table , ItemData , type_flaggroups
35
34
from worlds .sc2wol .Locations import SC2WOL_LOC_ID_OFFSET
@@ -240,8 +239,6 @@ def run_gui(self):
240
239
from kivy .uix .floatlayout import FloatLayout
241
240
from kivy .properties import StringProperty
242
241
243
- import Utils
244
-
245
242
class HoverableButton (HoverBehavior , Button ):
246
243
pass
247
244
@@ -544,11 +541,11 @@ async def starcraft_launch(ctx: SC2Context, mission_id: int):
544
541
sc2_logger .info (f"Launching { lookup_id_to_mission [mission_id ]} . If game does not launch check log file for errors." )
545
542
546
543
with DllDirectory (None ):
547
- run_game (sc2 .maps .get (maps_table [mission_id - 1 ]), [Bot (Race .Terran , ArchipelagoBot (ctx , mission_id ),
544
+ run_game (bot .maps .get (maps_table [mission_id - 1 ]), [Bot (Race .Terran , ArchipelagoBot (ctx , mission_id ),
548
545
name = "Archipelago" , fullscreen = True )], realtime = True )
549
546
550
547
551
- class ArchipelagoBot (sc2 .bot_ai .BotAI ):
548
+ class ArchipelagoBot (bot .bot_ai .BotAI ):
552
549
game_running : bool = False
553
550
mission_completed : bool = False
554
551
boni : typing .List [bool ]
@@ -867,7 +864,7 @@ def check_game_install_path() -> bool:
867
864
documentspath = buf .value
868
865
einfo = str (documentspath / Path ("StarCraft II\\ ExecuteInfo.txt" ))
869
866
else :
870
- einfo = str (sc2 .paths .get_home () / Path (sc2 .paths .USERPATH [sc2 .paths .PF ]))
867
+ einfo = str (bot .paths .get_home () / Path (bot .paths .USERPATH [bot .paths .PF ]))
871
868
872
869
# Check if the file exists.
873
870
if os .path .isfile (einfo ):
@@ -883,7 +880,7 @@ def check_game_install_path() -> bool:
883
880
f"try again." )
884
881
return False
885
882
if os .path .exists (base ):
886
- executable = sc2 .paths .latest_executeble (Path (base ).expanduser () / "Versions" )
883
+ executable = bot .paths .latest_executeble (Path (base ).expanduser () / "Versions" )
887
884
888
885
# Finally, check the path for an actual executable.
889
886
# If we find one, great. Set up the SC2PATH.
0 commit comments