SC2: GUI Mission Launcher (#586)

* SC2: Functioning Starcraft 2 Mission Launcher UI

* AutoWorld: add .__file__ attribute to AutoWorlds
This tries to help with a recurring easy to make mistake, where ./worlds/myworld does not exist in frozen form and is instead ./lib/worlds/myworld

* SC2: get .kv file path correctly when frozen too

Co-authored-by: TheCondor07 <TheCondorian07@gmail.com>
Co-authored-by: Fabian Dill <fabian.dill@web.de>
This commit is contained in:
TheCondor07
2022-05-30 01:11:01 -04:00
committed by GitHub
parent 3dd3f045e6
commit 20be691f36
6 changed files with 206 additions and 114 deletions

View File

@@ -1,6 +1,7 @@
from __future__ import annotations
import logging
import sys
from typing import Dict, FrozenSet, Set, Tuple, List, Optional, TextIO, Any, Callable, Union, NamedTuple
from BaseClasses import MultiWorld, Item, CollectionState, Location, Tutorial
@@ -41,6 +42,7 @@ class AutoWorldRegister(type):
new_class = super().__new__(mcs, name, bases, dct)
if "game" in dct:
AutoWorldRegister.world_types[dct["game"]] = new_class
new_class.__file__ = sys.modules[new_class.__module__].__file__
return new_class