wip: discord presence
This commit is contained in:
@@ -2,13 +2,15 @@
|
||||
use tauri::Manager;
|
||||
|
||||
pub mod commands;
|
||||
pub mod presence;
|
||||
pub mod utils;
|
||||
use crate::commands::{
|
||||
check_for_corruption, download_ezpp_launcher_update_files, exit, find_osu_installation,
|
||||
get_beatmapsets_count, get_ezpp_launcher_update_files, get_hwid, get_launcher_version,
|
||||
get_osu_release_stream, get_osu_skin, get_osu_version, get_platform, get_skins_count,
|
||||
is_osu_running, open_url_in_browser, replace_ui_files, run_osu, run_osu_updater,
|
||||
set_osu_config_values, set_osu_user_config_values, valid_osu_folder,
|
||||
is_osu_running, open_url_in_browser, presence_connect, presence_disconnect,
|
||||
presence_is_connected, presence_update_status, presence_update_user, replace_ui_files, run_osu,
|
||||
run_osu_updater, set_osu_config_values, set_osu_user_config_values, valid_osu_folder,
|
||||
};
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
@@ -25,7 +27,7 @@ pub fn run() {
|
||||
}));
|
||||
}
|
||||
|
||||
builder
|
||||
let app = builder
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
get_hwid,
|
||||
find_osu_installation,
|
||||
@@ -47,13 +49,27 @@ pub fn run() {
|
||||
get_launcher_version,
|
||||
exit,
|
||||
get_platform,
|
||||
check_for_corruption
|
||||
check_for_corruption,
|
||||
presence_connect,
|
||||
presence_disconnect,
|
||||
presence_update_status,
|
||||
presence_update_user,
|
||||
presence_is_connected
|
||||
])
|
||||
.plugin(tauri_plugin_fs::init())
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
.plugin(tauri_plugin_shell::init())
|
||||
.plugin(tauri_plugin_cors_fetch::init())
|
||||
.plugin(tauri_plugin_sql::Builder::default().build())
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
.build(tauri::generate_context!())
|
||||
.expect("error while building tauri application");
|
||||
|
||||
app.run(|_app_handle, event| {
|
||||
if let tauri::RunEvent::ExitRequested { api, .. } = event {
|
||||
api.prevent_exit();
|
||||
|
||||
tauri::async_runtime::block_on(presence::disconnect());
|
||||
std::process::exit(0);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user