rework storage paths a bit

This commit is contained in:
2025-05-13 09:40:45 +01:00
parent ef0b6de6ba
commit 9dbfbc4419
4 changed files with 16 additions and 17 deletions
+9 -5
View File
@@ -1,8 +1,12 @@
use std::{env, path::PathBuf, sync::LazyLock};
pub static APP_STORAGE_PATH: LazyLock<PathBuf> = LazyLock::new(|| {
PathBuf::from(env::var("LOCALAPPDATA").unwrap_or_else(|_| String::from("."))).join("GTA Tools")
});
pub mod path {
use std::{env, path::PathBuf, sync::LazyLock};
pub static APP_STORAGE: LazyLock<PathBuf> = LazyLock::new(|| {
PathBuf::from(env::var("LOCALAPPDATA").unwrap_or_else(|_| String::from(".")))
.join("GTA Tools")
});
pub static APP_CONFIG: LazyLock<PathBuf> = LazyLock::new(|| APP_STORAGE.join("config.json"));
pub static APP_ERROR: LazyLock<PathBuf> = LazyLock::new(|| APP_STORAGE.join("error.log"));
}
pub mod game {
pub const EXE_ENHANCED: &str = "GTA5_Enhanced.exe";