More changes and fixes to use the new native world (game.dll) fixes.

This commit is contained in:
2026-08-28 20:34:31 +02:00
parent 7f6330a617
commit b344506071
7 changed files with 230 additions and 65 deletions

View File

@@ -16,6 +16,7 @@ from .command import CommandOutcome, CommandRunner, OutputLineFilter
from .gamebox import build_gamebox_command
from .paths import AppPaths
from .settings import Settings
from .world_fix import WorldFixError, resolve_world_fix_helper
WINDOWS_GAME_EXE = r"C:\Program Files (x86)\Pristontale EU\Game.exe"
@@ -250,6 +251,7 @@ def run_game(
runner: CommandRunner,
*,
use_gamebox: bool = True,
use_world_fix: bool = False,
timeout_seconds: float = 12 * 60 * 60,
check: bool = True,
extra_environment: Mapping[str, str] | None = None,
@@ -257,21 +259,30 @@ def run_game(
) -> CommandOutcome:
if not paths.runtime_view.is_dir() and not runner.dry_run:
raise RuntimeErrorPT("runtime view is missing; prepare the game first")
world_fix_helper = None
if use_world_fix and not runner.dry_run:
try:
world_fix_helper = resolve_world_fix_helper(paths.runtime_view)
except WorldFixError as exc:
raise RuntimeErrorPT(str(exc)) from exc
launch_executable = world_fix_helper or (paths.runtime_view / "Game.exe")
if selection.kind == "umu":
game_command = [
selection.executable,
str(paths.runtime_view / "Game.exe"),
"PTEU_REBORN",
str(launch_executable),
]
if world_fix_helper is None:
game_command.append("PTEU_REBORN")
environment = _umu_environment(paths)
elif selection.kind == "proton7-container":
if not selection.proton_path:
raise RuntimeErrorPT("Proton script path is missing")
game_command = [
selection.executable,
str(paths.runtime_view / "Game.exe"),
"PTEU_REBORN",
str(launch_executable),
]
if world_fix_helper is None:
game_command.append("PTEU_REBORN")
environment = _umu_proton7_environment(
paths,
selection,
@@ -286,9 +297,10 @@ def run_game(
"ptlinux.proton_compat",
selection.proton_path,
"runinprefix",
WINDOWS_GAME_EXE,
"PTEU_REBORN",
str(world_fix_helper) if world_fix_helper is not None else WINDOWS_GAME_EXE,
]
if world_fix_helper is None:
game_command.append("PTEU_REBORN")
environment = _proton_environment(
paths,
selection,