From 100c93e8da662c933548f9a067ebd8e28a918825 Mon Sep 17 00:00:00 2001 From: AzenKain Date: Sat, 4 Oct 2025 20:30:51 +0700 Subject: [PATCH] UPDATE: Update howto, fix bug bytes humman format --- frontend/src/main.tsx | 5 - frontend/src/pages/about/index.tsx | 2 +- frontend/src/pages/analysis/index.tsx | 4 +- .../pages/{srtools => fireflytools}/index.tsx | 27 +++-- frontend/src/pages/howto/index.tsx | 98 ++++++++++++++++--- frontend/src/routes/__root.tsx | 4 +- frontend/src/routes/srtools.tsx | 4 +- internal/git-service/util.go | 33 +++++-- pkg/constant/constant.go | 2 +- 9 files changed, 140 insertions(+), 39 deletions(-) rename frontend/src/pages/{srtools => fireflytools}/index.tsx (86%) diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 0b34da1..55c5522 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -4,20 +4,15 @@ import { RouterProvider, createRouter } from '@tanstack/react-router' import './styles/index.css' import "../runtime.js" import "@wailsio/runtime"; -// Import the generated route tree import { routeTree } from './routeTree.gen.js' -// Create a new router instance const router = createRouter({ routeTree }) - -// Register the router instance for type safety declare module '@tanstack/react-router' { interface Register { router: typeof router } } -// Render the app const rootElement = document.getElementById('root')! if (!rootElement.innerHTML) { const root = ReactDOM.createRoot(rootElement) diff --git a/frontend/src/pages/about/index.tsx b/frontend/src/pages/about/index.tsx index a4f5c47..f72f2a4 100644 --- a/frontend/src/pages/about/index.tsx +++ b/frontend/src/pages/about/index.tsx @@ -3,7 +3,7 @@ import { Link } from "@tanstack/react-router"; export default function AboutPage() { return (
-
+

About

