v0.1.1: 养成闭环 + 管理自主 + 存档安全

- 指婚/续弦:成员详情可主动找人结亲(血亲自动排除、鳏寡可再醮)
- 装备 UI:法宝从府库装备/替换,战力实时反馈
- 御敌点将:劫掠事件可自选迎战阵容(默认 Top4 可改)
- 宗祠祭祖:每两年一次,灵石150 → 声望+6/全族修为小升
- 回档时间轴:每季快照列表,一键回卷(回卷前自动保当前档)
- 战报匣子:史书页全文战报留存可翻阅
- 年度族簿纸笺:每年初弹收支/人丁/战力简报
- 媒人提示条 + 寻衅一年冷却 + 出生率与劫掠频率微调
- 单测 19→29(storage mock roundtrip/回档/指婚血亲/祭祖/寻衅/装备/账本)
This commit is contained in:
2026-08-23 08:16:40 +08:00
parent 4bacbd432e
commit 6b15a97d0c
24 changed files with 734 additions and 26 deletions
+22 -1
View File
@@ -1,6 +1,6 @@
import { app, BrowserWindow, ipcMain, dialog, shell, protocol, net } from 'electron'
import { join, normalize, sep } from 'path'
import { readFileSync, writeFileSync } from 'fs'
import { readFileSync, writeFileSync, existsSync } from 'fs'
import { pathToFileURL } from 'url'
const SCHEME = 'app'
@@ -47,6 +47,15 @@ function createWindow(): void {
if (process.env.SMOKE_TEST) {
const wc = mainWindow.webContents
setTimeout(async () => {
try {
const url = wc.getURL()
const title = await wc.executeJavaScript('document.title').catch((e: Error) => 'ERR:' + e.message)
console.log(`[PROBE] url=${url} title=${title}`)
} catch (e) {
console.log('[PROBE] failed', String(e))
}
}, 8000)
const shotsDir = process.env.SMOKE_SHOTS_DIR
wc.on('console-message', (_e, level, message) => {
console.log(`[renderer:${level}] ${message}`)
@@ -156,7 +165,19 @@ function serveAppProtocol(): void {
})
}
function displayProbe(): boolean {
if (process.platform !== 'linux') return true
const waylandOk = !!process.env.WAYLAND_DISPLAY && existsSync('/run/user/1000')
const x11Ok = !!process.env.DISPLAY && existsSync('/tmp/.X11-unix/X0')
return waylandOk || x11Ok
}
app.whenReady().then(() => {
if (process.env.SMOKE_TEST && !displayProbe()) {
console.log('[SMOKE-NO-DISPLAY] skip GUI smoke (WSLg/X11 not reachable)')
app.exit(2)
return
}
serveAppProtocol()
createWindow()
app.on('activate', () => {