use directories::ProjectDirs;
use rust_embed::RustEmbed;
const PROJECT_ROOT: &str = env!("CARGO_MANIFEST_DIR");
pub fn asset_dir() -> std::path::PathBuf {
let path = if cfg!(debug_assertions) {
std::path::PathBuf::from(PROJECT_ROOT).join("../../dev_assets")
} else {
ProjectDirs::from("ai", "namastex", "automagik-forge")
.expect("OS didn't give us a home directory")
.data_dir()
.to_path_buf()
};
if !path.exists() {
std::fs::create_dir_all(&path).expect("Failed to create asset directory");
}
path
}
pub fn config_path() -> std::path::PathBuf {
asset_dir().join("config.json")
}
pub fn profiles_path() -> std::path::PathBuf {
asset_dir().join("profiles.json")
}
#[derive(RustEmbed)]
#[folder = "assets/sounds"]
pub struct SoundAssets;
#[derive(RustEmbed)]
#[folder = "assets/scripts"]
pub struct ScriptAssets;