Working structure

This commit is contained in:
2026-04-03 21:37:44 +02:00
parent d0679e61e5
commit 8f292e777d
11 changed files with 143 additions and 42 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ import {
User,
LogOut,
} from "lucide-react";
import { getVersions } from "./services/LauncherService";
import { getVersions } from "./services/SaturnApi";
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
import Logo from "@/assets/logo.png";
+1 -1
View File
@@ -14,7 +14,7 @@ import {
getVersions,
toggleMod,
installMod,
} from "../services/LauncherService";
} from "../services/SaturnApi";
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
import { motion, AnimatePresence } from "framer-motion";
+3 -2
View File
@@ -1,9 +1,10 @@
import React, { useEffect, useState } from "react";
import { Play, Loader2 } from "lucide-react";
import { launchGame } from "../services/LauncherService";
// import { launchGame } from "../services/SaturnApi";
import Bg from "@/assets/bg.png";
import { listen } from "@tauri-apps/api/event";
import { GameVersion } from "@/services/Types";
import { launch } from "@/services/LauncherApi";
interface PlaySectionProps {
version: GameVersion;
@@ -43,7 +44,7 @@ const PlaySection: React.FC<PlaySectionProps> = ({ version }) => {
<div className="absolute -inset-1 bg-linear-to-r from-blue-600 to-cyan-500 rounded-lg blur opacity-25 group-hover:opacity-50 transition duration-1000 group-hover:duration-200"></div>
<button
onClick={() => launchGame(version.id)}
onClick={() => launch()}
disabled={isLaunching}
className="relative btn-primary px-16 py-4 text-xl flex items-center gap-3 min-w-60 justify-center"
>
+2 -3
View File
@@ -7,7 +7,7 @@ import {
Info,
AlertTriangle,
} from "lucide-react";
import { getSettings, updateSettings } from "../services/LauncherService";
import { getSettings, updateSettings } from "../services/SaturnApi";
import { motion } from "framer-motion";
import { LauncherSettings } from "@/services/Types";
@@ -118,8 +118,7 @@ const SettingsSection: React.FC = () => {
<div className="relative w-full mt-2 h-6">
{[1024, 4096, 8192, 12288, 16384].map((value) => {
const percent =
(((value - 1024) / (16384 - 1024)) * 100 - 50) * 0.97 +
50;
(((value - 1024) / (16384 - 1024)) * 100 - 50) * 0.97 + 50;
return (
<span
+13
View File
@@ -0,0 +1,13 @@
import { invoke } from "@tauri-apps/api/core";
const clientId = "74909cec-49b6-4fee-aa60-1b2a57ef72e1";
export async function authenticate() {
return await invoke("plugin:lighty-launcher|authenticate", {
client_id: clientId,
});
}
export async function launch() {
return await invoke("launch");
}
@@ -75,11 +75,3 @@ export async function updateSettings(
): Promise<void> {
await invoke("update_settings", { newSettings });
}
// --- Launch ---
export async function launchGame(
versionId: string,
): Promise<{ success: boolean; message: string }> {
await invoke("plugin:lighty-launcher|launch", { versionId });
return await invoke("launch_game", { versionId });
}