mirror of
https://github.com/LCE-Hub/LCE-Emerald-Launcher.git
synced 2026-09-24 17:11:00 +00:00
fix: remove tray till we find better way to implement it
This commit is contained in:
@@ -6,7 +6,7 @@ import { useUI, useConfig, useAudio, useGame } from "../../context/LauncherConte
|
||||
|
||||
const SettingsView = memo(function SettingsView() {
|
||||
const { setActiveView } = useUI();
|
||||
const { vfxEnabled, setVfxEnabled, animationsEnabled, setAnimationsEnabled, musicVol: musicVolume, setMusicVol: setMusicVolume, sfxVol: sfxVolume, setSfxVol: setSfxVolume, layout, setLayout, linuxRunner, setLinuxRunner, perfBoost, setPerfBoost, rpcEnabled, setRpcEnabled, legacyMode, setLegacyMode, keepLauncherOpen, setKeepLauncherOpen, enableTrayIcon, setEnableTrayIcon } = useConfig();
|
||||
const { vfxEnabled, setVfxEnabled, animationsEnabled, setAnimationsEnabled, musicVol: musicVolume, setMusicVol: setMusicVolume, sfxVol: sfxVolume, setSfxVol: setSfxVolume, layout, setLayout, linuxRunner, setLinuxRunner, perfBoost, setPerfBoost, rpcEnabled, setRpcEnabled, legacyMode, setLegacyMode } = useConfig();
|
||||
const { currentTrack, setCurrentTrack, tracks, playPressSound, playBackSound } = useAudio();
|
||||
const { isGameRunning, stopGame, isRunnerDownloading, runnerDownloadProgress, downloadRunner } = useGame();
|
||||
const { isLinux, isMac } = usePlatform();
|
||||
@@ -53,16 +53,6 @@ const SettingsView = memo(function SettingsView() {
|
||||
setLegacyMode(!legacyMode);
|
||||
};
|
||||
|
||||
const handleKeepOpenToggle = () => {
|
||||
playPressSound();
|
||||
setKeepLauncherOpen(!keepLauncherOpen);
|
||||
};
|
||||
|
||||
const handleTrayToggle = () => {
|
||||
playPressSound();
|
||||
setEnableTrayIcon(!enableTrayIcon);
|
||||
};
|
||||
|
||||
const handleRunnerToggle = () => {
|
||||
playPressSound();
|
||||
if (runners.length === 0) return;
|
||||
@@ -291,19 +281,6 @@ const SettingsView = memo(function SettingsView() {
|
||||
type: "button",
|
||||
onClick: handleLegacyToggle,
|
||||
});
|
||||
items.push({
|
||||
id: "keep_open",
|
||||
label: `Keep Launcher Open: ${keepLauncherOpen ? "ON" : "OFF"}`,
|
||||
type: "button",
|
||||
onClick: handleKeepOpenToggle,
|
||||
});
|
||||
items.push({
|
||||
id: "tray_icon",
|
||||
label: `Tray Icon: ${enableTrayIcon ? "ON" : "OFF"}`,
|
||||
type: "button",
|
||||
onClick: handleTrayToggle,
|
||||
});
|
||||
|
||||
if (isLinux) {
|
||||
items.push({
|
||||
id: "runner",
|
||||
@@ -311,22 +288,19 @@ const SettingsView = memo(function SettingsView() {
|
||||
type: "button",
|
||||
onClick: handleRunnerToggle,
|
||||
});
|
||||
|
||||
if (runners.length === 0 || runners.every(r => r.type !== 'proton')) {
|
||||
items.push({
|
||||
id: "download_runner",
|
||||
label: isRunnerDownloading
|
||||
? `Downloading Runner... ${Math.floor(runnerDownloadProgress || 0)}%`
|
||||
: "Download GE-Proton (Recommended)",
|
||||
type: "button",
|
||||
onClick: () => {
|
||||
if (!isRunnerDownloading) {
|
||||
downloadRunner("GE-Proton9-25", "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton9-25/GE-Proton9-25.tar.gz");
|
||||
}
|
||||
},
|
||||
small: true,
|
||||
});
|
||||
}
|
||||
items.push({
|
||||
id: "download_runner",
|
||||
label: isRunnerDownloading
|
||||
? `Downloading Runner... ${Math.floor(runnerDownloadProgress || 0)}%`
|
||||
: "Download GE-Proton (Recommended)",
|
||||
type: "button",
|
||||
onClick: () => {
|
||||
if (!isRunnerDownloading) {
|
||||
downloadRunner("GE-Proton9-25", "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton9-25/GE-Proton9-25.tar.gz");
|
||||
}
|
||||
},
|
||||
small: true,
|
||||
});
|
||||
}
|
||||
|
||||
items.push({
|
||||
@@ -374,8 +348,6 @@ const SettingsView = memo(function SettingsView() {
|
||||
rpcEnabled,
|
||||
legacyMode,
|
||||
animationsEnabled,
|
||||
keepLauncherOpen,
|
||||
enableTrayIcon,
|
||||
layout,
|
||||
isLinux,
|
||||
selectedRunnerName,
|
||||
@@ -389,8 +361,6 @@ const SettingsView = memo(function SettingsView() {
|
||||
handleRpcToggle,
|
||||
handleLegacyToggle,
|
||||
handleAnimationsToggle,
|
||||
handleKeepOpenToggle,
|
||||
handleTrayToggle,
|
||||
handleLayoutToggle,
|
||||
handleRunnerToggle,
|
||||
handlePerfToggle,
|
||||
|
||||
@@ -14,16 +14,12 @@ const SetupView: React.FC<SetupViewProps> = ({ onComplete }) => {
|
||||
username, setUsername,
|
||||
setHasCompletedSetup,
|
||||
profile,
|
||||
setEnableTrayIcon: setConfigTray,
|
||||
setVfxEnabled: setConfigVfx,
|
||||
setRpcEnabled: setConfigRpc,
|
||||
setKeepLauncherOpen: setConfigKeepOpen,
|
||||
setLinuxRunner,
|
||||
linuxRunner: configLinuxRunner,
|
||||
vfxEnabled: configVfx,
|
||||
enableTrayIcon: configTray,
|
||||
rpcEnabled: configRpc,
|
||||
keepLauncherOpen: configKeepOpen
|
||||
} = useConfig();
|
||||
const { playPressSound, playSfx } = useAudio();
|
||||
|
||||
@@ -39,10 +35,8 @@ const SetupView: React.FC<SetupViewProps> = ({ onComplete }) => {
|
||||
const [setupProgress, setSetupProgress] = useState<{ stage: string; message: string; percent?: number } | null>(null);
|
||||
const [runtimeAlreadyInstalled, setRuntimeAlreadyInstalled] = useState(false);
|
||||
|
||||
const [enableTrayIcon, setEnableTrayIcon] = useState(configTray);
|
||||
const [enableVfx, setEnableVfx] = useState(configVfx);
|
||||
const [enableDiscordRPC, setEnableDiscordRPC] = useState(configRpc);
|
||||
const [keepLauncherOpen, setKeepLauncherOpen] = useState(configKeepOpen);
|
||||
|
||||
const totalSteps = isLinux ? 4 : 4;
|
||||
|
||||
@@ -121,10 +115,8 @@ const SetupView: React.FC<SetupViewProps> = ({ onComplete }) => {
|
||||
setCurrentStep(2);
|
||||
setFocusIndex(0);
|
||||
} else if (currentStep === 2) {
|
||||
setConfigTray(enableTrayIcon);
|
||||
setConfigVfx(enableVfx);
|
||||
setConfigRpc(enableDiscordRPC);
|
||||
setConfigKeepOpen(keepLauncherOpen);
|
||||
|
||||
setCurrentStep(3);
|
||||
setFocusIndex(0);
|
||||
@@ -152,7 +144,7 @@ const SetupView: React.FC<SetupViewProps> = ({ onComplete }) => {
|
||||
if (isLinux) count = runners.length + 2; // Runners, Back, Next
|
||||
else if (isMac) count = 3; // Install, Back, Next
|
||||
else count = 2; // Back, Next
|
||||
} else if (currentStep === 2) count = 6; // 4 Toggles, Back, Next
|
||||
} else if (currentStep === 2) count = 4; // 2 Toggles, Back, Next
|
||||
else if (currentStep === 3) count = 2; // Back, Finish
|
||||
|
||||
if (e.key === "ArrowDown" || e.key === "Tab") {
|
||||
@@ -180,12 +172,10 @@ const SetupView: React.FC<SetupViewProps> = ({ onComplete }) => {
|
||||
else if (focusIndex === 1) handleNext();
|
||||
}
|
||||
} else if (currentStep === 2) {
|
||||
if (focusIndex === 0) { setEnableTrayIcon(!enableTrayIcon); playPressSound(); }
|
||||
else if (focusIndex === 1) { setEnableVfx(!enableVfx); playPressSound(); }
|
||||
else if (focusIndex === 2) { setEnableDiscordRPC(!enableDiscordRPC); playPressSound(); }
|
||||
else if (focusIndex === 3) { setKeepLauncherOpen(!keepLauncherOpen); playPressSound(); }
|
||||
else if (focusIndex === 4) handleBack();
|
||||
else if (focusIndex === 5) handleNext();
|
||||
if (focusIndex === 0) { setEnableVfx(!enableVfx); playPressSound(); }
|
||||
else if (focusIndex === 1) { setEnableDiscordRPC(!enableDiscordRPC); playPressSound(); }
|
||||
else if (focusIndex === 2) handleBack();
|
||||
else if (focusIndex === 3) handleNext();
|
||||
} else if (currentStep === 3) {
|
||||
if (focusIndex === 0) handleBack();
|
||||
else if (focusIndex === 1) handleNext();
|
||||
@@ -194,7 +184,7 @@ const SetupView: React.FC<SetupViewProps> = ({ onComplete }) => {
|
||||
};
|
||||
window.addEventListener("keydown", handleKey);
|
||||
return () => window.removeEventListener("keydown", handleKey);
|
||||
}, [currentStep, focusIndex, runners, enableTrayIcon, enableVfx, enableDiscordRPC, keepLauncherOpen, isLinux, isMac, tempUsername]);
|
||||
}, [currentStep, focusIndex, runners, enableVfx, enableDiscordRPC, isLinux, isMac, tempUsername]);
|
||||
|
||||
const handleMacosSetup = async () => {
|
||||
playPressSound();
|
||||
@@ -436,30 +426,6 @@ const SetupView: React.FC<SetupViewProps> = ({ onComplete }) => {
|
||||
<p className="text-lg mb-8 text-white/80">Choose your preferred launcher settings</p>
|
||||
|
||||
<div className="space-y-4 max-w-md mx-auto">
|
||||
<div className="bg-black/50 border-2 border-white/20 p-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="text-left">
|
||||
<p className="text-white font-bold">System Tray Icon</p>
|
||||
<p className="text-xs text-white/60">Keep launcher accessible in system tray</p>
|
||||
</div>
|
||||
<button
|
||||
onClick={() => {
|
||||
playPressSound();
|
||||
setEnableTrayIcon(!enableTrayIcon);
|
||||
}}
|
||||
onMouseEnter={() => setFocusIndex(0)}
|
||||
className={`w-12 h-6 outline-none border-none bg-transparent transition-all duration-200 hover:border-yellow-400 hover:shadow-[0_0_8px_rgba(250,204,21,0.3)] ${focusIndex === 0 ? "scale-110 shadow-[0_0_8px_rgba(250,204,21,0.6)]" : ""}`}
|
||||
style={{ imageRendering: "pixelated" }}
|
||||
>
|
||||
<img
|
||||
src={enableTrayIcon ? "/images/Toggle_Switch_On.png" : "/images/Toggle_Switch_Off.png"}
|
||||
alt="Toggle"
|
||||
className="w-full h-full object-contain"
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="bg-black/50 border-2 border-white/20 p-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="text-left">
|
||||
@@ -471,8 +437,8 @@ const SetupView: React.FC<SetupViewProps> = ({ onComplete }) => {
|
||||
playPressSound();
|
||||
setEnableVfx(!enableVfx);
|
||||
}}
|
||||
onMouseEnter={() => setFocusIndex(1)}
|
||||
className={`w-12 h-6 outline-none border-none bg-transparent transition-all duration-200 hover:border-yellow-400 hover:shadow-[0_0_8px_rgba(250,204,21,0.3)] ${focusIndex === 1 ? "scale-110 shadow-[0_0_8px_rgba(250,204,21,0.6)]" : ""}`}
|
||||
onMouseEnter={() => setFocusIndex(0)}
|
||||
className={`w-12 h-6 outline-none border-none bg-transparent transition-all duration-200 hover:border-yellow-400 hover:shadow-[0_0_8px_rgba(250,204,21,0.3)] ${focusIndex === 0 ? "scale-110 shadow-[0_0_8px_rgba(250,204,21,0.6)]" : ""}`}
|
||||
style={{ imageRendering: "pixelated" }}
|
||||
>
|
||||
<img
|
||||
@@ -495,8 +461,8 @@ const SetupView: React.FC<SetupViewProps> = ({ onComplete }) => {
|
||||
playPressSound();
|
||||
setEnableDiscordRPC(!enableDiscordRPC);
|
||||
}}
|
||||
onMouseEnter={() => setFocusIndex(2)}
|
||||
className={`w-12 h-6 outline-none border-none bg-transparent transition-all duration-200 hover:border-yellow-400 hover:shadow-[0_0_8px_rgba(250,204,21,0.3)] ${focusIndex === 2 ? "scale-110 shadow-[0_0_8px_rgba(250,204,21,0.6)]" : ""}`}
|
||||
onMouseEnter={() => setFocusIndex(1)}
|
||||
className={`w-12 h-6 outline-none border-none bg-transparent transition-all duration-200 hover:border-yellow-400 hover:shadow-[0_0_8px_rgba(250,204,21,0.3)] ${focusIndex === 1 ? "scale-110 shadow-[0_0_8px_rgba(250,204,21,0.6)]" : ""}`}
|
||||
style={{ imageRendering: "pixelated" }}
|
||||
>
|
||||
<img
|
||||
@@ -507,30 +473,6 @@ const SetupView: React.FC<SetupViewProps> = ({ onComplete }) => {
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="bg-black/50 border-2 border-white/20 p-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="text-left">
|
||||
<p className="text-white font-bold">Keep Launcher Open</p>
|
||||
<p className="text-xs text-white/60">Keep launcher running after game launch</p>
|
||||
</div>
|
||||
<button
|
||||
onClick={() => {
|
||||
playPressSound();
|
||||
setKeepLauncherOpen(!keepLauncherOpen);
|
||||
}}
|
||||
onMouseEnter={() => setFocusIndex(3)}
|
||||
className={`w-12 h-6 outline-none border-none bg-transparent transition-all duration-200 hover:border-yellow-400 hover:shadow-[0_0_8px_rgba(250,204,21,0.3)] ${focusIndex === 3 ? "scale-110 shadow-[0_0_8px_rgba(250,204,21,0.6)]" : ""}`}
|
||||
style={{ imageRendering: "pixelated" }}
|
||||
>
|
||||
<img
|
||||
src={keepLauncherOpen ? "/images/Toggle_Switch_On.png" : "/images/Toggle_Switch_Off.png"}
|
||||
alt="Toggle"
|
||||
className="w-full h-full object-contain"
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p className="text-xs mt-6 text-white/60">You can change these later in settings</p>
|
||||
@@ -559,10 +501,8 @@ const SetupView: React.FC<SetupViewProps> = ({ onComplete }) => {
|
||||
<div className="mt-2 pt-2 border-t border-white/20">
|
||||
<p className="text-white text-sm">Customization:</p>
|
||||
<div className="flex flex-wrap gap-2 mt-1">
|
||||
{enableTrayIcon && <span className="text-xs bg-green-600/30 px-2 py-1 border border-green-400">Tray Icon</span>}
|
||||
{enableVfx && <span className="text-xs bg-green-600/30 px-2 py-1 border border-green-400">Visual Effects</span>}
|
||||
{enableDiscordRPC && <span className="text-xs bg-green-600/30 px-2 py-1 border border-green-400">Discord RPC</span>}
|
||||
{keepLauncherOpen && <span className="text-xs bg-green-600/30 px-2 py-1 border border-green-400">Keep Open</span>}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user