diff --git a/frontend/src/pages/analysis/index.tsx b/frontend/src/pages/analysis/index.tsx index 68a6023..aba3721 100644 --- a/frontend/src/pages/analysis/index.tsx +++ b/frontend/src/pages/analysis/index.tsx @@ -3,7 +3,7 @@ import { Link } from '@tanstack/react-router'; export default function AnalysisPage() { return (
-
+

Firefly Analysis & Veritas Plugin

@@ -144,7 +144,7 @@ export default function AnalysisPage() {
1. -

Launch the game and your Firefly Private Server (PS).

+

Launch the game and your Firefly GO Server (PS).

2. diff --git a/frontend/src/pages/srtools/index.tsx b/frontend/src/pages/fireflytools/index.tsx similarity index 86% rename from frontend/src/pages/srtools/index.tsx rename to frontend/src/pages/fireflytools/index.tsx index 65453f6..adbbba0 100644 --- a/frontend/src/pages/srtools/index.tsx +++ b/frontend/src/pages/fireflytools/index.tsx @@ -1,23 +1,23 @@ import { Link } from "@tanstack/react-router"; -export default function SrToolsPage() { +export default function FireflyToolsPage() { return (
-
-

SR Tools

+
+

Firefly Tools

{/* Section 1: About SR Tools */}

โ„น๏ธ - About SR Tools + About Firefly Tools

๐Ÿ 

This site is a another version of {" "} - SR Tools {" "} + Firefly Tools {" "} developed by {" "} Me {"(Kain)"}

@@ -95,9 +95,24 @@ export default function SrToolsPage() {
๐Ÿ”Œ
-

Instantly apply setups to Firefly Private Server using Connect PS โ€” no manual file uploads required.

+

Instantly apply setups to Firefly GO Server using Connect PS โ€” no manual file uploads required.

+
โœจ
+
+

Extra Settings

+

+ Enhance your Firefly GO Server experience with extra features: +

+
    +
  • ๐ŸŽญ Hidden Game UI โ€” remove the entire game interface.
  • +
  • ๐Ÿšซ Disable Censorship โ€” get rid of Lens Flare censor ๐Ÿ’€.
  • +
  • ๐Ÿงช Theorycraft Mode โ€” configure HP, cycles, and more via the web.
  • +
+
+
+ +
๐Ÿ“‚

Export and import full builds using freesr-data.json.

diff --git a/frontend/src/pages/howto/index.tsx b/frontend/src/pages/howto/index.tsx index 4b8e93e..404e23b 100644 --- a/frontend/src/pages/howto/index.tsx +++ b/frontend/src/pages/howto/index.tsx @@ -3,7 +3,7 @@ import { Link } from '@tanstack/react-router'; export default function HowToPage() { return (
-
+

How to Use

{/* Section 1: Launcher Features */} @@ -28,12 +28,22 @@ export default function HowToPage() {

-
๐Ÿ“ฆ
-

Patch and update game files using{" "} - Hdiffz Tool - {" "}(HDiffPatch) โ€” fast & lightweight incremental updates. -

+
๐Ÿ“ฆ
+
+

+ Patch & Update Game Files +

+

+ Use the{" "} + Diff Tool{" "} + (DiffPatch) for fast & lightweight incremental updates. +

+

+ Supports Hdiff, Ldiff, and custom diff formats. +

+
+
@@ -65,8 +75,60 @@ export default function HowToPage() {
+
+
+
โœจ
+
+

Extra Settings

+ +
+ +
+
+ ๐ŸŽญ Hidden UI +
+

+ Instantly hides the entire game UI โ€” often used in DIM showcase videos. +

+
+ + +
+
+ ๐Ÿšซ Disable Censorship +
+

+ Remove the Lens Flare censor effect ๐Ÿ’€ for a cleaner experience. +

+
+ +
+
+ ๐Ÿงช Theorycraft Mode +
+

+ No need to type chat commands anymore โ€” configure everything through the + web: adjust monster HP, set cycles, view logs, and more. +

+
+
+ + +
+ +
+
+
+
+ {/* Commands List */} -
+

Available Commands:

{/* Theorycraft Toggle */} @@ -103,16 +165,28 @@ export default function HowToPage() {
โค๏ธ
-

HP Override (Theorycraft only)

-
-

/hp WAVE HP โ€” Set monster HP for a specific wave

-

Example: /hp 1 2000000 sets Wave 1 monster HP to 2,000,000

-

/hp 0 disables HP override

+

+ HP Override (Theorycraft only) +

+
+

+ /hp N โ€” Set monster HP (only available in Theorycraft mode) +

+

+ /hp 0 โ€” Disable the set HP feature +

+

+ /hp Wave V1 V2 ... โ€” Set HP for each monster in a specific wave +

+

+ Example: /hp 1 2000000 3000000 sets wave 1 monster1 HP=2,000,000 and monster2 HP=3,000,000 +

+ {/* Log Command */}
diff --git a/frontend/src/routes/__root.tsx b/frontend/src/routes/__root.tsx index 6607242..4bae673 100644 --- a/frontend/src/routes/__root.tsx +++ b/frontend/src/routes/__root.tsx @@ -71,7 +71,7 @@ function RootLayout() {
-
    +
    • Home
    • @@ -87,7 +87,7 @@ function RootLayout() { Plugins
      • Analysis (Veritas)
      • -
      • SrTools
      • +
      • Firefly Tools
    • diff --git a/frontend/src/routes/srtools.tsx b/frontend/src/routes/srtools.tsx index d95a227..1980029 100644 --- a/frontend/src/routes/srtools.tsx +++ b/frontend/src/routes/srtools.tsx @@ -1,8 +1,8 @@ -import SrToolsPage from '@/pages/srtools' +import FireflyToolsPage from '@/pages/fireflytools' import { createFileRoute } from '@tanstack/react-router' export const Route = createFileRoute('/srtools')({ - component: SrToolsPage, + component: FireflyToolsPage, }) diff --git a/internal/git-service/util.go b/internal/git-service/util.go index bceb5f2..2d47d93 100644 --- a/internal/git-service/util.go +++ b/internal/git-service/util.go @@ -13,16 +13,34 @@ import ( "runtime" "sync" "time" + ) func HumanFormat(bytes float64) string { - for _, unit := range []string{"", "Ki", "Mi", "Gi"} { - if math.Abs(bytes) < 1024.0 { - return fmt.Sprintf("%3.1f%sB", bytes, unit) - } - bytes /= 1024.0 + if math.IsNaN(bytes) || math.IsInf(bytes, 0) { + return fmt.Sprintf("%v", bytes) } - return fmt.Sprintf("%.1fTiB", bytes) + if bytes == 0 { + return "0B" + } + + neg := bytes < 0 + if neg { + bytes = -bytes + } + + units := []string{"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB"} + i := 0 + for bytes >= 1024 && i < len(units)-1 { + bytes /= 1024 + i++ + } + + res := fmt.Sprintf("%.1f%s", bytes, units[i]) + if neg { + res = "-" + res + } + return res } type WriteCounter struct { @@ -53,14 +71,13 @@ func (wc *WriteCounter) PrintProgress() { if elapsed < 0.001 { elapsed = 0.001 } - speed := float64(wc.Total) / 1024 / 1024 / elapsed + speed := float64(wc.Total) / elapsed percent := float64(wc.Total) / float64(wc.TotalSize) * 100 if wc.OnEmit != nil { wc.OnEmit(percent, fmt.Sprintf("%s/s", HumanFormat(speed))) } } -// --- DownloadFileParallel --- func (g *GitService) downloadFileParallel(filePath, url string, numParts int, onEmit func(percent float64, speed string)) (tmpPath string, err error) { resp, err := http.Head(url) if err != nil { diff --git a/pkg/constant/constant.go b/pkg/constant/constant.go index af1eb3b..54e4f4b 100644 --- a/pkg/constant/constant.go +++ b/pkg/constant/constant.go @@ -10,7 +10,7 @@ const ProxyZipFile = "64bit.zip" const LauncherFile = "firefly-launcher.exe" const TempUrl = "./temp" -const CurrentLauncherVersion = "1.8.0" +const CurrentLauncherVersion = "1.9.0" type ToolFile string