You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
按键编辑撤销/恢复 (#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() 断开样式监听;控件组删除确认文案补充「此操作无法撤销」。
🐛 修复
编辑已保存的按键/方向样式时崩溃 (#2018):AddButtonStyleDialog / AddDirectionStyleDialog 的草稿样式 name 属性(方向样式还包括内部 buttonStyle / rockerStyle)在对话框内绑定到了输入控件,确认时却把同一个对象直接交给样式注册表,注册表中保存的就是绑定对象;之后编辑该样式时 setAll 写入绑定属性会抛 A bound value cannot be set 而崩溃。现确认时回调 style.clone() 的副本,绑定不再随对象泄漏到数据层。
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
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.
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.
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.
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.
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.