feat: conditional "at" transforms in screens and comma-separated ATL statements
`frame at (a if cond else b)` is kept as a choice that the player resolves each time the screen is drawn. An ATL line splits at top-level commas into separate statements, so `zoom 1.2, 0.2` is a zoom followed by a 0.2s pause, as Ren'Py compiles it (two-value properties such as `pos 0.5, 0.5` stay whole). The inert events deselected/unselected, which Ren'Py never sends, are accepted. With the build profile for The Only Doe 0.05 the game now passes the strict script check. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0822c76321
commit
b3f435f416
5 files changed
+85
-3
No files matched your search
@@ -178,3 +178,19 @@ def test_mousearea_is_a_leaf_with_hover_actions():
|
||||
require_supported_scripts(data)
|
||||
node = data.screens["s"]["body"][0]
|
||||
assert node["w"] == "mousearea" and {"hovered", "unhovered", "xysize"} <= set(node["props"])
|
||||
|
||||
|
||||
def test_at_picks_a_transform_by_condition_and_atl_commas_split_statements():
|
||||
data = parse('transform grow:\n zoom 1.0\n on selected:\n zoom 1.2, 0.2\n on deselected:\n'
|
||||
' zoom 1.0, 0.2\ntransform still:\n zoom 1.0\n'
|
||||
'screen s(flag):\n frame at (grow if flag else still):\n text "x"\n'
|
||||
'label start:\n call screen s(True)\n')
|
||||
audit_ir(data)
|
||||
require_supported_scripts(data)
|
||||
node = data.screens["s"]["body"][0]
|
||||
choice = node["props"]["at"][0]["choose"]
|
||||
assert choice["then"]["name"] == "grow" and choice["else"]["name"] == "still"
|
||||
steps = data.atl["grow"]["steps"]
|
||||
handler = steps[1]["block"]["steps"]
|
||||
assert [s["op"] for s in handler] == ["set", "pause"] and handler[1]["t"] == 0.2
|
||||
assert steps[1]["events"] == ["selected"] and steps[2]["events"] == ["deselected"]
|
||||
Reference in new issue
Block a user