Files
pogo/Scripts/verify_title_screen_assets.py

27 lines
1.0 KiB
Python

"""Validate generated title-screen assets in an Unreal Python commandlet."""
from pathlib import Path
import unreal
AUDIO_ASSET = "/Game/Pogo/Audio/S_PogoTitleMusic"
TITLE_MAP = "/Game/Pogo/Maps/Lvl_TitleScreen"
movie = Path(unreal.Paths.project_content_dir()) / "Movies/pogo.mp4"
assert movie.is_file(), f"Missing packaged movie: {movie}"
sound = unreal.EditorAssetLibrary.load_asset(AUDIO_ASSET)
assert sound, f"Missing sound asset: {AUDIO_ASSET}"
assert sound.get_editor_property("looping") is True, "Title music is not looping"
assert unreal.EditorLevelLibrary.load_level(TITLE_MAP), f"Could not load {TITLE_MAP}"
world = unreal.EditorLevelLibrary.get_editor_world()
assert world, "No editor world after loading title map"
settings = world.get_world_settings()
assert settings, "Title map has no WorldSettings"
assert (
settings.get_editor_property("default_game_mode")
== unreal.PogoTitleScreenGameMode.static_class()
), "Title map does not use PogoTitleScreenGameMode"
unreal.log("POGO_TITLE_VERIFY PASS")