[feat/663] moved to advanced settings section + finalisations + old comments

This commit is contained in:
LiamillionSS
2024-11-23 08:14:52 +11:00
parent 4f42b3ffcf
commit 3741558ffb
19 changed files with 98 additions and 37 deletions
@@ -35,7 +35,7 @@ export function BsVersionItem(props: { version: BSVersion }) {
useOnUpdate(() => {
const subs: Subscription[] = []
subs.push(bsDownloader.downloadingVersion$.pipe(map(download => equal(download, props.version)), distinctUntilChanged()).subscribe(isDownloading => {
setIsDownloading(() => isDownloading);
}));
@@ -63,6 +63,7 @@ export function BsVersionItem(props: { version: BSVersion }) {
oculus: !!configService.get<boolean>(LaunchMods.OCULUS_MOD),
desktop: !!configService.get<boolean>(LaunchMods.DESKTOP_MOD),
debug: !!configService.get<boolean>(LaunchMods.DEBUG_MOD),
skipVR: !!configService.get<boolean>(LaunchMods.SKIPVR_MOD),
});
return lastValueFrom(launch$).catch(() => {});
};
@@ -67,7 +67,7 @@ import { BrowseIcon } from "./icons/browse-icon.component";
import { AddFileIcon } from "./icons/add-file-icon.component";
export type BsmIconType = SongDetailDiffCharactertistic | ("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" | "web-site" | "clean" | "browse" | "add-file" | "fr-FR-flag" | "es-ES-flag" | "en-US-flag" | "en-EN-flag" | "de-DE-flag" | "ru-RU-flag" | "zh-CN-flag" | "zh-TW-flag" | "ja-JP-flag" | "ko-KR-flag");
export type BsmIconType = SongDetailDiffCharactertistic | ("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" | "web-site" | "clean" | "browse" | "add-file" | "fr-FR-flag" | "es-ES-flag" | "en-US-flag" | "en-EN-flag" | "de-DE-flag" | "ru-RU-flag" | "zh-CN-flag" | "zh-TW-flag" | "ja-JP-flag" | "ko-KR-flag" | "null" );
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
@@ -275,7 +275,9 @@ export const BsmIcon = memo(({ className, icon, style }: { className?: string; i
if(icon === "add-file") {
return <AddFileIcon className={className} style={style} />;
}
if(icon === "null") {
return null;
}
return <TrashIcon className={className} style={style} />;
@@ -18,11 +18,11 @@ export function LaunchModToogle({ onClick, active, text, icon, infoText }: Props
<div className={`relative rounded-full cursor-pointer group active:scale-95 transition-transform ${!active && "shadow-md shadow-black"}`} onClick={() => onClick(!active)}>
<GlowEffect visible={active} className="absolute !rounded-full blur-[2px]" />
<div className="w-full h-full px-6 flex gap-1.5 justify-center items-center bg-light-main-color-2 dark:bg-main-color-2 p-3 rounded-full text-gray-800 dark:text-white group-hover:bg-light-main-color-1 dark:group-hover:bg-main-color-1">
<BsmIcon icon={icon} className="h-7 text-gray-800 dark:text-white" />
<BsmIcon icon={icon} className="h-7 shrink-0 text-gray-800 dark:text-white" />
<span className="w-fit min-w-fit text-lg font-bold uppercase tracking-wide italic ">{t(text)}</span>
{infoText && (
<Tippy content={t(infoText)} placement="bottom" delay={[400, 0]}>
<div className="h-[25px] w-[25px] p-1.5 rounded-full cursor-help bg-light-main-color-1 dark:bg-main-color-3 hover:brightness-110">
<div className="h-[25px] w-[25px] shrink-0 p-1.5 rounded-full cursor-help bg-light-main-color-1 dark:bg-main-color-3 hover:brightness-110">
<BsmIcon className="w-full h-full" icon="info" />
</div>
</Tippy>
@@ -30,6 +30,7 @@ export function LaunchSlide({ version }: Props) {
const [debugMode, setDebugMode] = useState(!!configService.get<boolean>(LaunchMods.DEBUG_MOD));
const [advancedLaunch, setAdvancedLaunch] = useState(false);
const [additionalArgsString, setAdditionalArgsString] = useState<string>(configService.get<string>("additionnal-args") || "");
const [skipVRMode, setSkipVRMode] = useState(!!configService.get<boolean>(LaunchMods.SKIPVR_MOD));
const versionDownloading = useObservable(() => bsDownloader.downloadingVersion$);
const versionRunning = useObservable(() => bsLauncherService.versionRunning$);
@@ -51,6 +52,8 @@ export function LaunchSlide({ version }: Props) {
setOculusMode(value);
} else if (mode === LaunchMods.DESKTOP_MOD) {
setDesktopMode(value);
} else if (mode === LaunchMods.SKIPVR_MOD) {
setSkipVRMode(value);
}
configService.set(mode, value);
};
@@ -66,6 +69,7 @@ export function LaunchSlide({ version }: Props) {
desktop: desktopMode,
debug: debugMode,
additionalArgs: advancedLaunch ? additionalArgs : [],
skipVR: skipVRMode,
});
return lastValueFrom(launch$).catch(() => {});
@@ -98,6 +102,9 @@ export function LaunchSlide({ version }: Props) {
<div className="bg-light-main-color-2 dark:bg-main-color-2 h-9 rounded-full overflow-hidden flex items-center justify-center transition-all duration-100 ease-in-out w-full origin-top shadow-black shadow-sm" style={{ scale: advancedLaunch ? "100% 100%" : "0 0" }}>
<input className="w-[calc(100%-12px)] h-[calc(100%-12px)] bg-light-main-color-1 dark:bg-main-color-1 text-black dark:text-white rounded-full outline-none text-center" type="text" placeholder={t("pages.version-viewer.launch-mods.advanced-launch.placeholder")} value={additionalArgsString} onChange={handleAdditionalArgsChange} />
</div>
<div className="grid grid-cols-3 gap-3 transition-all duration-300 ease-in-out origin-top" style={{ scale: advancedLaunch ? "75% 75%" : "0% 0%" }}>
{advancedLaunch && !(version.oculus || version.metadata?.store === BsStore.OCULUS) && <LaunchModToogle infoText="pages.version-viewer.launch-mods.skipvr-description" icon="null" onClick={() => setMode(LaunchMods.SKIPVR_MOD, !skipVRMode)} active={skipVRMode} text="pages.version-viewer.launch-mods.skipvr" />}
</div>
</div>
<div className='grow flex justify-center items-center'>
<BsmButton