feat: renpy.call_in_new_context("_hide_windows") becomes a click wait
Ren'Py's own _hide_windows label hides the dialogue window until the player clicks. Games call it directly between scenes, and one of them 531 times. Other labels stay unsupported. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e1c596288e
commit
6c10d06d90
2 files changed
+12
No files matched your search
@@ -370,6 +370,9 @@ class RpyParser:
|
|||||||
args, kw = e["a"], e["kw"]
|
args, kw = e["a"], e["kw"]
|
||||||
if fname == "renpy.pause":
|
if fname == "renpy.pause":
|
||||||
return [{"op": "pause", "d": args[0] if args else kw.get("delay")}]
|
return [{"op": "pause", "d": args[0] if args else kw.get("delay")}]
|
||||||
|
if fname == "renpy.call_in_new_context" and len(args) == 1 and not kw and args[0].get("k") == "const" and args[0]["v"] == "_hide_windows":
|
||||||
|
# Ren'Py's own label: hides the dialogue window until the player clicks
|
||||||
|
return [{"op": "pause", "d": None}]
|
||||||
if fname == "renpy.jump" and args:
|
if fname == "renpy.jump" and args:
|
||||||
return [_jump_or_call("jump", args[0])]
|
return [_jump_or_call("jump", args[0])]
|
||||||
if fname == "renpy.call" and args:
|
if fname == "renpy.call" and args:
|
||||||
|
|||||||
@@ -196,3 +196,12 @@ def test_compiled_image_factory_class_does_not_enter_python_init():
|
|||||||
'label splashscreen:\n jump other\n')
|
'label splashscreen:\n jump other\n')
|
||||||
audit_ir(data)
|
audit_ir(data)
|
||||||
assert any("TransitionConditionSwitch" in message for message in data.blockers)
|
assert any("TransitionConditionSwitch" in message for message in data.blockers)
|
||||||
|
|
||||||
|
|
||||||
|
def test_hide_windows_context_call_is_a_click_wait():
|
||||||
|
data = parse('label start:\n $ renpy.call_in_new_context("_hide_windows")\n return\n')
|
||||||
|
body = data.modules["t.rpy"][0]["body"] if isinstance(data.modules, dict) else None
|
||||||
|
assert body and body[0]["op"] == "pause" and body[0]["d"] is None
|
||||||
|
assert not data.blockers
|
||||||
|
other = parse('label start:\n $ renpy.call_in_new_context("something_else")\n return\n')
|
||||||
|
assert other.modules["t.rpy"][0]["body"][0]["op"] == "exec"
|
||||||
Reference in new issue
Block a user