diff --git a/src/components/ModsSection.tsx b/src/components/ModsSection.tsx index 038b24f..c45d78d 100644 --- a/src/components/ModsSection.tsx +++ b/src/components/ModsSection.tsx @@ -246,7 +246,7 @@ const ModsSection: React.FC = ({ version }) => {
{allVersions.map((v) => { const isSupported = - selectedModForInstall.supportedVersions.includes(v.id); + selectedModForInstall.supported_versions.includes(v.id); const isSelected = selectedVersionsForInstall.includes(v.id); return ( diff --git a/src/components/SettingsSection.tsx b/src/components/SettingsSection.tsx index 8722327..884a4ba 100644 --- a/src/components/SettingsSection.tsx +++ b/src/components/SettingsSection.tsx @@ -1,75 +1,89 @@ -import React, { useState, useEffect } from 'react' -import { Cpu, MemoryStick, Save, RefreshCcw, Info, AlertTriangle } from 'lucide-react' -import { getSettings, updateSettings, type LauncherSettings } from '../services/LauncherService' -import { motion } from 'framer-motion' +import React, { useState, useEffect } from "react"; +import { + Cpu, + MemoryStick, + Save, + RefreshCcw, + Info, + AlertTriangle, +} from "lucide-react"; +import { + getSettings, + updateSettings, + type LauncherSettings, +} from "../services/LauncherService"; +import { motion } from "framer-motion"; const SettingsSection: React.FC = () => { - const [settings, setSettings] = useState(null) - const [isSaving, setIsSaving] = useState(false) - const [saveStatus, setSaveStatus] = useState('') + const [settings, setSettings] = useState(null); + const [isSaving, setIsSaving] = useState(false); + const [saveStatus, setSaveStatus] = useState(""); useEffect(() => { const loadSettings = async () => { - const s = await getSettings() - setSettings(s) - } - loadSettings() - }, []) + const s = await getSettings(); + setSettings(s); + }; + loadSettings(); + }, []); const handleSave = async () => { - if (!settings) return - setIsSaving(true) - setSaveStatus('Saving...') - - await updateSettings(settings) - + if (!settings) return; + setIsSaving(true); + setSaveStatus("Saving..."); + + await updateSettings(settings); + setTimeout(() => { - setIsSaving(false) - setSaveStatus('Settings saved') - setTimeout(() => setSaveStatus(''), 2000) - }, 1000) - } + setIsSaving(false); + setSaveStatus("Settings saved"); + setTimeout(() => setSaveStatus(""), 2000); + }, 1000); + }; const handleReset = async () => { // In a real app, this would reset to defaults in the service const defaultSettings: LauncherSettings = { - jvmArguments: '-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200', - maxMemory: 4096, - } - setSettings(defaultSettings) - } + jvm_arguments: + "-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200", + max_memory: 4096, + }; + setSettings(defaultSettings); + }; - if (!settings) return null + if (!settings) return null; return (

Performance Settings

-

Configure how Saturn Client interacts with your hardware.

+

+ Configure how Saturn Client interacts with your hardware. +

- -
{/* Memory Allocation */} - {
Maximum Memory (RAM) - {(settings.maxMemory / 1024).toFixed(1)} GB + + {(settings.max_memory / 1024).toFixed(1)} GB +
- - setSettings({ ...settings, maxMemory: parseInt(e.target.value) })} + value={settings.max_memory} + onChange={(e) => + setSettings({ + ...settings, + max_memory: parseInt(e.target.value), + }) + } className="w-full h-2 bg-saturn-border rounded-lg appearance-none cursor-pointer accent-saturn-accent" /> - +
1 GB 4 GB @@ -108,14 +129,16 @@ const SettingsSection: React.FC = () => {

- Allocating too much memory can cause system instability, while too little can lead to performance issues or crashes. 4GB - 8GB is recommended for most users. + Allocating too much memory can cause system instability, while + too little can lead to performance issues or crashes. 4GB - 8GB + is recommended for most users.

{/* JVM Arguments */} - {

- Advanced flags for the Java Virtual Machine. Saturn Client includes optimized defaults, but you can override them here. + Advanced flags for the Java Virtual Machine. Saturn Client + includes optimized defaults, but you can override them here.

- -