From 56b37fc653863fa738f49081cf91ff9628a43ade Mon Sep 17 00:00:00 2001 From: funman300 Date: Wed, 29 Apr 2026 21:40:13 +0000 Subject: [PATCH] fix(app): point AssetPlugin at workspace assets dir Bevy resolves AssetPlugin::file_path relative to the binary's CARGO_MANIFEST_DIR (solitaire_app/), but the assets/ directory lives at the workspace root. After the switch to AssetServer in fbe984c, every card face, back, background, and font load failed with "Path not found: .../solitaire_app/assets/..." and the renderer fell back to Text2d rank+suit placeholders. Override file_path to "../assets" so cargo run -p solitaire_app from anywhere finds the real artwork at /assets/. Shipping a release binary will need to either set the override differently or copy assets/ next to the binary; that is left for whoever ships first. Co-Authored-By: Claude Opus 4.7 (1M context) --- solitaire_app/src/main.rs | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/solitaire_app/src/main.rs b/solitaire_app/src/main.rs index 992c934..614a14f 100644 --- a/solitaire_app/src/main.rs +++ b/solitaire_app/src/main.rs @@ -30,19 +30,29 @@ fn main() { App::new() .add_plugins( - DefaultPlugins.set(WindowPlugin { - primary_window: Some(Window { - title: "Solitaire Quest".into(), - resolution: (1280u32, 800u32).into(), - resize_constraints: bevy::window::WindowResizeConstraints { - min_width: 800.0, - min_height: 600.0, + DefaultPlugins + .set(WindowPlugin { + primary_window: Some(Window { + title: "Solitaire Quest".into(), + resolution: (1280u32, 800u32).into(), + resize_constraints: bevy::window::WindowResizeConstraints { + min_width: 800.0, + min_height: 600.0, + ..default() + }, ..default() - }, + }), + ..default() + }) + // The `assets/` directory lives at the workspace root, but + // Bevy resolves `AssetPlugin::file_path` relative to the + // binary package's `CARGO_MANIFEST_DIR` (`solitaire_app/`). + // Point one level up so `cargo run -p solitaire_app` finds + // card faces, backs, backgrounds, and the UI font. + .set(bevy::asset::AssetPlugin { + file_path: "../assets".to_string(), ..default() }), - ..default() - }), ) .add_plugins(FontPlugin) .add_plugins(GamePlugin)