feat:游戏启动自动置顶+聚焦
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
This commit is contained in:
28
tools/icon_work/fix_fg.py
Normal file
28
tools/icon_work/fix_fg.py
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
p = r"D:\Project\Starlight_Lancher\apps\app\src\lightweight_mode.rs"
|
||||
t = open(p, encoding="utf-8").read()
|
||||
|
||||
# 1) import 加 SetForegroundWindow
|
||||
old_import = """ use windows::Win32::UI::WindowsAndMessaging::{
|
||||
GetWindowThreadProcessId, IsWindowVisible, SW_MAXIMIZE, ShowWindow,
|
||||
};"""
|
||||
new_import = """ use windows::Win32::UI::WindowsAndMessaging::{
|
||||
GetWindowThreadProcessId, IsWindowVisible, SW_MAXIMIZE, SetForegroundWindow, ShowWindow,
|
||||
};"""
|
||||
assert old_import in t, "找不到 import 块"
|
||||
t = t.replace(old_import, new_import, 1)
|
||||
|
||||
# 2) 最大化前先聚焦到前台
|
||||
old_show = " let _ = unsafe { ShowWindow(hwnd, SW_MAXIMIZE) };"
|
||||
new_show = (
|
||||
" let _ = unsafe { SetForegroundWindow(hwnd) };\n"
|
||||
" let _ = unsafe { ShowWindow(hwnd, SW_MAXIMIZE) };"
|
||||
)
|
||||
assert old_show in t, "找不到 ShowWindow 行"
|
||||
t = t.replace(old_show, new_show, 1)
|
||||
|
||||
open(p, "w", encoding="utf-8", newline="\n").write(t)
|
||||
print("done")
|
||||
l = t.split("\n")
|
||||
for i in range(354, 372):
|
||||
print(f"{i+1}: {l[i]}")
|
||||
22
tools/icon_work/fix_pkg.py
Normal file
22
tools/icon_work/fix_pkg.py
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
p = r"D:\Project\Starlight_Lancher\apps\app-frontend\package.json"
|
||||
t = open(p, encoding="utf-8").read()
|
||||
|
||||
# 1) build 去掉 contributors:sync
|
||||
t = t.replace(
|
||||
'"build": "pnpm contributors:sync && vue-tsc --noEmit && vite build",',
|
||||
'"build": "vue-tsc --noEmit && vite build",',
|
||||
)
|
||||
# 2) 删除 contributors:sync 那一行
|
||||
t = t.replace(
|
||||
'\t\t"contributors:sync": "node ../../scripts/axolotl/sync-contributors.mjs",\n',
|
||||
"",
|
||||
)
|
||||
open(p, "w", encoding="utf-8", newline="\n").write(t)
|
||||
|
||||
import json
|
||||
json.load(open(p, encoding="utf-8")) # 校验合法
|
||||
print("done")
|
||||
l = t.split("\n")
|
||||
for i in range(5, 13):
|
||||
print(f"{i+1}: {l[i]}")
|
||||
Reference in New Issue
Block a user