api/paths: fix Lua interop, use data directory for storage

This commit is contained in:
K900 authored and meehl committed 2025-10-30 15:34:10 +01:00
1 parent 1648aa5736
commit c2318f9929
2 files changed
+11 -15

No files matched your search

+9 -1
View File
@@ -31,11 +31,19 @@ impl Game {
GAME_CONFIG.get().expect("Game should be initialized")
}
pub fn script_dir() -> PathBuf {
pub fn data_dir() -> PathBuf {
let directory_name = match Self::current() {
Game::Poe1 => "RustyPathOfBuilding1",
Game::Poe2 => "RustyPathOfBuilding2",
};
BaseDirs::new().unwrap().data_dir().join(directory_name)
}
pub fn script_dir() -> PathBuf {
Game::data_dir()
}
pub fn user_data_dir() -> PathBuf {
Game::data_dir().join("userdata")
}
}