feat(launcher): add saves folder shortcut and fix below-4K HUD guidance

Add an Open Folder button (and primary menu action) on Play & Status to
open local/data/7952987A/saves/0009000000000001/00000000-0000-0000-0000-00007952987a
in the host file manager (creating it if missing so saves can be imported
before first launch).

Fix Separate 4K HUD Plane (VICTORY_UI_PLANE) guidance:
- Replace the misleading Default (Auto) label with Default (Off) because
  unset VICTORY_UI_PLANE only activates at 1080p without host FSR.
- Show a one-click Enable 4K HUD banner in Game Settings whenever output is
  below 4K without VICTORY_UI_PLANE=3840x2160.
- Recommend VICTORY_UI_PLANE=3840x2160 in Hardware & Tuning for below-4K
  display profiles.

Verified with 34/34 launcher unit tests, Flatpak bundle rebuild, and
--smoke with zero warnings.
This commit is contained in:
Tim-van-Oudheusden
2026-12-06 02:15:40 +01:00
parent ec88c41b65
commit ef4dcd6c7d
12 changed files with 236 additions and 5 deletions

View File

@ -39,7 +39,7 @@ flatpak run --user io.github.tim_van_oudheusden.Xmemlauncher
1. **Play, Stop & Live Logs (`Play & Status`)**
- Starts the game with `./run.sh play` (with an optional **Run Stale Build** fallback if `victory.exe` predates `HEAD`).
- Stops running sessions cleanly via `systemctl --user stop um-*.scope` with child termination fallback.
- Detects sessions started outside Xmemlauncher (polling `um-*.scope`) and streams live output or tails `local/run/last.log`.
- Detects sessions started outside Xmemlauncher (polling `um-*.scope`), provides a one-click **Open Folder** shortcut to the saves & profile directory (`local/data/7952987A/saves/...`), and streams live output or tails `local/run/last.log`.
2. **Prepare & Build Workflow (`Prepare & Build`)**
- Checks every prerequisite: `GAME=` dump folder, `deps/` drivers & prefix, `deps/fsr4/` DLLs, `victory.exe` freshness (`victory.source` vs `HEAD`), shader translations, and warmed pipelines.
- Runs `./setup.sh`, `./setup.sh fsr4`, `./build.sh build`, `./run.sh shaders`, and `./run.sh warm` individually or in sequence with live progress output.
@ -47,6 +47,7 @@ flatpak run --user io.github.tim_van_oudheusden.Xmemlauncher
3. **Plain-English Settings Editor (`Game Settings`)**
- Parses `run.conf.default`, `presets/*.conf`, and your existing `run.conf`.
- Scales setting cards proportionally with the window size (small, windowed, or maximized) and keeps selected values on the right side concise and un-truncated while showing full plain-English tradeoff details inside each dropdown popover.
- Surfaces one-click companion banners when Frame Generation needs companion settings or when running below 4K without Separate 4K HUD Plane (`3840x2160`) enabled.
- Preserves all comments, blank lines, ordering, custom values, and unknown variables verbatim; never touches `run.conf` until you explicitly click **Save to run.conf**.
4. **Shader & Pipeline Cache Status + Safe Pruning (`Shader & Pipeline Cache`)**
- Shows binary build freshness, translated shader counts, `known-shaders.bin` / `known-pipelines.bin` / `native-id.bin` status, and every `native-*` pipeline cache directory with `.pso` count and disk usage.

View File

