Skip to content

Commit

Permalink
backend: only apply decomp settings if they deviate from the defaults…
Browse files Browse the repository at this point in the history
… (if they are true) (#524)

This was causing the JSON settings to not be applied -- as the setting
would be `false` if unset, which would override the json setting.
  • Loading branch information
xTVaser authored Jul 25, 2024
1 parent 4a9da8f commit e4c9f57
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src-tauri/src/commands/binaries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,16 +398,24 @@ pub async fn run_decompiler(
let mut decomp_config_overrides = vec![];
if let Some(decomp_settings) = &config_lock.decompiler_settings {
if let Some(rip_levels) = decomp_settings.rip_levels_enabled {
decomp_config_overrides.push(format!("\"rip_levels\": {rip_levels}"));
if rip_levels {
decomp_config_overrides.push(format!("\"rip_levels\": {rip_levels}"));
}
}
if let Some(rip_collision) = decomp_settings.rip_collision_enabled {
decomp_config_overrides.push(format!("\"rip_collision\": {rip_collision}"));
if rip_collision {
decomp_config_overrides.push(format!("\"rip_collision\": {rip_collision}"));
}
}
if let Some(rip_textures) = decomp_settings.rip_textures_enabled {
decomp_config_overrides.push(format!("\"save_texture_pngs\": {rip_textures}"));
if rip_textures {
decomp_config_overrides.push(format!("\"save_texture_pngs\": {rip_textures}"));
}
}
if let Some(rip_streamed_audio) = decomp_settings.rip_streamed_audio_enabled {
decomp_config_overrides.push(format!("\"rip_streamed_audio\": {rip_streamed_audio}"));
if rip_streamed_audio {
decomp_config_overrides.push(format!("\"rip_streamed_audio\": {rip_streamed_audio}"));
}
}
}

Expand Down

0 comments on commit e4c9f57

Please sign in to comment.