change:换了背景图,去掉了固定服务器里写的sls
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:
2026-09-13 15:20:25 +08:00
parent 6fa9461d2d
commit 3cf55130a7
10 changed files with 216 additions and 87 deletions

View File

@ -0,0 +1,20 @@
p = r"D:\Project\Starlight_Lancher\apps\app-frontend\src\components\ui\AboutScene.vue"
t = open(p, encoding="utf-8").read()
old = "\tlet updateGLTF = (_deltaTime: number, _elapsedTime: number) => {}"
new = """\t// 静止的下界之星(替换原动态美西螈)
\tconst starTexture = new THREE.TextureLoader().load('/models/netherstar.png')
\tstarTexture.colorSpace = THREE.SRGBColorSpace
\tconst starMaterial = new THREE.SpriteMaterial({ map: starTexture, transparent: true })
\tconst starSprite = new THREE.Sprite(starMaterial)
\tstarSprite.scale.set(8, 8, 1)
\tstarSprite.position.set(0, -2.5, 0)
\tscene.add(starSprite)
\tlet updateGLTF = (_deltaTime: number, _elapsedTime: number) => {}"""
assert old in t, "找不到 updateGLTF 空行"
t = t.replace(old, new, 1)
open(p, "w", encoding="utf-8", newline="\n").write(t)
print("done")

View File

@ -0,0 +1,32 @@
p = r"D:\Project\Starlight_Lancher\apps\app-frontend\src\components\ui\AboutScene.vue"
t = open(p, encoding="utf-8").read()
# 1) 删 import 行
old_imp = "import { type GLTF, GLTFLoader } from 'three/examples/jsm/Addons.js'\n"
assert old_imp in t, "import 行找不到"
t = t.replace(old_imp, "", 1)
# 2) 删 loadGLTF 函数(含前后空行)
old_fn = """function loadGLTF(url: string): Promise<GLTF> {
return new Promise((res, rej) => {
const loader = new GLTFLoader()
loader.load(
url,
(data) => {
res(data)
},
undefined,
rej,
)
})
}
"""
assert old_fn in t, "loadGLTF 函数找不到"
t = t.replace(old_fn, "", 1)
open(p, "w", encoding="utf-8", newline="\n").write(t)
print("done")
print("残留 GLTFLoader:", "GLTFLoader" in t)
print("残留 loadGLTF:", "loadGLTF" in t)

View File

@ -0,0 +1,72 @@
p = r"D:\Project\Starlight_Lancher\apps\app-frontend\src\components\home\HomePinnedServers.vue"
t = open(p, encoding="utf-8").read()
# 1) servers computed 简化为"只返回收藏服务器"
old_servers = """const servers = computed(() => {
const favoriteServers = favoriteWorlds.value.flatMap((world) => {
if (world.type !== 'server' || world.address === PROTECTED_SERVER_ADDRESS) return []
const instance = instanceById.value.get(world.instance_id)
return instance ? [{ instance, world: world as ServerWorld & WorldWithInstance }] : []
})
const protectedInstance =
props.instances.find((instance) => instance.install_stage === 'installed') ?? props.instances[0]
if (!protectedInstance) return favoriteServers
const protectedServer: ServerWorld & WorldWithInstance = {
instance_id: protectedInstance.id,
name: formatMessage(messages.protectedServerName),
last_played: undefined,
icon: undefined,
display_status: 'favorite',
type: 'server',
index: -1,
address: PROTECTED_SERVER_ADDRESS,
pack_status: 'prompt',
}
return [{ instance: protectedInstance, world: protectedServer }, ...favoriteServers]
})"""
new_servers = """const servers = computed(() =>
favoriteWorlds.value.flatMap((world) => {
if (world.type !== 'server') return []
const instance = instanceById.value.get(world.instance_id)
return instance ? [{ instance, world: world as ServerWorld & WorldWithInstance }] : []
}),
)"""
assert old_servers in t, "servers computed 找不到"
t = t.replace(old_servers, new_servers, 1)
# 2) 删 protectedServerName message
old_msg = """ protectedServerName: {
id: 'app.home.servers.protected-name',
defaultMessage: 'Starlight Server',
},
"""
assert old_msg in t, "protectedServerName message 找不到"
t = t.replace(old_msg, "", 1)
# 3) import 去掉 PROTECTED_SERVER_ADDRESS
t = t.replace("\tPROTECTED_SERVER_ADDRESS,\n", "", 1)
# 4) 模板:去掉 v-if让所有服务器都能取消固定
t = t.replace(
""" <ButtonStyled
v-if="server.world.address !== PROTECTED_SERVER_ADDRESS"
circular
size="small"
type="transparent"
class="home-server-menu"
>""",
""" <ButtonStyled
circular
size="small"
type="transparent"
class="home-server-menu"
>""",
1,
)
open(p, "w", encoding="utf-8", newline="\n").write(t)
print("HomePinnedServers done")
print(" 残留 PROTECTED:", "PROTECTED" in t)
print(" 残留 protectedServerName:", "protectedServerName" in t)

