Skip to content

Commit

Permalink
openvr: dont overwrite bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
galister committed Mar 10, 2024
1 parent b401fb2 commit cb12357
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/backend/openvr/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,16 +314,22 @@ pub fn set_action_manifest(input: &mut InputManager) -> anyhow::Result<()> {
File::create(&action_path)?.write_all(include_bytes!("../../res/actions.json"))?;

let binding_path = CONFIG_ROOT_PATH.join("actions_binding_knuckles.json");
File::create(&binding_path)?
.write_all(include_bytes!("../../res/actions_binding_knuckles.json"))?;
if !binding_path.is_file() {
File::create(&binding_path)?
.write_all(include_bytes!("../../res/actions_binding_knuckles.json"))?;
}

let binding_path = CONFIG_ROOT_PATH.join("actions_binding_vive.json");
File::create(&binding_path)?
.write_all(include_bytes!("../../res/actions_binding_vive.json"))?;
if !binding_path.is_file() {
File::create(&binding_path)?
.write_all(include_bytes!("../../res/actions_binding_vive.json"))?;
}

let binding_path = CONFIG_ROOT_PATH.join("actions_binding_oculus.json");
File::create(&binding_path)?
.write_all(include_bytes!("../../res/actions_binding_oculus.json"))?;
if !binding_path.is_file() {
File::create(&binding_path)?
.write_all(include_bytes!("../../res/actions_binding_oculus.json"))?;
}

if let Err(e) = input.set_action_manifest(action_path.as_path()) {
bail!("Failed to set action manifest: {}", e);
Expand Down

0 comments on commit cb12357

Please sign in to comment.