mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-04-19 19:14:53 +00:00
fix: get ovr compatibility module runtime dir from profile ovr compatibility module struct
This commit is contained in:
parent
1c3b4decb5
commit
e62d0ced36
2 changed files with 15 additions and 12 deletions
|
@ -1,12 +1,11 @@
|
|||
use std::path::{Path, PathBuf};
|
||||
|
||||
use crate::{
|
||||
paths::get_backup_dir,
|
||||
profile::{OvrCompatibilityModuleType, Profile},
|
||||
profile::Profile,
|
||||
util::file_utils::{copy_file, deserialize_file, get_writer, set_file_readonly},
|
||||
xdg::XDG,
|
||||
};
|
||||
use serde::{ser::Error, Deserialize, Serialize};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct OpenVrPaths {
|
||||
|
@ -98,12 +97,7 @@ pub fn build_profile_openvrpaths(profile: &Profile) -> OpenVrPaths {
|
|||
external_drivers: None,
|
||||
jsonid: "vrpathreg".into(),
|
||||
log: vec![datadir.join("Steam/logs")],
|
||||
runtime: match profile.ovr_comp.mod_type {
|
||||
OvrCompatibilityModuleType::Opencomposite => vec![profile.ovr_comp.path.join("build")],
|
||||
OvrCompatibilityModuleType::Xrizer => {
|
||||
vec![profile.ovr_comp.path.join("target/release")]
|
||||
}
|
||||
},
|
||||
runtime: vec![profile.ovr_comp.runtime_dir()],
|
||||
version: 1,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -313,7 +313,7 @@ pub struct ProfileOvrCompatibilityModule {
|
|||
}
|
||||
|
||||
impl ProfileOvrCompatibilityModule {
|
||||
fn default_for_uuid(uuid: &str) -> Self {
|
||||
pub fn default_for_uuid(uuid: &str) -> Self {
|
||||
let mod_type = OvrCompatibilityModuleType::default();
|
||||
Self {
|
||||
mod_type,
|
||||
|
@ -322,6 +322,15 @@ impl ProfileOvrCompatibilityModule {
|
|||
path: get_data_dir().join(uuid).join(mod_type.to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
/// get the directory corresponding to the openvr runtime.
|
||||
/// this should correspond to the build output directory
|
||||
pub fn runtime_dir(&self) -> PathBuf {
|
||||
match self.mod_type {
|
||||
OvrCompatibilityModuleType::Opencomposite => self.path.join("build"),
|
||||
OvrCompatibilityModuleType::Xrizer => self.path.join("target/release"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for ProfileOvrCompatibilityModule {
|
||||
|
@ -453,8 +462,8 @@ impl Profile {
|
|||
pub fn env_vars_full(&self) -> Vec<String> {
|
||||
vec![
|
||||
// format!(
|
||||
// "VR_OVERRIDE={opencomp}/build",
|
||||
// opencomp = self.opencomposite_path,
|
||||
// "VR_OVERRIDE={}",
|
||||
// self.ovr_comp.runtime_dir(),
|
||||
// ),
|
||||
self.xr_runtime_json_env_var(),
|
||||
format!(
|
||||
|
|
Loading…
Add table
Reference in a new issue