From 6c10d06d90cd38a103d440ca4db3e9d4348936c9 Mon Sep 17 00:00:00 2001 From: mrleo1nid <43583385+mrleo1nid@users.noreply.github.com> Date: Mon, 26 Oct 2026 02:58:24 +0300 Subject: [PATCH] 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 --- backend/app/converter/rpy_parser.py | 3 +++ backend/tests/test_renpy_universal.py | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/backend/app/converter/rpy_parser.py b/backend/app/converter/rpy_parser.py index 8ac514b..f02980e 100644 --- a/backend/app/converter/rpy_parser.py +++ b/backend/app/converter/rpy_parser.py @@ -370,6 +370,9 @@ class RpyParser: args, kw = e["a"], e["kw"] if fname == "renpy.pause": 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: return [_jump_or_call("jump", args[0])] if fname == "renpy.call" and args: diff --git a/backend/tests/test_renpy_universal.py b/backend/tests/test_renpy_universal.py index 19e863e..38620ac 100644 --- a/backend/tests/test_renpy_universal.py +++ b/backend/tests/test_renpy_universal.py @@ -196,3 +196,12 @@ def test_compiled_image_factory_class_does_not_enter_python_init(): 'label splashscreen:\n jump other\n') audit_ir(data) 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"