feat: SodiumPet 小钠桌宠 v0.1.0(Live2D 桌宠 / 经济任务 / 音乐 / 成就 / 编辑器 / MOD)

This commit is contained in:
Tian_XiaRi
2026-12-01 16:41:07 +08:00
commit ba6bcaca98
270 changed files with 33676 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
const fs = require('fs')
const p = 'C:/Users/ASUS/Documents/deepseek-harness/default-workspace/desktop-pet/src/shared/media.ts'
const c = fs.readFileSync(p, 'utf8')
fs.writeFileSync(
p,
c.replace(
'export interface PhotoMeta {\n id: string\n file: string\n at: number\n favorite: boolean\n}',
'export interface PhotoMeta {\n id: string\n file: string\n at: number\n favorite: boolean\n category: string\n}'
),
'utf8'
)
const m = 'C:/Users/ASUS/Documents/deepseek-harness/default-workspace/desktop-pet/src/main/mediaStore.ts'
let mc = fs.readFileSync(m, 'utf8')
mc = mc.replace(
" const meta: PhotoMeta = { id: `${Date.now()}`, file, at: Date.now(), favorite: false }",
" const meta: PhotoMeta = { id: `${Date.now()}`, file, at: Date.now(), favorite: false, category: '默认' }"
)
mc = mc.replace(
` removePhoto(id: string): void {`,
` setCategory(id: string, category: string): void {
const p = this.photos.find((x) => x.id === id)
if (!p) return
p.category = category
this.save()
}
removePhoto(id: string): void {`
)
fs.writeFileSync(m, mc, 'utf8')
console.log('media store patched')