mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
[feature-274] Fix unable to verify original Steam or Oculus version + add "Restore folder" button for original oculus version
This commit is contained in:
@@ -4,6 +4,7 @@ import { BSLauncherService } from "../services/bs-launcher/bs-launcher.service"
|
||||
import { IpcService } from '../services/ipc.service';
|
||||
import { from } from "rxjs";
|
||||
import { SteamLauncherService } from "../services/bs-launcher/steam-launcher.service";
|
||||
import { OculusLauncherService } from "../services/bs-launcher/oculus-launcher.service";
|
||||
|
||||
const ipc = IpcService.getInstance();
|
||||
|
||||
@@ -22,3 +23,10 @@ ipc.on<void>("bs-launch.restore-steamvr", (_, reply) => {
|
||||
const steamLauncher = SteamLauncherService.getInstance();
|
||||
reply(from(steamLauncher.restoreSteamVR()));
|
||||
});
|
||||
|
||||
ipc.on<void>("restore-original-oculus-folder", (_, reply) => {
|
||||
const oculusLauncher = OculusLauncherService.getInstance();
|
||||
reply(from(
|
||||
oculusLauncher.deleteBsSymlinks().then(() => oculusLauncher.restoreOriginalBeatSaber())
|
||||
));
|
||||
})
|
||||
+1
-1
@@ -27,7 +27,7 @@ export const LoginToMetaModal: ModalComponent<boolean> = ({ resolver }) => {
|
||||
<p>
|
||||
<b>Votre token de connexion à Meta est nécéssaire pour télécharger Beat Saber.</b>
|
||||
</p>
|
||||
|
||||
{/* TODO : Translate */}
|
||||
<p>
|
||||
En vous connectant à Meta, une fenètre de connexion s'ouvrira et vous pourrez alors débuter le processus de connexion.
|
||||
Veuillez à bien accepter les cookies sinon quoi, il se pourrait que l'on arrive pas à récupérer votre token de connexion pour démarrer le téléchargement.
|
||||
|
||||
@@ -61,8 +61,9 @@ import { ModelTypeBloqIcon } from "./icons/model-type-bloq-icon.component";
|
||||
import { ChevronTopIcon } from "./icons/chevron-top-icon.component";
|
||||
import { EyeCrossIcon } from "./icons/eye-cross-icon.component";
|
||||
import { ShortcutIcon } from "./icons/shortcut-icon.component";
|
||||
import { BackupRestoreIcon } from "./icons/backup-restore-icon.component";
|
||||
|
||||
export type BsmIconType = BsvMapCharacteristic | MSModelType | ("settings" | "trash" | "favorite" | "folder" | "bsNote" | "check" | "three-dots" | "twitch" | "eye" | "play" | "checkCircleIcon" | "discord" | "info" | "eye-cross" | "terminal" | "desktop" | "oculus" | "add" | "cross" | "task" | "github" | "close" | "thumbUpFill" | "timerFill" | "pause" | "twitter" | "sync" | "chevron-top" | "copy" | "steam" | "edit" | "export" | "patreon" | "search" | "bsMapDifficulty" | "link" | "unlink" | "download" | "filter" | "mee6" | "volume-up" | "volume-off" | "volume-down" | "shortcut" | "fr-FR-flag" | "es-ES-flag" | "en-US-flag" | "en-EN-flag" | "de-DE-flag" | "ru-RU-flag");
|
||||
export type BsmIconType = BsvMapCharacteristic | MSModelType | ("settings" | "trash" | "favorite" | "folder" | "bsNote" | "check" | "three-dots" | "twitch" | "eye" | "play" | "checkCircleIcon" | "discord" | "info" | "eye-cross" | "terminal" | "desktop" | "oculus" | "add" | "cross" | "task" | "github" | "close" | "thumbUpFill" | "timerFill" | "pause" | "twitter" | "sync" | "chevron-top" | "copy" | "steam" | "edit" | "export" | "patreon" | "search" | "bsMapDifficulty" | "link" | "unlink" | "download" | "filter" | "mee6" | "volume-up" | "volume-off" | "volume-down" | "shortcut" | "backup-restore" | "fr-FR-flag" | "es-ES-flag" | "en-US-flag" | "en-EN-flag" | "de-DE-flag" | "ru-RU-flag");
|
||||
|
||||
export const BsmIcon = memo(({ className, icon, style }: { className?: string; icon: BsmIconType; style?: CSSProperties }) => {
|
||||
// TODO : Very ugly very messy, need to find a better way to do this
|
||||
@@ -238,6 +239,10 @@ export const BsmIcon = memo(({ className, icon, style }: { className?: string; i
|
||||
return <ShortcutIcon className={className} style={style} />;
|
||||
}
|
||||
|
||||
if (icon === "backup-restore") {
|
||||
return <BackupRestoreIcon className={className} style={style} />;
|
||||
}
|
||||
|
||||
if (icon === MSModelType.Avatar) {
|
||||
return <ModelTypeAvatarIcon className={className} style={style} />;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import { ComponentProps } from "react"
|
||||
|
||||
export function BackupRestoreIcon(props: ComponentProps<"svg">) {
|
||||
return (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" {...props} fill="currentColor">
|
||||
<path d="M480-120q-126 0-223-76.5T131-392q-4-15 6-27.5t27-14.5q16-2 29 6t18 24q24 90 99 147t170 57q117 0 198.5-81.5T760-480q0-117-81.5-198.5T480-760q-69 0-129 32t-101 88h70q17 0 28.5 11.5T360-600q0 17-11.5 28.5T320-560H160q-17 0-28.5-11.5T120-600v-160q0-17 11.5-28.5T160-800q17 0 28.5 11.5T200-760v54q51-64 124.5-99T480-840q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-480q0 75-28.5 140.5t-77 114q-48.5 48.5-114 77T480-120Zm0-280q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Z"/>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react'
|
||||
import { ComponentProps } from 'react'
|
||||
|
||||
export function MetaIcon(props: React.SVGProps<SVGSVGElement>) {
|
||||
export function MetaIcon(props: ComponentProps<"svg">) {
|
||||
return (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink" id="Layer_1" data-name="Layer 1" viewBox="0 0 287.56 191" {...props}>
|
||||
<defs>
|
||||
|
||||
@@ -99,6 +99,20 @@ export function VersionViewer() {
|
||||
});
|
||||
}
|
||||
|
||||
const restoreOriginalOculusFolder = () => {
|
||||
lastValueFrom(ipcService.sendV2("restore-original-oculus-folder")).then(() => {
|
||||
notification.notifySuccess({
|
||||
title: "Restauration réussie",
|
||||
desc: "Le dossier a été restauré avec succès"
|
||||
});
|
||||
}).catch(() => {
|
||||
notification.notifyError({
|
||||
title: "Erreur lors de la restauration",
|
||||
desc: "Le dossier n'a pas pu être restauré"
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<BsmImage className="absolute w-full h-full top-0 left-0 object-cover" image={state.ReleaseImg || DefautVersionImage} errorImage={DefautVersionImage} />
|
||||
@@ -117,7 +131,8 @@ export function VersionViewer() {
|
||||
</div>
|
||||
<BsmDropdownButton className="absolute top-3 right-4 h-9 w-9 bg-light-main-color-2 dark:bg-main-color-2 rounded-md" items={[
|
||||
{ text: "pages.version-viewer.dropdown.open-folder", icon: "folder", onClick: openFolder },
|
||||
!state.steam && !state.oculus && { text: "pages.version-viewer.dropdown.verify-files", icon: "task", onClick: verifyFiles },
|
||||
state.oculus && { text: "Restaurer le dossier", icon: "backup-restore", onClick: restoreOriginalOculusFolder}, // TODO : translate
|
||||
{ text: "pages.version-viewer.dropdown.verify-files", icon: "task", onClick: verifyFiles },
|
||||
!state.steam && !state.oculus && { text: "pages.version-viewer.dropdown.edit", icon: "edit", onClick: edit },
|
||||
!state.oculus && { text: "pages.version-viewer.dropdown.clone", icon: "copy", onClick: clone },
|
||||
{ text: "pages.version-viewer.dropdown.shared-folders", icon: "link", onClick: openShareFolderModal },
|
||||
|
||||
@@ -88,7 +88,13 @@ export class BsDownloaderService extends AbstractBsDownloaderService {
|
||||
|
||||
public verifyBsVersion(version: BSVersion){
|
||||
this._isVerifying$.next(true);
|
||||
return this.getStoreDownloader(version.metadata.store).verifyBsVersion(version).finally(() => {
|
||||
|
||||
const store = (() => {
|
||||
if(version.metadata?.store){ return version.metadata.store; }
|
||||
return version.steam ? BsStore.STEAM : BsStore.OCULUS;
|
||||
})();
|
||||
|
||||
return this.getStoreDownloader(store).verifyBsVersion(version).finally(() => {
|
||||
this.resetDownloadState();
|
||||
this.versionManager.askInstalledVersions();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user