[chore] remove unusable files

This commit is contained in:
Purp1e
2025-03-12 22:20:06 +08:00
parent a78b63259a
commit 71858e5fec
21 changed files with 142 additions and 326 deletions

View File

@@ -1,5 +1,5 @@
import { store } from 'tauri-plugin-valtio';
import { DEFAULT_STORE_CONFIG } from '.';
import { store } from "tauri-plugin-valtio"
import { DEFAULT_STORE_CONFIG } from "."
// Usage:
// import {appStore} from "@/store/app"
@@ -13,16 +13,26 @@ const defaultValue = {
hasUpdate: false,
inited: false,
notice: "",
useMirror: true
useMirror: true,
}
export const appStore = store('app', { ...defaultValue }, DEFAULT_STORE_CONFIG);
export const appStore = store("app", { ...defaultValue }, DEFAULT_STORE_CONFIG)
export const setVersion = (version: string) => { appStore.state.version = version }
export const setHasUpdate = (hasUpdate: boolean) => { appStore.state.hasUpdate = hasUpdate }
export const setInited = (inited: boolean) => { appStore.state.inited = inited }
export const setNotice = (notice: string) => { appStore.state.notice = notice }
export const setUseMirror = (useMirror: boolean) => { appStore.state.useMirror = useMirror }
export const setVersion = (version: string) => {
appStore.state.version = version
}
export const setHasUpdate = (hasUpdate: boolean) => {
appStore.state.hasUpdate = hasUpdate
}
export const setInited = (inited: boolean) => {
appStore.state.inited = inited
}
export const setNotice = (notice: string) => {
appStore.state.notice = notice
}
export const setUseMirror = (useMirror: boolean) => {
appStore.state.useMirror = useMirror
}
export const resetAppStore = () => {
setVersion(defaultValue.version)
@@ -30,4 +40,4 @@ export const resetAppStore = () => {
setInited(defaultValue.inited)
setNotice(defaultValue.notice)
setUseMirror(defaultValue.useMirror)
}
}

View File

@@ -1,6 +1,6 @@
export const DEFAULT_STORE_CONFIG = {
saveOnChange: true,
saveOnExit: true,
saveStrategy: 'debounce' as const,
saveStrategy: "debounce" as const,
saveInterval: 3000,
};
}

View File

@@ -1,28 +1,44 @@
import type { SteamUser } from "@/types/steam"
import { store } from 'tauri-plugin-valtio';
import { DEFAULT_STORE_CONFIG } from '.';
import { store } from "tauri-plugin-valtio"
import { DEFAULT_STORE_CONFIG } from "."
const defaultValue = {
dir: "C:\\Program Files (x86)\\Steam",
csDir: "",
users: [{
steamID64: "76561198052315353",
steamID32: "STEAM_0:0:46157676",
accountName: "wrr",
personaName: "wrr",
recent: 0,
avatar: ""
}] as SteamUser[],
users: [
{
steamID64: "76561198052315353",
steamID32: "STEAM_0:0:46157676",
accountName: "wrr",
personaName: "wrr",
recent: 0,
avatar: "",
},
] as SteamUser[],
isDirValid: false,
isCsDirValid: false
isCsDirValid: false,
}
export const steamStore = store('steam', {...defaultValue}, DEFAULT_STORE_CONFIG);
export const steamStore = store(
"steam",
{ ...defaultValue },
DEFAULT_STORE_CONFIG,
)
export const setDir = (dir: string) => { steamStore.state.dir = dir }
export const setCsDir = (dir: string) => { steamStore.state.csDir = dir }
export const setUsers = (users: SteamUser[]) => { steamStore.state.users = users }
export const setIsDirValid = (valid: boolean) => { steamStore.state.isDirValid = valid }
export const setIsCsDirValid = (valid: boolean) => { steamStore.state.isCsDirValid = valid }
export const setDir = (dir: string) => {
steamStore.state.dir = dir
}
export const setCsDir = (dir: string) => {
steamStore.state.csDir = dir
}
export const setUsers = (users: SteamUser[]) => {
steamStore.state.users = users
}
export const setIsDirValid = (valid: boolean) => {
steamStore.state.isDirValid = valid
}
export const setIsCsDirValid = (valid: boolean) => {
steamStore.state.isCsDirValid = valid
}
export const currentUser = () => {
return steamStore.state.users[0] || defaultValue.users[0]
@@ -34,4 +50,4 @@ export const resetSteamStore = () => {
setUsers(defaultValue.users)
setIsDirValid(defaultValue.isDirValid)
setIsCsDirValid(defaultValue.isCsDirValid)
}
}

View File

@@ -1,23 +1,27 @@
import { store } from 'tauri-plugin-valtio';
import { DEFAULT_STORE_CONFIG } from '.';
import { store } from "tauri-plugin-valtio"
import { DEFAULT_STORE_CONFIG } from "."
const defaultValue = {
launchOptions: [
"-novid -high -freq 144 -fullscreen",
"-novid -high -w 1920 -h 1080 -freq 144 -sw -noborder",
"-novid -high -freq 144 -fullscreen -allow_third_party_software"
"-novid -high -freq 144 -fullscreen -allow_third_party_software",
] as string[],
launchIndex: 0,
powerPlan: 0
powerPlan: 0,
}
export const toolStore = store('tool', { ...defaultValue }, DEFAULT_STORE_CONFIG);
export const toolStore = store(
"tool",
{ ...defaultValue },
DEFAULT_STORE_CONFIG,
)
export const setLaunchOption = (option: string, index: number) => {
toolStore.state.launchOptions = [
...toolStore.state.launchOptions.slice(0, index),
option,
...toolStore.state.launchOptions.slice(index + 1)
...toolStore.state.launchOptions.slice(index + 1),
]
}