mirror of
https://github.com/LCE-Hub/LCE-Emerald-Launcher.git
synced 2026-08-20 04:27:29 +00:00
1.6.1 (#189)
This commit is contained in:
parent
116fda9c27
commit
0e1c9250bf
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 20 KiB |
|
|
@ -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
src-tauri/src/commands/platform.rs
Normal file
30
src-tauri/src/commands/platform.rs
Normal 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 }
|
||||
}
|
||||
}
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -79,6 +79,10 @@ const CreditsView = memo(function CreditsView() {
|
|||
"Tymszn21",
|
||||
"DaPogLord",
|
||||
"turniphead",
|
||||
"ArthurDotPNG",
|
||||
"CounterrAct",
|
||||
"luckyduuckxd",
|
||||
"PixelatedCheese1",
|
||||
].sort(() => Math.random() - 0.5),
|
||||
[],
|
||||
);
|
||||
|
|
@ -96,6 +100,8 @@ const CreditsView = memo(function CreditsView() {
|
|||
role: "Founder & Maintainer",
|
||||
members: [
|
||||
{ name: "KayJann", url: "https://github.com/KayJannOnGit" },
|
||||
{ name: "Architect", url: "#" },
|
||||
{ name: "neoapps", url: "https://github.com/neoapps-dev" },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -119,6 +125,7 @@ const CreditsView = memo(function CreditsView() {
|
|||
},
|
||||
{ name: "Leon", url: "https://github.com/hornyalcoholic" },
|
||||
{ name: "Criador_Mods", url: "https://github.com/CriadorMods" },
|
||||
{ name: "j-carv", url: "https://github.com/j-carv" },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
@ -277,6 +284,7 @@ const CreditsView = memo(function CreditsView() {
|
|||
{ name: "alreadywarned", url: "#" },
|
||||
{ name: "andrewjcf", url: "#" },
|
||||
{ name: "dille", url: "#" },
|
||||
{ name: "neoapps", url: "#" },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
@ -334,7 +342,7 @@ const CreditsView = memo(function CreditsView() {
|
|||
<motion.div
|
||||
initial={{ y: "50%" }}
|
||||
animate={{ y: "-200%" }}
|
||||
transition={{ duration: 45, ease: "linear" }}
|
||||
transition={{ duration: 60, ease: "linear" }}
|
||||
className="flex flex-col items-center justify-center space-y-8 py-20"
|
||||
>
|
||||
<div className="mb-8">
|
||||
|
|
|
|||
|
|
@ -1,14 +1,23 @@
|
|||
import { useMemo } from 'react';
|
||||
import { useState, useEffect } from "react";
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
//neo: "why the fuck are you doing it in rust instead of UserAgent", well, Linux was being detected as Android SOMEHOW I DONT FUCKING KNOW HOW OH MY GOD
|
||||
const DEFAULT = {
|
||||
isLinux: false,
|
||||
isMac: false,
|
||||
isWindows: false,
|
||||
isAndroid: false,
|
||||
};
|
||||
export function usePlatform() {
|
||||
const platform = useMemo(() => {
|
||||
if (typeof window === 'undefined') return { isLinux: false, isMac: false, isWindows: false, isAndroid: false };
|
||||
const ua = window.navigator.userAgent.toLowerCase();
|
||||
const plat = window.navigator.platform.toLowerCase();
|
||||
const isAndroid = ua.includes('android');
|
||||
const isLinux = !isAndroid && (plat.includes('linux') || ua.includes('linux'));
|
||||
const isMac = !isAndroid && (plat.includes('mac') || ua.includes('mac'));
|
||||
const isWindows = !isAndroid && (plat.includes('win') || ua.includes('win'));
|
||||
return { isLinux, isMac, isWindows, isAndroid };
|
||||
const [platform, setPlatform] = useState(DEFAULT);
|
||||
useEffect(() => {
|
||||
invoke<{
|
||||
isLinux: boolean;
|
||||
isMac: boolean;
|
||||
isWindows: boolean;
|
||||
isAndroid: boolean;
|
||||
}>("get_platform")
|
||||
.then(setPlatform)
|
||||
.catch(() => setPlatform(DEFAULT));
|
||||
}, []);
|
||||
|
||||
return platform;
|
||||
|
|
|
|||
Loading…
Reference in a new issue