feat: add command to set osu! user config values with improved error handling
This commit is contained in:
@@ -3,7 +3,8 @@ use std::path::PathBuf;
|
||||
use winreg::RegKey;
|
||||
use winreg::enums::*;
|
||||
|
||||
use crate::utils::{check_folder_completeness, get_osu_user_config, get_osu_config};
|
||||
use crate::utils::set_osu_user_config_value;
|
||||
use crate::utils::{check_folder_completeness, get_osu_config, get_osu_user_config};
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_hwid() -> String {
|
||||
@@ -207,3 +208,12 @@ pub fn get_osu_release_stream(folder: String) -> String {
|
||||
.and_then(|config| config.get("_ReleaseStream").cloned())
|
||||
.unwrap_or_else(|| "Stable40".to_string());
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn set_osu_config_value(
|
||||
osu_folder_path: String,
|
||||
key: String,
|
||||
value: String,
|
||||
) -> Result<bool, String> {
|
||||
set_osu_user_config_value(&osu_folder_path, &key, &value)
|
||||
}
|
||||
|
Reference in New Issue
Block a user