This commit is contained in:
/home/neo
2026-08-18 15:36:27 +03:00
committed by GitHub
parent 116fda9c27
commit 0e1c9250bf
7 changed files with 61 additions and 11 deletions
+1
View File
@@ -6,6 +6,7 @@ pub mod file_dialogs;
pub mod game;
pub mod java2lce;
pub mod macos_setup;
pub mod platform;
pub mod plugins;
pub mod proxy_cmd;
pub mod runners;
+30
View File
@@ -0,0 +1,30 @@
use serde::Serialize;
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct PlatformInfo {
pub is_linux: bool,
pub is_mac: bool,
pub is_windows: bool,
pub is_android: bool,
}
#[tauri::command]
pub fn get_platform() -> PlatformInfo {
#[cfg(target_os = "linux")]
{
PlatformInfo { is_linux: true, is_mac: false, is_windows: false, is_android: false }
}
#[cfg(target_os = "macos")]
{
PlatformInfo { is_linux: false, is_mac: true, is_windows: false, is_android: false }
}
#[cfg(target_os = "windows")]
{
PlatformInfo { is_linux: false, is_mac: false, is_windows: true, is_android: false }
}
#[cfg(target_os = "android")]
{
PlatformInfo { is_linux: false, is_mac: false, is_windows: false, is_android: true }
}
}
+2
View File
@@ -22,6 +22,7 @@ use commands::download;
use commands::file_dialogs;
use commands::game;
use commands::macos_setup;
use commands::platform as platform_cmd;
use commands::plugins;
use commands::proxy_cmd;
use commands::runners;
@@ -75,6 +76,7 @@ pub fn run() {
local_port: Arc::new(Mutex::new(None)),
})
.invoke_handler(tauri::generate_handler![
platform_cmd::get_platform,
macos_setup::setup_macos_runtime,
dlc::list_git_directory,
dlc::download_dlc_files,