mirror of
https://github.com/LCE-Hub/LCE-Emerald-Launcher.git
synced 2026-09-23 08:32:51 +00:00
1.6.1 (#189)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 }
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user