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"