Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src-tauri/src/commands/binaries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ pub async fn run_decompiler(
("rip_collision", settings.rip_collision_enabled),
("save_texture_pngs", settings.rip_textures_enabled),
("rip_streamed_audio", settings.rip_streamed_audio_enabled),
("rip_music", settings.rip_music_enabled),
] {
if enabled {
overrides.insert(key.to_string(), true.into());
Expand Down
14 changes: 14 additions & 0 deletions src-tauri/src/commands/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,20 @@ pub async fn set_rip_streamed_audio(
Ok(())
}

#[instrument(skip(config))]
#[tauri::command]
pub async fn set_rip_music(
config: tauri::State<'_, tokio::sync::Mutex<LauncherConfig>>,
enabled: bool,
) -> Result<(), CommandError> {
let mut config_lock = config.lock().await;
config_lock
.decompiler_settings
.set_rip_music_enabled(enabled);
config_lock.save_config()?;
Ok(())
}

#[instrument(skip(config, app_handle))]
#[tauri::command]
pub async fn is_opengl_requirement_met(
Expand Down
5 changes: 5 additions & 0 deletions src-tauri/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ pub struct DecompilerSettings {
pub rip_collision_enabled: bool,
pub rip_textures_enabled: bool,
pub rip_streamed_audio_enabled: bool,
pub rip_music_enabled: bool,
}

impl DecompilerSettings {
Expand All @@ -184,6 +185,10 @@ impl DecompilerSettings {
pub fn set_rip_streamed_audio_enabled(&mut self, enabled: bool) {
self.rip_streamed_audio_enabled = enabled;
}

pub fn set_rip_music_enabled(&mut self, enabled: bool) {
self.rip_music_enabled = enabled;
}
}

#[derive(Debug, Serialize, Deserialize, Default, Clone, TS)]
Expand Down
1 change: 1 addition & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ fn main() {
commands::config::set_rip_collision,
commands::config::set_rip_textures,
commands::config::set_rip_streamed_audio,
commands::config::set_rip_music,
commands::config::update_mod_sources,
commands::config::get_launcher_config,
commands::config::set_hide_beta_alerts,
Expand Down
1 change: 1 addition & 0 deletions src/assets/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"settings_decompiler_ripCollision": "Rip Collision (.obj files)",
"settings_decompiler_ripTextures": "Rip Textures (.png files)",
"settings_decompiler_ripStreamedAudio": "Rip Streamed Audio (.wav files)",
"settings_decompiler_ripMusic": "Rip Music (.wav files)",
"settings_tabs_decompiler": "Decompiler",
"settings_tabs_general": "General",
"settings_tabs_versions": "Versions",
Expand Down
1 change: 1 addition & 0 deletions src/lib/rpc/bindings/DecompilerSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export type DecompilerSettings = {
ripCollisionEnabled: boolean;
ripTexturesEnabled: boolean;
ripStreamedAudioEnabled: boolean;
ripMusicEnabled: boolean;
};
5 changes: 5 additions & 0 deletions src/lib/rpc/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,8 @@ export async function setRipStreamedAudioEnabled(
enabled: enabled,
});
}
export async function setRipMusicEnabled(enabled: boolean): Promise<void> {
return await invoke_rpc("set_rip_music", {
enabled: enabled,
});
}
9 changes: 9 additions & 0 deletions src/routes/settings/Decompiler.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
setRipLevelsEnabled,
setRipStreamedAudioEnabled,
setRipTexturesEnabled,
setRipMusicEnabled,
} from "$lib/rpc/config";
import { Toggle, Label } from "flowbite-svelte";
import { onMount } from "svelte";
Expand All @@ -16,6 +17,7 @@
let ripCollision: boolean = $state(decompilerSettings?.ripCollisionEnabled!);
let ripTextures: boolean = $state(decompilerSettings?.ripTexturesEnabled!);
let ripAudio: boolean = $state(decompilerSettings?.ripStreamedAudioEnabled!);
let ripMusic: boolean = $state(decompilerSettings?.ripMusicEnabled!);

let decompilerOptionsAllowed = $state(true);

Expand Down Expand Up @@ -63,5 +65,12 @@
await setRipStreamedAudioEnabled(evt.currentTarget.checked);
}}>{$_("settings_decompiler_ripStreamedAudio")}</Toggle
>
<Toggle
checked={ripMusic}
color="orange"
onchange={async (evt) => {
await setRipMusicEnabled(evt.currentTarget.checked);
}}>{$_("settings_decompiler_ripMusic")}</Toggle
>
{/if}
</div>
Loading