feat: generator interpreter for Python that waits for the player (Ren'Py)
Python containing renpy.input, narrator("..."), character calls, renpy.say,
renpy.pause, renpy.display_menu, renpy.with_statement or renpy.call_screen now
runs through loops, try, functions, methods and expressions.
Player
- python.ts: execG/evalG/callG run only the code that may wait (mayBlock);
everything else stays on the synchronous fast path. A waiting call returns a
BlockingCall; outside the generator interpreter it is an explicit error. The
interpreter scope is set aside while the player decides
- engine: drives the generator and answers requests (dialogue, text input with
length/allow/exclude, pause, choice menu, transition, call screen)
- renpy.show/hide/scene, transitions and transforms as Python values,
Character(...) objects, Borders, set_tag_attributes
Converter
- blocking_names() lists game functions that may wait, transitively, and ships
them as game.json "blocking"; character calls are allowed
- hide screen of an unknown screen is harmless; images defined by a parenthesised
expression are supported
Hooked now passes the strict compatibility check (with Tomie and Twisted-Thoughts).
Tests: waiting.py fixture run through the generator interpreter; blocking-name analysis.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ea03cebf6a
commit
3923ee72fb
11 files changed
+698
-27
No files matched your search
@@ -19,6 +19,7 @@ from app.converter.compatibility import (
|
||||
CompatibilityError,
|
||||
Issue,
|
||||
audit_ir,
|
||||
blocking_names,
|
||||
detect,
|
||||
require_supported_scripts,
|
||||
)
|
||||
@@ -191,6 +192,7 @@ def convert_archive(archive: Path, filename: str, work: Path, progress: Progress
|
||||
"images": images,
|
||||
"transforms": data.transforms,
|
||||
"atl": data.atl,
|
||||
"blocking": blocking_names(data),
|
||||
"screens": {name: data.screens[name] for name in sorted(_used_screens(data))},
|
||||
"styles": data.styles,
|
||||
"transitions": data.transitions,
|
||||
|
||||
Reference in new issue
Block a user