UPDATE: Add ldiff

This commit is contained in:
2025-08-25 18:12:13 +07:00
parent 99b9df1ce5
commit 6b222bfa70
45 changed files with 1700 additions and 535 deletions

View File

@@ -11,7 +11,7 @@ import {Call as $Call, Create as $Create} from "@wailsio/runtime";
* @returns {Promise<[boolean, string]> & { cancel(): void }}
*/
export function CloseAppAfterTimeout(timeout) {
let $resultPromise = /** @type {any} */($Call.ByID(982751559, timeout));
let $resultPromise = /** @type {any} */($Call.ByID(1705931481, timeout));
return $resultPromise;
}
@@ -19,6 +19,6 @@ export function CloseAppAfterTimeout(timeout) {
* @returns {Promise<[boolean, string]> & { cancel(): void }}
*/
export function GetCurrentLauncherVersion() {
let $resultPromise = /** @type {any} */($Call.ByID(2542090372));
let $resultPromise = /** @type {any} */($Call.ByID(3575133982));
return $resultPromise;
}

View File

@@ -0,0 +1,8 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import * as AppService from "./appservice.js";
export {
AppService
};

View File

@@ -11,7 +11,7 @@ import {Call as $Call, Create as $Create} from "@wailsio/runtime";
* @returns {Promise<[boolean, string, string]> & { cancel(): void }}
*/
export function CheckTypeHDiff(patchPath) {
let $resultPromise = /** @type {any} */($Call.ByID(1068035136, patchPath));
let $resultPromise = /** @type {any} */($Call.ByID(3717449114, patchPath));
return $resultPromise;
}
@@ -20,7 +20,7 @@ export function CheckTypeHDiff(patchPath) {
* @returns {Promise<[boolean, string]> & { cancel(): void }}
*/
export function CutData(gamePath) {
let $resultPromise = /** @type {any} */($Call.ByID(3671642725, gamePath));
let $resultPromise = /** @type {any} */($Call.ByID(2019290107, gamePath));
return $resultPromise;
}
@@ -31,7 +31,7 @@ export function CutData(gamePath) {
* @returns {Promise<[boolean, string]> & { cancel(): void }}
*/
export function DataExtract(gamePath, patchPath, isSkipVerify) {
let $resultPromise = /** @type {any} */($Call.ByID(1843136452, gamePath, patchPath, isSkipVerify));
let $resultPromise = /** @type {any} */($Call.ByID(2161622254, gamePath, patchPath, isSkipVerify));
return $resultPromise;
}
@@ -40,7 +40,7 @@ export function DataExtract(gamePath, patchPath, isSkipVerify) {
* @returns {Promise<[boolean, string]> & { cancel(): void }}
*/
export function DeleteFiles(gamePath) {
let $resultPromise = /** @type {any} */($Call.ByID(989019003, gamePath));
let $resultPromise = /** @type {any} */($Call.ByID(1103091613, gamePath));
return $resultPromise;
}
@@ -48,8 +48,17 @@ export function DeleteFiles(gamePath) {
* @param {string} gamePath
* @returns {Promise<[boolean, string]> & { cancel(): void }}
*/
export function PatchData(gamePath) {
let $resultPromise = /** @type {any} */($Call.ByID(3608591627, gamePath));
export function HDiffPatchData(gamePath) {
let $resultPromise = /** @type {any} */($Call.ByID(3944051994, gamePath));
return $resultPromise;
}
/**
* @param {string} gamePath
* @returns {Promise<[boolean, string]> & { cancel(): void }}
*/
export function LDiffPatchData(gamePath) {
let $resultPromise = /** @type {any} */($Call.ByID(360123238, gamePath));
return $resultPromise;
}
@@ -59,6 +68,6 @@ export function PatchData(gamePath) {
* @returns {Promise<[boolean, string]> & { cancel(): void }}
*/
export function VersionValidate(gamePath, patchPath) {
let $resultPromise = /** @type {any} */($Call.ByID(3916254383, gamePath, patchPath));
let $resultPromise = /** @type {any} */($Call.ByID(2105077257, gamePath, patchPath));
return $resultPromise;
}

View File

@@ -0,0 +1,8 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import * as DiffService from "./diffservice.js";
export {
DiffService
};

View File

@@ -11,7 +11,7 @@ import {Call as $Call, Create as $Create} from "@wailsio/runtime";
* @returns {Promise<boolean> & { cancel(): void }}
*/
export function DirExists(path) {
let $resultPromise = /** @type {any} */($Call.ByID(1291974398, path));
let $resultPromise = /** @type {any} */($Call.ByID(1772289644, path));
return $resultPromise;
}
@@ -20,7 +20,7 @@ export function DirExists(path) {
* @returns {Promise<boolean> & { cancel(): void }}
*/
export function FileExists(path) {
let $resultPromise = /** @type {any} */($Call.ByID(3373618865, path));
let $resultPromise = /** @type {any} */($Call.ByID(1782610747, path));
return $resultPromise;
}
@@ -30,7 +30,7 @@ export function FileExists(path) {
* @returns {Promise<[boolean, string]> & { cancel(): void }}
*/
export function FileExistsInZip(archivePath, fileInside) {
let $resultPromise = /** @type {any} */($Call.ByID(1737012553, archivePath, fileInside));
let $resultPromise = /** @type {any} */($Call.ByID(2509699047, archivePath, fileInside));
return $resultPromise;
}
@@ -39,15 +39,16 @@ export function FileExistsInZip(archivePath, fileInside) {
* @returns {Promise<[boolean, string]> & { cancel(): void }}
*/
export function OpenFolder(path) {
let $resultPromise = /** @type {any} */($Call.ByID(2733319263, path));
let $resultPromise = /** @type {any} */($Call.ByID(1635714001, path));
return $resultPromise;
}
/**
* @param {string} filter
* @returns {Promise<string> & { cancel(): void }}
*/
export function PickFile() {
let $resultPromise = /** @type {any} */($Call.ByID(2181012076));
export function PickFile(filter) {
let $resultPromise = /** @type {any} */($Call.ByID(3756474934, filter));
return $resultPromise;
}
@@ -55,7 +56,7 @@ export function PickFile() {
* @returns {Promise<string> & { cancel(): void }}
*/
export function PickFolder() {
let $resultPromise = /** @type {any} */($Call.ByID(3906046322));
let $resultPromise = /** @type {any} */($Call.ByID(3654471460));
return $resultPromise;
}
@@ -64,7 +65,7 @@ export function PickFolder() {
* @returns {Promise<boolean> & { cancel(): void }}
*/
export function StartApp(path) {
let $resultPromise = /** @type {any} */($Call.ByID(3825990132, path));
let $resultPromise = /** @type {any} */($Call.ByID(1267568402, path));
return $resultPromise;
}
@@ -73,6 +74,6 @@ export function StartApp(path) {
* @returns {Promise<boolean> & { cancel(): void }}
*/
export function StartWithConsole(path) {
let $resultPromise = /** @type {any} */($Call.ByID(2364569062, path));
let $resultPromise = /** @type {any} */($Call.ByID(3249271428, path));
return $resultPromise;
}

View File

@@ -0,0 +1,8 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import * as FSService from "./fsservice.js";
export {
FSService
};

View File

@@ -11,7 +11,7 @@ import {Call as $Call, Create as $Create} from "@wailsio/runtime";
* @returns {Promise<[boolean, string]> & { cancel(): void }}
*/
export function DownloadProxyProgress(version) {
let $resultPromise = /** @type {any} */($Call.ByID(1951249093, version));
let $resultPromise = /** @type {any} */($Call.ByID(3559275334, version));
return $resultPromise;
}
@@ -20,7 +20,7 @@ export function DownloadProxyProgress(version) {
* @returns {Promise<[boolean, string]> & { cancel(): void }}
*/
export function DownloadServerProgress(version) {
let $resultPromise = /** @type {any} */($Call.ByID(314135954, version));
let $resultPromise = /** @type {any} */($Call.ByID(1954767259, version));
return $resultPromise;
}
@@ -28,7 +28,7 @@ export function DownloadServerProgress(version) {
* @returns {Promise<[boolean, string, string]> & { cancel(): void }}
*/
export function GetLatestLauncherVersion() {
let $resultPromise = /** @type {any} */($Call.ByID(3191972855));
let $resultPromise = /** @type {any} */($Call.ByID(262637602));
return $resultPromise;
}
@@ -36,7 +36,7 @@ export function GetLatestLauncherVersion() {
* @returns {Promise<[boolean, string, string]> & { cancel(): void }}
*/
export function GetLatestProxyVersion() {
let $resultPromise = /** @type {any} */($Call.ByID(1462362449));
let $resultPromise = /** @type {any} */($Call.ByID(289488362));
return $resultPromise;
}
@@ -44,7 +44,7 @@ export function GetLatestProxyVersion() {
* @returns {Promise<[boolean, string, string]> & { cancel(): void }}
*/
export function GetLatestServerVersion() {
let $resultPromise = /** @type {any} */($Call.ByID(1447982978));
let $resultPromise = /** @type {any} */($Call.ByID(2918980975));
return $resultPromise;
}
@@ -52,7 +52,7 @@ export function GetLatestServerVersion() {
* @returns {Promise<void> & { cancel(): void }}
*/
export function UnzipProxy() {
let $resultPromise = /** @type {any} */($Call.ByID(4071181044));
let $resultPromise = /** @type {any} */($Call.ByID(2563246729));
return $resultPromise;
}
@@ -60,7 +60,7 @@ export function UnzipProxy() {
* @returns {Promise<void> & { cancel(): void }}
*/
export function UnzipServer() {
let $resultPromise = /** @type {any} */($Call.ByID(4110296071));
let $resultPromise = /** @type {any} */($Call.ByID(1126363284));
return $resultPromise;
}
@@ -69,6 +69,6 @@ export function UnzipServer() {
* @returns {Promise<[boolean, string]> & { cancel(): void }}
*/
export function UpdateLauncherProgress(version) {
let $resultPromise = /** @type {any} */($Call.ByID(2648938152, version));
let $resultPromise = /** @type {any} */($Call.ByID(97272861, version));
return $resultPromise;
}

View File

@@ -0,0 +1,8 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import * as GitService from "./gitservice.js";
export {
GitService
};

View File

@@ -1,16 +0,0 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import * as AppService from "./appservice.js";
import * as FSService from "./fsservice.js";
import * as GitService from "./gitservice.js";
import * as HdiffzService from "./hdiffzservice.js";
import * as LanguageService from "./languageservice.js";
export {
AppService,
FSService,
GitService,
HdiffzService,
LanguageService
};

View File

@@ -0,0 +1,8 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import * as LanguageService from "./languageservice.js";
export {
LanguageService
};

View File

@@ -11,7 +11,7 @@ import {Call as $Call, Create as $Create} from "@wailsio/runtime";
* @returns {Promise<[boolean, string, string, string]> & { cancel(): void }}
*/
export function GetLanguage(path) {
let $resultPromise = /** @type {any} */($Call.ByID(3450750492, path));
let $resultPromise = /** @type {any} */($Call.ByID(3574191687, path));
return $resultPromise;
}
@@ -22,6 +22,6 @@ export function GetLanguage(path) {
* @returns {Promise<[boolean, string]> & { cancel(): void }}
*/
export function SetLanguage(path, text, voice) {
let $resultPromise = /** @type {any} */($Call.ByID(2793672496, path, text, voice));
let $resultPromise = /** @type {any} */($Call.ByID(2768939795, path, text, voice));
return $resultPromise;
}

View File

@@ -1,7 +1,8 @@
import useLauncherStore from "@/stores/launcherStore";
import { AppService, GitService } from "@bindings/firefly-launcher/internal";
import { AppService, } from "@bindings/firefly-launcher/internal/app-service";
import { toast } from "react-toastify";
import { sleep } from "./sleep";
import { GitService } from "@bindings/firefly-launcher/internal/git-service";
export async function CheckUpdateLauncher(): Promise<{ isUpdate: boolean; isExists: boolean; version: string }> {
const [currentOk, currentVersion] = await AppService.GetCurrentLauncherVersion()

View File

@@ -1,6 +1,7 @@
import useLauncherStore from "@/stores/launcherStore";
import useSettingStore from "@/stores/settingStore";
import { FSService, GitService } from "@bindings/firefly-launcher/internal";
import { FSService } from "@bindings/firefly-launcher/internal/fs-service";
import { GitService } from "@bindings/firefly-launcher/internal/git-service";
import { toast } from "react-toastify";
export async function CheckUpdateProxy(proxyPath: string, proxyVersion: string) : Promise<{isUpdate: boolean, isExists: boolean, version: string}> {

View File

@@ -1,6 +1,7 @@
import useLauncherStore from '@/stores/launcherStore';
import useSettingStore from '@/stores/settingStore';
import { FSService, GitService } from '@bindings/firefly-launcher/internal';
import { FSService } from '@bindings/firefly-launcher/internal/fs-service';
import { GitService } from '@bindings/firefly-launcher/internal/git-service';
import { toast } from 'react-toastify';
export async function CheckUpdateServer(

View File

@@ -12,6 +12,7 @@ export function useGlobalEvents({
setProgressDownload,
setDownloadSpeed,
setMessageUpdate,
setStageType,
}: {
setGameRunning: (v: boolean) => void;
@@ -22,6 +23,7 @@ export function useGlobalEvents({
setProgressDownload: (v: number) => void;
setDownloadSpeed: (v: number) => void;
setMessageUpdate: (v: string) => void;
setStageType: (v: string) => void,
}) {
useEffect(() => {
const onGameExit = () => setGameRunning(false);
@@ -45,14 +47,20 @@ export function useGlobalEvents({
setMessageUpdate(message);
};
const onStageUpdate = (event: any) => {
const { stage } = event.data[0];
setStageType(stage);
};
Events.On("download:server", onDownload);
Events.On("download:proxy", onDownload);
Events.On("game:exit", onGameExit);
Events.On("server:exit", onServerExit);
Events.On("proxy:exit", onProxyExit);
Events.On("hdiffz:progress", onUpdateProgress);
Events.On("hdiffz:message", onMessageUpdate);
Events.On("hdiffz:error", (event: any) => {
Events.On("diff:progress", onUpdateProgress);
Events.On("diff:message", onMessageUpdate);
Events.On("diff:stage", onStageUpdate);
Events.On("diff:error", (event: any) => {
const { message } = event.data[0];
toast.error(message);
});
@@ -63,8 +71,9 @@ export function useGlobalEvents({
Events.Off("game:exit");
Events.Off("server:exit");
Events.Off("proxy:exit");
Events.Off("hdiffz:progress");
Events.Off("hdiffz:message");
Events.Off("diff:progress")
Events.Off("diff:message");
Events.Off("diff:stage");
Events.Off("version:check");
};
}, []);

View File

@@ -2,11 +2,12 @@ import useSettingStore from "@/stores/settingStore"
import { Check, Folder, File, X, Settings } from "lucide-react"
import { useEffect } from "react"
import { toast } from "react-toastify"
import { FSService, HdiffzService} from "@bindings/firefly-launcher/internal"
import { DiffService} from "@bindings/firefly-launcher/internal/diff-service"
import { FSService } from "@bindings/firefly-launcher/internal/fs-service"
import { motion } from "motion/react"
import useHdiffzStore from "@/stores/hdiffzStore"
import useDiffStore from "@/stores/diffStore"
export default function HdiffzPage() {
export default function DiffPage() {
const { gameDir, setGameDir } = useSettingStore()
const {
isLoading,
@@ -27,7 +28,7 @@ export default function HdiffzPage() {
setStageType,
messageUpdate,
setMessageUpdate
} = useHdiffzStore()
} = useDiffStore()
useEffect(() => {
const getLanguage = async () => {
@@ -78,7 +79,7 @@ export default function HdiffzPage() {
const handlePickDiffFile = async () => {
try {
setIsLoading({game: false, diff: true})
const basePath = await FSService.PickFile()
const basePath = await FSService.PickFile("")
if (basePath) {
if (!basePath.endsWith(".7z") && !basePath.endsWith(".zip") && !basePath.endsWith(".rar")) {
toast.error('Not valid file type')
@@ -86,9 +87,15 @@ export default function HdiffzPage() {
setDiffDir('')
return
}
const [exists, error] = await FSService.FileExistsInZip(basePath, "StarRail_Data\\StreamingAssets\\BinaryVersion.bytes")
if (!exists) {
toast.error(error)
const [isOk, validType, errorType] = await DiffService.CheckTypeHDiff(basePath)
if (!isOk) {
toast.error(errorType)
setDiffCheckResult('error')
setDiffDir('')
return
}
if (validType == "") {
toast.error('Not valid file type')
setDiffCheckResult('error')
setDiffDir('')
return
@@ -119,7 +126,7 @@ export default function HdiffzPage() {
setStageType('Check Type HDiff')
setProgressUpdate(0)
setMaxProgressUpdate(1)
const [isOk, validType, errorType] = await HdiffzService.CheckTypeHDiff(diffDir)
const [isOk, validType, errorType] = await DiffService.CheckTypeHDiff(diffDir)
if (!isOk) {
toast.error(errorType)
setIsDiffLoading(false)
@@ -127,11 +134,13 @@ export default function HdiffzPage() {
}
setProgressUpdate(1)
if (validType === 'hdiffmap.json') {
setStageType('Version Validate')
setProgressUpdate(0)
setMaxProgressUpdate(1)
const [validVersion, errorVersion] = await HdiffzService.VersionValidate(gameDir, diffDir)
const [validVersion, errorVersion] = await DiffService.VersionValidate(gameDir, diffDir)
if (!validVersion) {
toast.error(errorVersion)
setIsDiffLoading(false)
@@ -140,8 +149,9 @@ export default function HdiffzPage() {
setProgressUpdate(1)
}
const isSkipVerify = validType === 'manifest' || validType === 'hdifffiles.txt'
setStageType('Data Extract')
const [validData, errorData] = await HdiffzService.DataExtract(gameDir, diffDir, validType === 'hdifffiles.txt')
const [validData, errorData] = await DiffService.DataExtract(gameDir, diffDir, isSkipVerify)
if (!validData) {
toast.error(errorData)
setIsDiffLoading(false)
@@ -150,28 +160,38 @@ export default function HdiffzPage() {
setStageType('Cut Data')
setMessageUpdate('')
const [validCut, errorCut] = await HdiffzService.CutData(gameDir)
const [validCut, errorCut] = await DiffService.CutData(gameDir)
if (!validCut) {
toast.error(errorCut)
setIsDiffLoading(false)
return
}
setStageType('Patch Data')
const [validPatch, errorPatch] = await HdiffzService.PatchData(gameDir)
if (!validPatch) {
toast.error(errorPatch)
setIsDiffLoading(false)
return
if ( validType === 'hdifffiles.txt' || validType === 'hdiffmap.json') {
setStageType('Patch Data')
const [validPatch, errorPatch] = await DiffService.HDiffPatchData(gameDir)
if (!validPatch) {
toast.error(errorPatch)
setIsDiffLoading(false)
return
}
setStageType('Delete old files')
const [validDelete, errorDelete] = await DiffService.DeleteFiles(gameDir)
if (!validDelete) {
toast.error(errorDelete)
setIsDiffLoading(false)
return
}
} else if (validType === 'manifest') {
setStageType('Patch Data')
const [validPatch, errorPatch] = await DiffService.LDiffPatchData(gameDir)
if (!validPatch) {
toast.error(errorPatch)
setIsDiffLoading(false)
return
}
}
setStageType('Delete old files')
const [validDelete, errorDelete] = await HdiffzService.DeleteFiles(gameDir)
if (!validDelete) {
toast.error(errorDelete)
setIsDiffLoading(false)
return
}
toast.success('Update game completed')
} catch (err: any) {
console.error(err)

View File

@@ -1,7 +1,7 @@
import { useEffect, useState } from 'react'
import { Folder, Settings, Check, X, Globe, Mic } from 'lucide-react'
import { FSService } from '@bindings/firefly-launcher/internal'
import { LanguageService } from '@bindings/firefly-launcher/internal'
import { FSService } from '@bindings/firefly-launcher/internal/fs-service'
import { LanguageService } from '@bindings/firefly-launcher/internal/language-service'
import { toast } from 'react-toastify'
import useSettingStore from '@/stores/settingStore'

View File

@@ -1,6 +1,7 @@
import { useEffect } from 'react';
import { Play, Menu, FolderOpen, MessageCircleQuestionMark } from 'lucide-react';
import { FSService, AppService } from '@bindings/firefly-launcher/internal';
import { AppService } from '@bindings/firefly-launcher/internal/app-service';
import { FSService } from '@bindings/firefly-launcher/internal/fs-service';
import { toast } from 'react-toastify';
import path from 'path-browserify'
import useSettingStore from '@/stores/settingStore';
@@ -120,7 +121,7 @@ export default function LauncherPage() {
const handlePickFile = async () => {
try {
setIsLoading(true)
const basePath = await FSService.PickFile()
const basePath = await FSService.PickFile("exe")
if (basePath.endsWith("StarRail.exe") || basePath.endsWith("launcher.exe")) {
const normalized = basePath.replace(/\\/g, '/')
const folderPath = path.dirname(normalized)

View File

@@ -12,7 +12,7 @@ import { Route as rootRouteImport } from './routes/__root'
import { Route as SrtoolsRouteImport } from './routes/srtools'
import { Route as LanguageRouteImport } from './routes/language'
import { Route as HowtoRouteImport } from './routes/howto'
import { Route as HdiffzRouteImport } from './routes/hdiffz'
import { Route as DiffRouteImport } from './routes/diff'
import { Route as AnalysisRouteImport } from './routes/analysis'
import { Route as AboutRouteImport } from './routes/about'
import { Route as IndexRouteImport } from './routes/index'
@@ -32,9 +32,9 @@ const HowtoRoute = HowtoRouteImport.update({
path: '/howto',
getParentRoute: () => rootRouteImport,
} as any)
const HdiffzRoute = HdiffzRouteImport.update({
id: '/hdiffz',
path: '/hdiffz',
const DiffRoute = DiffRouteImport.update({
id: '/diff',
path: '/diff',
getParentRoute: () => rootRouteImport,
} as any)
const AnalysisRoute = AnalysisRouteImport.update({
@@ -57,7 +57,7 @@ export interface FileRoutesByFullPath {
'/': typeof IndexRoute
'/about': typeof AboutRoute
'/analysis': typeof AnalysisRoute
'/hdiffz': typeof HdiffzRoute
'/diff': typeof DiffRoute
'/howto': typeof HowtoRoute
'/language': typeof LanguageRoute
'/srtools': typeof SrtoolsRoute
@@ -66,7 +66,7 @@ export interface FileRoutesByTo {
'/': typeof IndexRoute
'/about': typeof AboutRoute
'/analysis': typeof AnalysisRoute
'/hdiffz': typeof HdiffzRoute
'/diff': typeof DiffRoute
'/howto': typeof HowtoRoute
'/language': typeof LanguageRoute
'/srtools': typeof SrtoolsRoute
@@ -76,7 +76,7 @@ export interface FileRoutesById {
'/': typeof IndexRoute
'/about': typeof AboutRoute
'/analysis': typeof AnalysisRoute
'/hdiffz': typeof HdiffzRoute
'/diff': typeof DiffRoute
'/howto': typeof HowtoRoute
'/language': typeof LanguageRoute
'/srtools': typeof SrtoolsRoute
@@ -87,7 +87,7 @@ export interface FileRouteTypes {
| '/'
| '/about'
| '/analysis'
| '/hdiffz'
| '/diff'
| '/howto'
| '/language'
| '/srtools'
@@ -96,7 +96,7 @@ export interface FileRouteTypes {
| '/'
| '/about'
| '/analysis'
| '/hdiffz'
| '/diff'
| '/howto'
| '/language'
| '/srtools'
@@ -105,7 +105,7 @@ export interface FileRouteTypes {
| '/'
| '/about'
| '/analysis'
| '/hdiffz'
| '/diff'
| '/howto'
| '/language'
| '/srtools'
@@ -115,7 +115,7 @@ export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
AboutRoute: typeof AboutRoute
AnalysisRoute: typeof AnalysisRoute
HdiffzRoute: typeof HdiffzRoute
DiffRoute: typeof DiffRoute
HowtoRoute: typeof HowtoRoute
LanguageRoute: typeof LanguageRoute
SrtoolsRoute: typeof SrtoolsRoute
@@ -144,11 +144,11 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof HowtoRouteImport
parentRoute: typeof rootRouteImport
}
'/hdiffz': {
id: '/hdiffz'
path: '/hdiffz'
fullPath: '/hdiffz'
preLoaderRoute: typeof HdiffzRouteImport
'/diff': {
id: '/diff'
path: '/diff'
fullPath: '/diff'
preLoaderRoute: typeof DiffRouteImport
parentRoute: typeof rootRouteImport
}
'/analysis': {
@@ -179,7 +179,7 @@ const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
AboutRoute: AboutRoute,
AnalysisRoute: AnalysisRoute,
HdiffzRoute: HdiffzRoute,
DiffRoute: DiffRoute,
HowtoRoute: HowtoRoute,
LanguageRoute: LanguageRoute,
SrtoolsRoute: SrtoolsRoute,

View File

@@ -3,7 +3,7 @@ import ThemeController from '../components/themeController'
import { ToastContainer } from 'react-toastify'
import { useGlobalEvents } from '@/hooks';
import useLauncherStore from '@/stores/launcherStore';
import useHdiffzStore from '@/stores/hdiffzStore';
import useDiffStore from '@/stores/diffStore';
export const Route = createRootRoute({
component: RootLayout
@@ -11,7 +11,7 @@ export const Route = createRootRoute({
function RootLayout() {
const { setGameRunning, setServerRunning, setProxyRunning, setProgressDownload, setDownloadSpeed } = useLauncherStore()
const { setProgressUpdate, setMaxProgressUpdate, setMessageUpdate } = useHdiffzStore()
const { setProgressUpdate, setMaxProgressUpdate, setMessageUpdate, setStageType } = useDiffStore()
useGlobalEvents({
setGameRunning,
setServerRunning,
@@ -21,6 +21,7 @@ function RootLayout() {
setProgressDownload,
setDownloadSpeed,
setMessageUpdate,
setStageType
});
return (
@@ -40,7 +41,7 @@ function RootLayout() {
<a>Tools</a>
<ul className="p-2">
<li><Link to="/language">Language</Link></li>
<li><Link to="/hdiffz">Hdiffz</Link></li>
<li><Link to="/diff">Diff</Link></li>
</ul>
</li>
<li>
@@ -77,7 +78,7 @@ function RootLayout() {
<summary>Tools</summary>
<ul className="p-2">
<li><Link to="/language">Language</Link></li>
<li><Link to="/hdiffz">Hdiffz</Link></li>
<li><Link to="/diff">Diff</Link></li>
</ul>
</details>
</li>

View File

@@ -0,0 +1,7 @@
import DiffPage from '@/pages/diff'
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/diff')({
component: DiffPage,
})

View File

@@ -1,7 +0,0 @@
import HdiffzPage from '@/pages/hdiffz'
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/hdiffz')({
component: HdiffzPage,
})

View File

@@ -1,7 +1,7 @@
import { create } from 'zustand'
interface LauncherState {
interface DiffState {
folderCheckResult: 'success' | 'error' | null,
isLoading: {game: boolean, diff: boolean},
diffDir: string,
@@ -22,7 +22,7 @@ interface LauncherState {
setStageType: (value: string) => void,
}
const useLauncherStore = create<LauncherState>((set, get) => ({
const useDiffStore = create<DiffState>((set, get) => ({
isLoading: {game: false, diff: false},
folderCheckResult: null,
diffDir: "",
@@ -43,4 +43,4 @@ const useLauncherStore = create<LauncherState>((set, get) => ({
setStageType: (value: string) => set({ stageType: value }),
}));
export default useLauncherStore;
export default useDiffStore;