feat: NSIS 中文安装器(年糕历险记-Setup-v0.1.0.exe 实际构建+静默安装验证)、菜单鼠标可见性修复、首页 UI 原版复刻(土质背景/原版按钮/splash/版本角标)、全 goroutine 崩溃兜底

This commit is contained in:
NianGao Dev
2026-08-16 06:46:25 +08:00
parent 854440216f
commit 6dd5a8122a
434 changed files with 63991 additions and 106 deletions

View File

@@ -199,14 +199,15 @@ func (a *clientApp) Render() {
a.rend.DrawChunks(func(i int) (int32, int32) { return chunks[i].CX, chunks[i].CZ }, len(chunks))
// UI pass(UI与输入.md §2:3D 之后、状态隔离)
a.uiR.Begin()
mx, my := float32(a.in.cursorX), float32(a.in.cursorY)
switch a.screen {
case 0:
a.titleScreen.Draw(a.uiR)
a.titleScreen.Draw(a.uiR, mx, my)
case 1:
a.hud.Draw(a.uiR)
case 2:
a.hud.Draw(a.uiR) // 暂停时世界仍可见(UI还原.md §2)
a.pauseScreen.Draw(a.uiR)
a.pauseScreen.Draw(a.uiR, mx, my)
}
a.uiR.Flush()
a.rend.EndFrame()
@@ -223,7 +224,8 @@ func (a *clientApp) logf(format string, args ...any) {
}
func main() {
defer crash.Guard(paths.Join("logs", "crash.log")) // 崩溃兜底:闪退可诊断
crash.SetLogPath(paths.Join("logs", "crash.log")) // 全局崩溃日志(含 goroutine 兜底)
defer crash.Guard(paths.Join("logs", "crash.log")) // 主线程崩溃兜底:闪退可诊断
flag.Parse()
log, err := logx.New(paths.Join("logs", "client.log"), logx.LevelInfo)
@@ -331,7 +333,8 @@ func main() {
}
defer rend.Shutdown()
rend.SetAtlas(atlasImg)
rend.SetCursorMode(true)
// 主菜单状态:鼠标可见(仅游戏内捕获,UI与输入.md §6)
rend.SetCursorMode(false)
// 光影包(渲染.md §9:未安装 → 默认光影;坏包 → 回退默认)
if sp, err := render.LoadShaderPack(am); err != nil {
@@ -367,12 +370,12 @@ func main() {
hud.SetItemAtlas(itemTex, itemUV)
}
// 界面屏幕(中文标题「年糕历险记」+ 按钮,UI还原.md §2)
// 界面屏幕(原版复刻:土质背景/原版按钮/中文标题,UI还原.md §2)
lang, err := am.LoadLang(cfg.Client.Language)
if err != nil {
log.Warnf("语言加载失败: %v", err)
}
titleScreen, pauseScreen := buildScreens(uiR, lang)
titleScreen, pauseScreen := buildScreens(uiR, am, lang)
// 6) 输入(鼠标捕获 + 键鼠回调)
in := newInputState(rend.Window())