diff --git a/apps/app-frontend/src/components/home/HomeLaunchProgress.vue b/apps/app-frontend/src/components/home/HomeLaunchProgress.vue new file mode 100644 index 0000000..b160f55 --- /dev/null +++ b/apps/app-frontend/src/components/home/HomeLaunchProgress.vue @@ -0,0 +1,108 @@ + + + + diff --git a/apps/app-frontend/src/data/about/contributors.json b/apps/app-frontend/src/data/about/contributors.json index 29eca5d..6086292 100644 --- a/apps/app-frontend/src/data/about/contributors.json +++ b/apps/app-frontend/src/data/about/contributors.json @@ -21,7 +21,7 @@ "name": "CodeZhangBorui", "avatarUrl": "https://avatars.githubusercontent.com/u/61909157?v=4&s=96", "url": "https://github.com/CodeZhangBorui", - "contributions": 444 + "contributions": 446 }, { "name": "IMB11", diff --git a/apps/app-frontend/src/pages/Index.vue b/apps/app-frontend/src/pages/Index.vue index 23137ec..5594d88 100644 --- a/apps/app-frontend/src/pages/Index.vue +++ b/apps/app-frontend/src/pages/Index.vue @@ -30,6 +30,7 @@ import HomeDashboard from '@/components/home/HomeDashboard.vue' import HomeInstancePickerModal from '@/components/home/HomeInstancePickerModal.vue' import HomeMinecraftNews from '@/components/home/HomeMinecraftNews.vue' import HomeMinimal from '@/components/home/HomeMinimal.vue' +import HomeLaunchProgress from '@/components/home/HomeLaunchProgress.vue' import HomePlayInsights from '@/components/home/HomePlayInsights.vue' import { useNetworkStatus } from '@/composables/useNetworkStatus' import { get_default_user, users } from '@/helpers/auth' @@ -378,6 +379,7 @@ onUnmounted(() => { class="flex min-w-0 flex-col slide-enter-active" :class="{ 'slide-enter-from': !animateSidebarShow }" > + diff --git a/tools/icon_work/check_exe_icon.py b/tools/icon_work/check_exe_icon.py new file mode 100644 index 0000000..bd8e2c9 --- /dev/null +++ b/tools/icon_work/check_exe_icon.py @@ -0,0 +1,8 @@ + +p = r"D:\Project\Starlight_Lancher\target\release\Starlight Launcher.exe" +data = open(p, "rb").read() +print("exe 大小:", len(data)) +print("内嵌 PNG 数量(粗估):", data.count(b"\x89PNG\r\n\x1a\n")) +ico = open(r"D:\Project\Starlight_Lancher\apps\app\icons\icon.ico", "rb").read() +print("icon.ico 大小:", len(ico)) +print("icon.ico 原样出现在 exe:", ico in data) diff --git a/tools/icon_work/extract_ico.py b/tools/icon_work/extract_ico.py new file mode 100644 index 0000000..a7b1bc5 --- /dev/null +++ b/tools/icon_work/extract_ico.py @@ -0,0 +1,42 @@ + +import struct + +p = r"D:\Project\Starlight_Lancher\target\release\Starlight Launcher.exe" +data = open(p, "rb").read() + +# 粗解析 PE,找 .rsrc 段的 RT_GROUP_ICON 和 RT_ICON +# 简化:直接找所有 PNG(现代 ico 用 png 存大图)和 BMP(ico用) +# 提取第一个 PNG 看尺寸 +import io +PNG_SIG = b"\x89PNG\r\n\x1a\n" +results = [] +idx = 0 +while True: + i = data.find(PNG_SIG, idx) + if i < 0: + break + # PNG IHDR: 宽高在 sig 后 16 字节起 (8 sig + 4 len + 4 'IHDR' = 16) + try: + w = struct.unpack(">I", data[i+16:i+20])[0] + h = struct.unpack(">I", data[i+20:i+24])[0] + if 8 <= w <= 1024 and 8 <= h <= 1024: + results.append((i, w, h)) + except Exception: + pass + idx = i + 8 + +print("找到疑似图标 PNG (offset,w,h) 前 30 个:") +for r in results[:30]: + print(r) + +# 对比:icon.ico 里各图像尺寸 +ico = open(r"D:\Project\Starlight_Lancher\apps\app\icons\icon.ico", "rb").read() +n = struct.unpack("', + '\t', +) + +# 2) 删空态

...

+import re +t = re.sub( + r'\t\t

]*>\n\t\t\t\{\{ formatMessage\(messages\.empty\) \}\}\n\t\t

\n', + "", + t, +) + +# 3)
      +t = t.replace('
        ', '
          ') + +open(p, "w", encoding="utf-8", newline="\n").write(t) +print("done") +print("--- 78-95 ---") +for i, line in enumerate(t.split("\n")[77:95], 78): + print(f"{i}: {line}") diff --git a/tools/icon_work/icon_test_copy.exe b/tools/icon_work/icon_test_copy.exe new file mode 100644 index 0000000..d515123 Binary files /dev/null and b/tools/icon_work/icon_test_copy.exe differ diff --git a/tools/icon_work/read_emit.py b/tools/icon_work/read_emit.py new file mode 100644 index 0000000..c656f04 --- /dev/null +++ b/tools/icon_work/read_emit.py @@ -0,0 +1,6 @@ + +import glob +for f in glob.glob("packages/app-lib/src/event/*.rs"): + print("=== " + f + " ===") + print(open(f, encoding="utf-8").read()[:4000]) + print() diff --git a/tools/icon_work/scan_launch.py b/tools/icon_work/scan_launch.py new file mode 100644 index 0000000..d4704f4 --- /dev/null +++ b/tools/icon_work/scan_launch.py @@ -0,0 +1,5 @@ + +l = open("packages/app-lib/src/launcher/mod.rs", encoding="utf-8").read().split("\n") +for i, line in enumerate(l): + if "init_loading" in line or "emit_loading" in line or "MinecraftDownload" in line or "InstanceUpdate" in line: + print(f"{i+1}: {line.strip()}") diff --git a/tools/icon_work/wire_lp.py b/tools/icon_work/wire_lp.py new file mode 100644 index 0000000..38715be --- /dev/null +++ b/tools/icon_work/wire_lp.py @@ -0,0 +1,29 @@ + +p = r"D:\Project\Starlight_Lancher\apps\app-frontend\src\pages\Index.vue" +lines = open(p, encoding="utf-8").read().split("\n") + +# 1) import:在 HomePlayInsights import 行后加一行 +imp_i = None +for i, ln in enumerate(lines): + if "import HomePlayInsights from '@/components/home/HomePlayInsights.vue'" in ln: + imp_i = i + break +assert imp_i is not None, "找不到 HomePlayInsights import" +lines.insert(imp_i, "import HomeLaunchProgress from '@/components/home/HomeLaunchProgress.vue'") + +# 2) 模板:在 前插入 +tpl_i = None +for i, ln in enumerate(lines): + if ln.strip() == "": + tpl_i = i + break +assert tpl_i is not None, "找不到 " +lines.insert(tpl_i, "\t\t\t") + +open(p, "w", encoding="utf-8", newline="\n").write("\n".join(lines)) +print("done") +for i in range(imp_i - 1, imp_i + 2): + print(f"{i+1}: {lines[i]}") +print("...") +for i in range(tpl_i - 2, tpl_i + 3): + print(f"{i+1}: {lines[i]}")