重构崩溃分析系统
任务列表:
- [x] 游戏崩溃分析系统
-
- [x] 提供 UI 界面
-
- [x] 支持分析常见环境、Java、模组版本、模组加载器等问题,并做到一键解决 会继续添加新的规则
- [ ] ~~HMCL 弹窗错误界面:给出解决方案~~
- [ ] ~~Forge Installer 错误:给出解决方案~~
- [ ] ~~OptiFine Installer 错误:给出解决方案~~ 将推迟到独立 PR 中
架构说明:
-
net.burningtnt.hmat.Analyzer: 一个分析器,只对应一种可能的问题。analyze(T, java.util.List<net.burningtnt.hmat.AnalyzeResult<T>>):返回分析结果的状态。-
BREAK_OTHER:解决方案将大幅改变整个日志,将覆盖其他分析器 -
CONTINUE:一般问题
-
-
Solver: 包括当前的问题 ID,分析器和自动解决方案-
configure,SolverConfigurator:管理用户 UI 界面,用于分离逻辑层和 UI 层- 手动操作:
setDescription,setImage,putButton分别用于展示文本、图片说明和选择按钮 - 自动操作:
bindTask注册一个Task
需要注意的是,同一个
Solver必须只能使用手动操作或自动操作。混合调用会导致报错。 如果需要在Solver间切换,可调用transferTo。可传入一个新的 Solver,或转入 null 表明该步骤已完成。 - 手动操作:
-
callbackSelection:用户操作回调。selectionID 可能是 BTN_NEXT,或putButton的返回值
-
征集崩溃系统 UI 设计
要求:
- 提示游戏异常退出
- 给出一个按钮,展现自动分析。点击后出现进度条。走完后出现一个列表,每一项都是一个问题 + 解决方案。列表需要有地方放 Icon,标识这是一个可以自动解决的问题 / 需要手动操作。列表同时需要一个按钮,点击后开始解决流程。
- 手动解决的问题需要两种界面:图文的说明 + “已完成”按钮 和 图文的说明 + 多个选项。
解释:手动解决问题界面做成这个样子是希望避免用户读句子不读完整。所以我们把步骤拆开。比如,如果要改虚拟内存,那么每个操作都是独立的。用户只有操作完上一个,点了“已完成”,才会展示下一个操作。 而多个选项是在不能确定情况时,询问用户“你这里是什么情况”
https://github.com/HMCL-dev/HMCL/assets/64117916/7744682f-ded7-4546-802e-73c3f70b8668
或许可以参考这个 UI?
框架已搭建完毕
git log feature/log-analyzer...glavo/java-manager --pretty=tformat: --numstat | perl -ane' $i += $F[0]; $d += $F[1]; $s = $i + $d; END{ print "added: $i removed: $d sum: $s\n"}'
I have not tested it in detail yet, but I just took a quick look at the Files changed section and said one thing.
This PR adds 4 pictures and displays them when needed. Everything else is good, but there is only simplified Chinese.
If the user uses traditional Chinese, it does not matter; but if the user does not understand Chinese, it may be confusing.
Consider showing screenshots of Windows windows in the appropriate language based on the user’s language? I personally think at least English screenshots are needed as a fallback.
If pictures are needed I can assist.
Yes, I partly agree with you. Providing images for different languages is essential. We are considering putting these files in a zip and publishing this zip on a Maven. Give us some time.
这个 pr 目前的状态是啥
有生之年系列
这个 PR 完成了吗?
将放弃该功能