Fix transform frame parsing for empty and non-object input#993
Fix transform frame parsing for empty and non-object input#993A-kirami wants to merge 2 commits into
Conversation
Treat empty setTransform content as an empty transform frame so
-writeDefault follows the same base default path as setTransform:{}.
Accept only object-shaped transform JSON for setTransform, changeFigure,
and changeBg. Non-object values from malformed or empty transform input
fall back to the default transform path instead of entering animation
frames.
There was a problem hiding this comment.
Code Review
This pull request refactors the parsing of transform frames across multiple game scripts (changeBg, changeFigure, and setTransform) by introducing and utilizing helper functions parseTransformFrame and parseSetTransformFrame. This eliminates inline JSON.parse calls and try-catch blocks, and reduces code duplication by extracting common animation application logic into applyTransform functions. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
概要
setTransform:内容按空变换帧处理,使其与setTransform:{}在-writeDefault下语义一致。setTransform、changeFigure -transform、changeBg -transform增加统一的 transform frame 解析边界。changeFigure/changeBg的无效 transform 输入会走默认 transform 路径。-duration=、-zIndex=等历史语义。背景
解决 #984
此前
setTransform:{} -writeDefault和setTransform: -writeDefault行为不一致。原因是空内容会 JSON 解析失败,并被处理成空动画列表,导致默认 transform 终态没有写入。另外,
changeFigure/changeBg的-transform参数缺少对象形态校验,数组或 primitive JSON 可能被当作动画帧进入后续流程。