@ -175,6 +175,7 @@ template $VictoryLauncherWindow: Adw.ApplicationWindow {
menu primary_menu {
section {
item ("_Select Repository Folder…", "win.choose-repo")
item ("_Open Saves & Profile Folder", "win.open-profile-dir")
item ("_Check for Updates", "win.check-updates")
item ("_Reload run.conf", "win.reload-conf")
}

View File

@ -13,7 +13,10 @@ from victory_launcher.core.hardware import (
RebarStatus,
build_hardware_profile,
)
from victory_launcher.core.recommendations import generate_recommendations
from victory_launcher.core.recommendations import (
generate_recommendations,
needs_ui_plane_for_scaling,
)
from victory_launcher.core.run_conf import RunConfDocument
_CPU_7800X3D = "\n\n".join(
@ -81,6 +84,7 @@ class HardwareAndRecommendationTests(unittest.TestCase):
self.assertEqual(rec_map["CONSOLE"], "series-x")
self.assertEqual(rec_map["VICTORY_OUTPUT"], "2560x1440")
self.assertEqual(rec_map["VICTORY_FSR"], "quality")
self.assertEqual(rec_map["VICTORY_UI_PLANE"], "3840x2160")
self.assertEqual(rec_map["VICTORY_BVH_BUILDER"], "0")
# 7800X3D + RDNA 3 benefits from cross-queue join, so it should NOT be forced off.
self.assertNotIn("VICTORY_CROSS_QUEUE_JOIN", rec_map)
@ -176,6 +180,40 @@ class HardwareAndRecommendationTests(unittest.TestCase):
plan = generate_recommendations(profile)
self.assertTrue(any(a.severity == "error" and "NVIDIA" in a.title for a in plan.advisories))
def test_4k_display_does_not_recommend_ui_plane_and_scaling_helper(self) -> None:
cards = [
DrmCardInfo(
card_name="card1",
vendor_id="0x1002",
device_id="0x744c",
vram_total_bytes=21458059264,
vis_vram_total_bytes=21458059264,
boot_vga=True,
)
]
profile_4k = build_hardware_profile(
cards=cards,
connected_modes=["3840x2160"],
cpuinfo_text=_CPU_7800X3D,
meminfo_text="MemTotal: 31917772 kB\n",
vulkaninfo_text=_VULKAN_7900XT,
)
plan_4k = generate_recommendations(profile_4k)
rec_map_4k = {r.key: r.recommended for r in plan_4k.recommendations}
self.assertEqual(rec_map_4k["VICTORY_OUTPUT"], "3840x2160")
self.assertNotIn("VICTORY_UI_PLANE", rec_map_4k)
# Below 4K without explicit 3840x2160 needs the separate HUD plane.
self.assertTrue(needs_ui_plane_for_scaling(output="2560x1440", console="series-x", fsr="", ui_plane=None))
self.assertTrue(needs_ui_plane_for_scaling(output="2560x1440", console="series-x", fsr="quality", ui_plane=None))
self.assertTrue(needs_ui_plane_for_scaling(output="1920x1080", console="series-x", fsr="quality", ui_plane=None))
self.assertTrue(needs_ui_plane_for_scaling(output="1280x720", console="series-x", fsr="", ui_plane=None))
self.assertTrue(needs_ui_plane_for_scaling(output="1920x1080", console="series-x", fsr="", ui_plane="0"))
# Already set to 3840x2160, or native 4K output, or 1080p without FSR on Series X -> no warning.
self.assertFalse(needs_ui_plane_for_scaling(output="2560x1440", console="series-x", fsr="quality", ui_plane="3840x2160"))
self.assertFalse(needs_ui_plane_for_scaling(output="3840x2160", console="series-x", fsr="quality", ui_plane=None))
self.assertFalse(needs_ui_plane_for_scaling(output="1920x1080", console="series-x", fsr="", ui_plane=None))
if __name__ == "__main__":
unittest.main()

View File

@ -9,10 +9,13 @@ from pathlib import Path
from victory_launcher.core.commands import (
HELPER_REJECTED_ARGS,
PROFILE_DIR_REL,
build_script_command,
host_access_granted,
open_path_command,
parse_active_scopes,
parse_distrobox_list,
profile_dir_path,
run_script_command,
setup_script_command,
stop_scopes_command,
@ -48,6 +51,19 @@ class ReadinessAndCommandsTests(unittest.TestCase):
setup_cmd = setup_script_command(repo, ["fsr4"], distrobox_name="development", use_distrobox=False)
self.assertEqual(setup_cmd.argv, ("bash", str(repo / "setup.sh"), "fsr4"))
def test_profile_dir_path_and_open_path_command(self) -> None:
repo = Path("/var/home/tim/Git/VIctory-xmem")
pdir = profile_dir_path(repo)
self.assertEqual(pdir, repo / PROFILE_DIR_REL)
self.assertTrue(str(pdir).endswith("local/data/7952987A/saves/0009000000000001/00000000-0000-0000-0000-00007952987a"))
cmd = open_path_command(pdir)
self.assertEqual(cmd.to_spawn_argv(in_flatpak=False), ["xdg-open", str(pdir)])
self.assertEqual(
cmd.to_spawn_argv(in_flatpak=True),
["flatpak-spawn", "--host", "--", "xdg-open", str(pdir)],
)
def test_scope_and_distrobox_parsers_and_host_probe(self) -> None:
scopes_out = (
"um-play-12345.scope loaded active running /var/home/tim/Git/VIctory-xmem/tools/play-wine.sh\n"

View File

@ -48,6 +48,11 @@ class SettingsCatalogTests(unittest.TestCase):
grouped = group_display_settings(display)
self.assertEqual(sum(len(items) for _, items in grouped), len(display))
ui_plane = next(item for item in display if item.key == "VICTORY_UI_PLANE")
self.assertEqual(ui_plane.short_label_for(None), "Default (Off)")
self.assertNotIn("Auto", ui_plane.label_for(None))
self.assertEqual(ui_plane.short_label_for("3840x2160"), "On (3840×2160)")
def test_unknown_future_setting_falls_back_gracefully(self) -> None:
future = SettingDef(
name="VICTORY_BRAND_NEW_SWITCH",

View File

@ -168,3 +168,19 @@ def parse_distrobox_list(output: str) -> list[str]:
def git_command(repo: Path, *args: str) -> HostCommand:
"""Build a read-only or explicit git command scoped to `repo`."""
return HostCommand(argv=("git", "-C", str(repo), *args), cwd=repo)
# Relative path of the Xbox title's saves & profile settings folder inside a checkout.
PROFILE_DIR_REL = Path(
"local/data/7952987A/saves/0009000000000001/00000000-0000-0000-0000-00007952987a"
)
def profile_dir_path(repo: Path) -> Path:
"""Return the saves & profile directory path for `repo`."""
return repo / PROFILE_DIR_REL
def open_path_command(path: Path) -> HostCommand:
"""Build a host command to open a local folder or file in the desktop file manager."""
return HostCommand(argv=("xdg-open", str(path)))

View File

@ -70,6 +70,49 @@ class RecommendationPlan:
return out
def needs_ui_plane_for_scaling(
*,
output: str | None,
console: str | None,
fsr: str | None,
ui_plane: str | None,
) -> bool:
"""Return True when the configured output is below 4K and needs `VICTORY_UI_PLANE=3840x2160`.
The engine's built-in split UI plane only auto-activates at 1920x1080 without host FSR
on Series X; with FSR enabled, or at 1440p / 936p / 720p, leaving `VICTORY_UI_PLANE`
unset leaves menus and HUD oversized unless `3840x2160` is explicitly configured.
"""
if (ui_plane or "").strip().lower() == "3840x2160":
return False
out = (output or "").strip().lower()
cons = (console or "").strip().lower()
fsr_on = (fsr or "").strip().lower() not in ("", "0", "off", "false", "none")
if not out:
# Series S defaults to 1920x1080; with host FSR it still needs explicit 3840x2160.
return cons == "series-s" and fsr_on
if out == "3840x2160":
return False
if "x" not in out:
return False
try:
w_str, h_str = out.split("x", 1)
w, h = int(w_str), int(h_str)
except ValueError:
return False
if w >= 3840 and h >= 2160:
return False
# 1080p without host FSR on Series X already uses the engine's auto split plane unless forced 0.
if (w, h) == (1920, 1080) and not fsr_on and cons != "series-s":
return (ui_plane or "").strip() == "0"
return True
def normalize_output_resolution(detected: str, *, max_height: int = 2160) -> str:
"""Map an arbitrary display resolution (e.g. 3440x1440) to the best supported 16:9 choice."""
if not detected or "x" not in detected:
@ -240,6 +283,17 @@ def generate_recommendations(
add("VICTORY_BVH_BUILDER", "0", "Ray tracing off for playable performance and VRAM safety.")
add("VICTORY_MIP_DROP", "1", "Saves critical VRAM on ≤8 GB cards.")
# --- HUD Scaling Below 4K ---
if target_res != "3840x2160":
add(
"VICTORY_UI_PLANE",
"3840x2160",
(
f"Keeps menus and HUD scaled properly below 4K ({target_res}); "
"leaving Separate 4K HUD Plane unset does not activate with FSR or at 1440p."
),
)
# --- Frame Pacing ---
add(
"VICTORY_FRAME_INTERVAL_MS",

View File

@ -300,11 +300,13 @@ _CURATED: dict[str, SettingMeta] = {
group="Upscaling & Display",
summary=(
"Draws menus and HUD elements on a separate crisp 4K layer above the 3D scene. "
"Required when Frame Generation is enabled so UI text doesn't warp or glitch."
"Set to On (3840×2160) when playing below 4K (1440p, 1080p with FSR, 720p) so menus "
"and HUD scale properly, and whenever Frame Generation is enabled."
),
default_label="Default (Auto — on at 1080p without FSR)",
default_label="Default (Off — only 1080p without FSR; pick On below 4K)",
choice_labels={
"3840x2160": "On — Separate 4K UI layer (3840×2160)",
"3840x2160": "On (3840×2160) — Separate 4K HUD layer (recommended below 4K & for Frame Gen)",
"0": "Force Off — Disable even at 1080p without FSR",
},
),
"VICTORY_FULLSCREEN_RES": SettingMeta(

View File

@ -22,6 +22,7 @@ from victory_launcher.core.commands import (
git_command,
host_access_granted,
list_active_scopes_command,
open_path_command,
parse_active_scopes,
parse_distrobox_list,
stop_scopes_command,
@ -366,3 +367,28 @@ def check_clean_for_pull(repo: Path) -> tuple[bool, str]:
if res.returncode != 0:
return False, res.stderr.strip() or "Could not inspect git status."
return can_safely_fast_forward(res.stdout)
def open_directory(path: Path, *, create: bool = True) -> tuple[bool, str]:
"""Open `path` in the host desktop file manager (creating it first if requested)."""
try:
if create:
path.mkdir(parents=True, exist_ok=True)
elif not path.is_dir():
return False, f"Folder does not exist: {path}"
except OSError as exc:
return False, f"Could not prepare folder {path}: {exc}"
cmd = open_path_command(path)
argv = cmd.to_spawn_argv(in_flatpak=in_flatpak())
try:
subprocess.Popen(
argv,
stdin=subprocess.DEVNULL,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
start_new_session=True,
)
except OSError as exc:
return False, f"Could not open folder in file manager: {exc}"
return True, str(path)

View File

@ -12,6 +12,7 @@ gi.require_version("Adw", "1")
from gi.repository import Adw, Gdk, Gtk
from victory_launcher.core.commands import profile_dir_path
from victory_launcher.core.readiness import ReadinessReport, StepStatus
from victory_launcher.core.run_conf import RunConfDocument
from victory_launcher.core.updates import UpdateState, UpdateStatus
@ -39,6 +40,7 @@ class DashboardPage(Gtk.Box):
on_stop: Callable[[], None],
on_choose_repo: Callable[[], None],
on_choose_game_dir: Callable[[], None],
on_open_profile_dir: Callable[[], None],
on_check_updates: Callable[[], None],
on_open_update_dialog: Callable[[], None],
on_open_prepare: Callable[[], None],
@ -123,6 +125,20 @@ class DashboardPage(Gtk.Box):
self._game_row.add_suffix(game_btn)
repo_group.add(self._game_row)
self._profile_dir_row = make_action_row(
"Saves & Profile Folder",
"Select your VIctory-xmem repository first",
)
self._profile_dir_row.set_subtitle_selectable(True)
self._open_profile_btn = Gtk.Button(label="Open Folder", valign=Gtk.Align.CENTER)
self._open_profile_btn.set_tooltip_text(
"Open the game's saves and profile settings directory in your file manager"
)
self._open_profile_btn.set_sensitive(False)
self._open_profile_btn.connect("clicked", lambda _b: on_open_profile_dir())
self._profile_dir_row.add_suffix(self._open_profile_btn)
repo_group.add(self._profile_dir_row)
self._update_row = make_action_row("Repository Updates", "Checking…")
update_btns = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6, valign=Gtk.Align.CENTER)
self._update_details_btn = Gtk.Button(label="Details…")
@ -252,6 +268,21 @@ class DashboardPage(Gtk.Box):
) -> None:
self._readiness = readiness
self._repo_row.set_subtitle(str(repo) if repo else "Not configured — select your VIctory-xmem folder")
if repo is None:
self._profile_dir_row.set_subtitle("Repository not configured")
self._open_profile_btn.set_sensitive(False)
else:
pdir = profile_dir_path(repo)
self._open_profile_btn.set_sensitive(True)
if pdir.is_dir():
try:
entries = sum(1 for _ in pdir.iterdir())
except OSError:
entries = 0
note = f" ({entries} item{'s' if entries != 1 else ''})" if entries else " (empty)"
self._profile_dir_row.set_subtitle(esc(f"{pdir}{note}"))
else:
self._profile_dir_row.set_subtitle(esc(f"{pdir} (will be created when opened)"))
if doc is None:
self._game_row.set_subtitle("Repository not configured")

View File

@ -12,6 +12,7 @@ gi.require_version("Pango", "1.0")
from gi.repository import Adw, Gio, GObject, Gtk, Pango
from victory_launcher.core.recommendations import needs_ui_plane_for_scaling
from victory_launcher.core.run_conf import RunConfDocument
from victory_launcher.core.settings_catalog import (
GROUP_DESCRIPTIONS,
@ -155,6 +156,14 @@ class SettingsPage(Gtk.Box):
self._fg_banner.connect("button-clicked", self._on_apply_framegen_trio)
self.append(self._fg_banner)
self._ui_plane_banner = Adw.Banner(
title="Running below 4K without Separate 4K HUD Plane = On — menus and HUD may not scale properly.",
button_label="Enable 4K HUD",
revealed=False,
)
self._ui_plane_banner.connect("button-clicked", self._on_enable_ui_plane)
self.append(self._ui_plane_banner)
# --- Proportional Scrollable Preferences Content ---
self._scroll_container = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, vexpand=True, hexpand=True)
self._prefs_page: ResponsivePage | None = None
@ -242,10 +251,17 @@ class SettingsPage(Gtk.Box):
self._refresh_banners()
self._refresh_unsaved_bar()
def _on_enable_ui_plane(self, _banner: Adw.Banner) -> None:
self._record_edit("VICTORY_UI_PLANE", "3840x2160")
self._rebuild_ui()
self._refresh_banners()
self._refresh_unsaved_bar()
def _refresh_banners(self) -> None:
if self._doc is None:
self._attention_banner.set_revealed(False)
self._fg_banner.set_revealed(False)
self._ui_plane_banner.set_revealed(False)
return
if self._doc.attention:
@ -259,8 +275,18 @@ class SettingsPage(Gtk.Box):
fg_val, _ = self._doc.effective_value("VICTORY_FIDELITYFX_FRAMEGEN", pending=self._pending)
fg_dir, _ = self._doc.effective_value("VICTORY_FIDELITYFX_FRAMEGEN_DIRECT", pending=self._pending)
ui_plane, _ = self._doc.effective_value("VICTORY_UI_PLANE", pending=self._pending)
output_val, _ = self._doc.effective_value("VICTORY_OUTPUT", pending=self._pending)
console_val, _ = self._doc.effective_value("CONSOLE", pending=self._pending)
fsr_val, _ = self._doc.effective_value("VICTORY_FSR", pending=self._pending)
need_fg_hint = fg_val == "1" and (fg_dir != "1" or ui_plane != "3840x2160")
self._fg_banner.set_revealed(need_fg_hint)
need_ui_hint = not need_fg_hint and needs_ui_plane_for_scaling(
output=output_val,
console=console_val,
fsr=fsr_val,
ui_plane=ui_plane,
)
self._ui_plane_banner.set_revealed(need_ui_hint)
def _refresh_unsaved_bar(self) -> None:
count = len(self._pending)

View File

@ -19,6 +19,7 @@ from victory_launcher.core.commands import (
HostCommand,
build_script_command,
git_command,
profile_dir_path,
run_script_command,
setup_script_command,
)
@ -117,6 +118,7 @@ class VictoryLauncherWindow(Adw.ApplicationWindow):
on_stop=self.stop_active,
on_choose_repo=self.prompt_choose_repo,
on_choose_game_dir=self.prompt_choose_game_dir,
on_open_profile_dir=self.open_profile_dir,
on_check_updates=self.trigger_update_check,
on_open_update_dialog=self._open_update_dialog,
on_open_prepare=lambda: self.select_section("prepare"),
@ -189,6 +191,7 @@ class VictoryLauncherWindow(Adw.ApplicationWindow):
actions = [
("refresh", lambda: self.refresh_all()),
("choose-repo", self.prompt_choose_repo),
("open-profile-dir", self.open_profile_dir),
("check-updates", lambda: self.trigger_update_check(silent_if_ok=False)),
("reload-conf", self._reload_run_conf_from_disk),
("toggle-play", self._toggle_play_action),
@ -304,6 +307,18 @@ class VictoryLauncherWindow(Adw.ApplicationWindow):
return
self._save_run_conf_edits({"GAME": str(path.resolve())})
def open_profile_dir(self) -> None:
if self._repo is None:
self.toast("Select your VIctory-xmem repository first.")
return
pdir = profile_dir_path(self._repo)
ok, detail = host.open_directory(pdir, create=True)
if ok:
self.toast("Opened saves & profile folder.")
self.refresh_all()
else:
self.toast(detail)
# --- Refreshing Repository, run.conf, Readiness, and Cache ---
def refresh_all(self) -> None: