SC2 WoL - Mod, Item and Location update (#2113)

Migrates SC2 WoL world to the new mod with new items and locations. The new mod has a different architecture making it more future proof (with planned adding of other campaigns). Also gets rid of several old bugs

Adds new short game formats intended for sync games (Tiny Grid, Mini Gauntlet). The final mission isn't decided by campaign length anymore but it's configurable instead. Allow excluding missions for Vanilla Shuffled, corrected some documentation.

NOTE: This is a squashed commit with Salz' HotS excluded (not ready for the release and I plan multi-campaign instead)

---------

Co-authored-by: Matthew <matthew.marinets@gmail.com>
This commit is contained in:
Ziktofel
2023-09-15 02:22:10 +02:00
committed by GitHub
parent 47cf3e06c0
commit 648d682add
68 changed files with 2856 additions and 1468 deletions

View File

@@ -8,18 +8,31 @@ from .paths import Paths
def get(name: str) -> Map:
# Iterate through 2 folder depths
for map_dir in (p for p in Paths.MAPS.iterdir()):
if map_dir.is_dir():
for map_file in (p for p in map_dir.iterdir()):
if Map.matches_target_map_name(map_file, name):
return Map(map_file)
elif Map.matches_target_map_name(map_dir, name):
return Map(map_dir)
map = find_map_in_dir(name, map_dir)
if map is not None:
return map
raise KeyError(f"Map '{name}' was not found. Please put the map file in \"/StarCraft II/Maps/\".")
# Go deeper
def find_map_in_dir(name, path):
if Map.matches_target_map_name(path, name):
return Map(path)
if path.name.endswith("SC2Map"):
return None
if path.is_dir():
for childPath in (p for p in path.iterdir()):
map = find_map_in_dir(name, childPath)
if map is not None:
return map
return None
class Map:
def __init__(self, path: Path):