mirror of
https://github.com/LCE-Hub/LCE-Emerald-Launcher.git
synced 2026-09-23 08:32:51 +00:00
feat(hooks/useGameManager): Moon Edition panorama (#113)
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
@@ -75,7 +75,7 @@ const BASE_EDITIONS = [
|
|||||||
titleImage: "/images/minecraft_title_moon.png",
|
titleImage: "/images/minecraft_title_moon.png",
|
||||||
supportsSlimSkins: false,
|
supportsSlimSkins: false,
|
||||||
logo: "/images/moonEdition.png",
|
logo: "/images/moonEdition.png",
|
||||||
panorama: "vanilla_tu19",
|
panorama: "moonedition",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -132,7 +132,9 @@ export function useGameManager({
|
|||||||
}: GameManagerProps) {
|
}: GameManagerProps) {
|
||||||
const [installs, setInstalls] = useState<string[]>([]);
|
const [installs, setInstalls] = useState<string[]>([]);
|
||||||
const [isGameRunning, setIsGameRunning] = useState(false);
|
const [isGameRunning, setIsGameRunning] = useState(false);
|
||||||
const [downloadProgress, setDownloadProgress] = useState<Record<string, number>>({});
|
const [downloadProgress, setDownloadProgress] = useState<
|
||||||
|
Record<string, number>
|
||||||
|
>({});
|
||||||
const [downloadingIds, setDownloadingIds] = useState<string[]>([]);
|
const [downloadingIds, setDownloadingIds] = useState<string[]>([]);
|
||||||
const [isRunnerDownloading, setIsRunnerDownloading] = useState(false);
|
const [isRunnerDownloading, setIsRunnerDownloading] = useState(false);
|
||||||
const [runnerDownloadProgress, setRunnerDownloadProgress] = useState<
|
const [runnerDownloadProgress, setRunnerDownloadProgress] = useState<
|
||||||
@@ -360,7 +362,10 @@ export function useGameManager({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
checkInstalls();
|
checkInstalls();
|
||||||
const unlistenDownload = TauriService.onDownloadProgress((data) =>
|
const unlistenDownload = TauriService.onDownloadProgress((data) =>
|
||||||
setDownloadProgress((prev) => ({ ...prev, [data.instanceId]: data.percent })),
|
setDownloadProgress((prev) => ({
|
||||||
|
...prev,
|
||||||
|
[data.instanceId]: data.percent,
|
||||||
|
})),
|
||||||
);
|
);
|
||||||
const unlistenRunner = TauriService.onRunnerDownloadProgress((p) =>
|
const unlistenRunner = TauriService.onRunnerDownloadProgress((p) =>
|
||||||
setRunnerDownloadProgress(p),
|
setRunnerDownloadProgress(p),
|
||||||
@@ -451,7 +456,8 @@ export function useGameManager({
|
|||||||
[checkInstalls],
|
[checkInstalls],
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleCancelDownload = useCallback(async (id: string) => {
|
const handleCancelDownload = useCallback(
|
||||||
|
async (id: string) => {
|
||||||
try {
|
try {
|
||||||
await TauriService.cancelDownload(id);
|
await TauriService.cancelDownload(id);
|
||||||
await TauriService.deleteInstance(id);
|
await TauriService.deleteInstance(id);
|
||||||
@@ -465,7 +471,9 @@ export function useGameManager({
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
}, [checkInstalls]);
|
},
|
||||||
|
[checkInstalls],
|
||||||
|
);
|
||||||
|
|
||||||
const handleLaunch = useCallback(async () => {
|
const handleLaunch = useCallback(async () => {
|
||||||
if (isGameRunning) return;
|
if (isGameRunning) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user