Skip to content

1.3.4.7

Latest

Choose a tag to compare

@ShirosakiMio ShirosakiMio released this 17 Nov 02:24
· 2 commits to main since this release

中文

✨ 新功能

  1. 按键编辑撤销/恢复 (#1991):编辑模式左抽屉底部新增固定操作区(menu_left.xml 的 edit_history_bar,列表改为 weight=1,操作区在列表之外不随滚动),撤销/恢复按钮在对应栈为空时半透明置灰禁用。历史由 ViewManager 新增持有的 EditHistory(Kotlin 类)维护,按控件组做整组快照、撤销/恢复两栈,最多保留 30 条;每次控件级编辑(增删控件、拖动/缩放写回数据、跨组复制或移动、样式修改)在守卫通过后、改数据前记录受影响组的当前状态。快照不持有 ControlButtonData/ControlDirectionData 实例,只保存 id、文字、样式引用、位置尺寸与事件的拷贝,回放时重新构造数据实例——数据实例会在样式对象上注册监听,快照复用实例会让被丢弃的数据被样式对象长期引用;也不走 clone()(clone 会重新生成 id 且深拷贝 style,快照需保留 id 并保持 style 为共享引用)。跨组移动作为单条历史同时记录来源组与目标组,内部增删不各自记录,否则撤销一次会落在「两边都没有该控件」的中间态。撤销/恢复后按组用改动前的视图 id 集合(ViewManager.collectGroupViewIds 捕获)摘除并重渲染受影响视图,摘除范围取改动前 ∪ 改动后的 id 并集(撤销「添加/复制」时新增控件 id 已不在现数据里,仅按现数据圈定会漏摘);不在当前渲染目标中的组(隐藏参考组等)只恢复数据,待下次渲染生效。控件组被删除或切换控制器(controllerProperty 监听)后引用失效的条目在撤销/恢复时自动跳过,切换控制器直接清空历史。删除控件与整表替换前调用 ControlButtonData/ControlDirectionData 新增的 detachStyleListener() 断开样式监听;控件组删除确认文案补充「此操作无法撤销」。

🐛 修复

  1. 编辑已保存的按键/方向样式时崩溃 (#2018):AddButtonStyleDialog / AddDirectionStyleDialog 的草稿样式 name 属性(方向样式还包括内部 buttonStyle / rockerStyle)在对话框内绑定到了输入控件,确认时却把同一个对象直接交给样式注册表,注册表中保存的就是绑定对象;之后编辑该样式时 setAll 写入绑定属性会抛 A bound value cannot be set 而崩溃。现确认时回调 style.clone() 的副本,绑定不再随对象泄漏到数据层。
  2. 超大 pack.png 资源包图标导致启动器崩溃 (#2015):pack.png 的尺寸不受游戏约束,此前 BitmapFactory.decodeByteArray 按原尺寸解码,超大图标会产生数百 MB 的位图,资源包列表绘制时报 Canvas: trying to draw too large 直接崩溃。现 ResourcePack.kt 新增 decodeIcon:先以 inJustDecodeBounds 读出尺寸边界,再按 2 的幂 inSampleSize 降采样到不超过 160px(列表图标 40dp 按 4x 屏换算)后解码,尺寸边界无效时返回 null。
  3. 主题色透明度为 0 时进度条、滑条等状态控件不可见 (#2016):主题派生色 dkColor / ltColor 会随 colorAlpha 一起透明,透明度调到 0 时进度条与滑条不可见(进度与滑块 tint 用 dkColor),动态岛轮廓、输入框背景选中态、数字滑条的加减按钮与填充段同样消失。现 FCLProgressBar、FCLSeekBar、FCLDynamicIsland、FCLEditText、FCLNumberSeekBar 均改用不受透明度设置影响的 opaqueDkColor;并新增 ThemeDataTest.opaqueColorsIgnoreAlphaSetting 回归测试,固定 alpha=0 时 dkColor / ltColor 全透明而 opaqueColor / opaqueDkColor / opaqueLtColor 仍为不透明。
  4. 自定义驱动缺失时 Vulkan 检测误报已加载:自定义驱动由 liblinkerhook 在首次 vkCreateInstance 时才拦截系统 libvulkan 装载,检测侧此前仅以「加载器句柄可用」判定自定义驱动生效,驱动缺失(驱动命名空间创建失败、DRIVER_LIB 不存在等)时仍会误报。现 hook.c 新增 driverLoadState(0 未尝试 / 1 成功 / 2 失败)并经 fcl_linkerhook_driver_state 导出,vulkan_checker 通过 dlsym 读取,新增 resolve_custom_driver 统一判定实际生效的驱动:hook 失效或驱动加载失败时按系统加载器处理并输出带原因的警告日志,vkCreateInstance 失败路径同样输出真实驱动信息;同时修正 driverNs 为空时直接调用 linker_ns_dlopen 的空指针风险。
  5. 整合包描述对话框换行符不生效:RemoteModpackPage / LocalModpackPage 一律以 Html.fromHtml 解析整合包描述,纯文本描述中的换行符被当作空白吞掉,整段描述挤成一行。现 ModpackPage 新增 formatDescription:先把 \r\n / \r 统一为 \n,描述含 HTML 标签时按原样解析,纯文本则把换行转成
    再解析。

English

✨ New Features

  1. Undo/redo for control editing (#1991): The left drawer in edit mode gained a fixed action bar at the bottom (edit_history_bar in menu_left.xml; the list is switched to weight=1 so the bar stays outside the scrolling list), with undo and redo buttons that are dimmed and disabled when the corresponding stack is empty. History is kept by a new EditHistory Kotlin class owned by ViewManager: whole control-group snapshots in undo and redo stacks, capped at 30 entries; every control-level edit (adding/removing controls, dragging or resizing written back to the data, cross-group copy or move, style changes) records the affected groups' current state after the guard passes and before the data is modified. Snapshots do not hold ControlButtonData/ControlDirectionData instances — only the id, text, style reference, position/size and event copies — and data instances are rebuilt on replay: data instances register listeners on style objects, so reusing an instance in a snapshot would make style objects keep referencing discarded data; clone() is not used either (it regenerates the id and deep-copies the style, while snapshots must keep the id and share the style reference). A cross-group move is recorded as a single history entry covering both the source and target groups, with the inner add/remove not recorded separately, otherwise one undo would land in the intermediate state where the control is in neither group. After undo/redo the affected views are detached and re-rendered per group using the view-id set captured before the change by ViewManager.collectGroupViewIds, taking the union of the ids before and after the change (when undoing an "add/copy", the new control's id is no longer in the current data, so scoping by the current data alone would leave its view behind); groups that are not in the current render targets (such as hidden reference groups) only have their data restored and take effect on the next render. Entries whose references went stale because the group was deleted or the controller was switched are skipped automatically during undo/redo, and switching controllers (controllerProperty listener) clears the history outright. ControlButtonData/ControlDirectionData gained detachStyleListener(), called before a control is removed or the data table is replaced; the control-group deletion confirmation now also notes that the operation cannot be undone.

🐛 Bug Fixes

  1. Crash when editing saved button or direction styles (#2018): The draft style's name property (plus the inner buttonStyle / rockerStyle for direction styles) in AddButtonStyleDialog / AddDirectionStyleDialog is bound to the dialog's input controls, but confirming handed the very same object to the style registry, so the registry stored the bound object; editing that style afterwards made setAll write to bound properties and threw "A bound value cannot be set", crashing. Confirming now passes a style.clone() copy, so the bindings no longer leak into the data layer.
  2. Oversized pack.png resource pack icons crashing the launcher (#2015): pack.png dimensions are not constrained by the game, and BitmapFactory.decodeByteArray decoded at full size, so a very large icon produced a bitmap of hundreds of MB and drawing the resource pack list failed with "Canvas: trying to draw too large", crashing outright. ResourcePack.kt now has decodeIcon: it first reads the bounds with inJustDecodeBounds, then downsamples with a power-of-two inSampleSize until the image fits within 160px (the 40dp list icon at a 4x screen) and decodes, returning null when the bounds are invalid.
  3. Progress bars and sliders invisible when the theme alpha is 0 (#2016): The derived theme colors dkColor / ltColor fade with colorAlpha, so at alpha 0 the progress bar and slider disappeared (their progress and thumb tints use dkColor), and the dynamic island outline, text field background selected state, and the number seek bar's plus/minus buttons and filled segment vanished as well. FCLProgressBar, FCLSeekBar, FCLDynamicIsland, FCLEditText and FCLNumberSeekBar now use opaqueDkColor, which is not affected by the alpha setting; a new ThemeDataTest.opaqueColorsIgnoreAlphaSetting regression test pins that at alpha 0 dkColor / ltColor are fully transparent while opaqueColor / opaqueDkColor / opaqueLtColor stay opaque.
  4. Vulkan detection falsely reporting the custom driver as loaded when it is missing: liblinkerhook only intercepts the system libvulkan's driver load at the first vkCreateInstance, but the check used to treat "the loader handle is available" as the custom driver being active, so a missing driver (driver namespace creation failed, DRIVER_LIB absent, etc.) was still reported as loaded. hook.c now records driverLoadState (0 not attempted / 1 success / 2 failure) exported through fcl_linkerhook_driver_state, which vulkan_checker reads via dlsym; a new resolve_custom_driver judges the driver that actually took effect, falling back to the system loader with a warning log stating the reason when the hook is inactive or the driver failed to load, and the vkCreateInstance failure path reports the real driver as well; the null-pointer risk of calling linker_ns_dlopen with a NULL driverNs is also fixed.
  5. Line breaks not taking effect in the modpack description dialog: RemoteModpackPage / LocalModpackPage parsed every modpack description with Html.fromHtml, so line breaks in plain-text descriptions were swallowed as whitespace and the whole description ended up on a single line. ModpackPage now has formatDescription: it normalizes \r\n / \r to \n, parses the description as-is when it contains HTML tags, and otherwise converts the line breaks to
    before parsing.