View File

@ -0,0 +1,26 @@
p = r"D:\Project\Starlight_Lancher\apps\app-frontend\src\components\ui\world\WorldItem.vue"
t = open(p, encoding="utf-8").read()
# 1) 删 protectedServer 定义
old_def = """const protectedServer = computed(
() => props.world.type === 'server' && props.world.address === PROTECTED_SERVER_ADDRESS,
)
"""
assert old_def in t, "protectedServer 定义找不到"
t = t.replace(old_def, "", 1)
# 2) import 去掉 PROTECTED_SERVER_ADDRESS
t = t.replace("\tPROTECTED_SERVER_ADDRESS,\n", "", 1)
# 3) 逻辑里去掉 protectedServer
t = t.replace("shown: !instanceId && !protectedServer,", "shown: !instanceId,", 1) # edit
t = t.replace("disabled: locked || managed || protectedServer,", "disabled: locked || managed,", 1) # edit
t = t.replace("shown: !!homePinTarget && !protectedServer,", "shown: !!homePinTarget,", 1) # pin
t = t.replace("shown: !instanceId && !protectedServer,", "shown: !instanceId,", 1) # delete
t = t.replace("disabled: locked || managed || protectedServer,", "disabled: locked || managed,", 1) # delete
open(p, "w", encoding="utf-8", newline="\n").write(t)
print("WorldItem done")
print(" 残留 protectedServer:", "protectedServer" in t)
print(" 残留 PROTECTED_SERVER:", "PROTECTED_SERVER" in t)

View File

@ -0,0 +1,48 @@
p = r"D:\Project\Starlight_Lancher\apps\app-frontend\src\components\ui\AboutScene.vue"
t = open(p, encoding="utf-8").read()
old = """ async function load() {
const axlGLTF = await loadGLTF('/models/axolotl.gltf')
const axlModel = axlGLTF.scene
axlModel.scale.multiplyScalar(5)
axlModel.rotateY(Math.PI / 2)
axlModel.position.add(new THREE.Vector3(0, -2.5, 0))
scene.add(axlModel)
const mixer = new THREE.AnimationMixer(axlModel)
const axlSwimAnim = axlGLTF.animations.filter((a) => a.name === 'swim')[0]
if (!axlSwimAnim) return console.error('Missing animation swim')
mixer.clipAction(axlSwimAnim).play()
// // Axl Label
// const axlLabelGLTF = await loadGLTF('/models/axl_label.glb')
// const axlLabel = axlLabelGLTF.scene
// axlLabel.scale.multiplyScalar(8)
// axlLabel.rotateY(-Math.PI / 2)
// axlLabel.position.set(0, 5.2, 0)
// scene.add(axlLabel)
const originAxlModelPosition = axlModel.position.clone()
return function (deltaTime: number, elapsedTime: number) {
axlModel.position.set(
originAxlModelPosition.x,
originAxlModelPosition.y + Math.sin(elapsedTime),
originAxlModelPosition.z,
)
axlModel.rotation.y = Math.sin(elapsedTime * 0.3) * 0.2 + (Math.PI * 100) / 180
mixer.update(deltaTime)
}
}
let updateGLTF = (_deltaTime: number, _elapsedTime: number) => {}
load().then((updateFn) => {
if (updateFn) updateGLTF = updateFn
})"""
new = """ let updateGLTF = (_deltaTime: number, _elapsedTime: number) => {}"""
assert old in t, "找不到美西螈加载块"
t = t.replace(old, new, 1)
open(p, "w", encoding="utf-8", newline="\n").write(t)
print("done")