feat: improve RenPy conversion and support MIST runtime
CI / frontend (push) Failing after 15s
CI / backend (push) Failing after 37s

This commit is contained in:
mrleo1nid committed 2026-10-25 23:16:33 +03:00
1 parent f7f7f5b1b3
commit f9eb5c1212
44 files changed
+2822 -174

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
"""Third-party Ren'Py libraries that the player implements natively.
Some community snippets are Python classes written against Ren'Py's render API (``renpy.Displayable``,
``renpy.Render``, pygame events). The browser player cannot run that API, so it ships its own class of the
same name and the converter drops the game's copy. Everything the converter needs to know about them lives
here; add an entry together with the TypeScript implementation (``nativeClasses`` in ``python.ts`` or the
displayable in ``screens.ts``), never in the shared converter code.
"""
#: class name -> what the native version offers
NATIVE_CLASSES: dict[str, dict] = {
"Gallery": {"methods": ("button", "image", "display", "make_button", "Action", "unlock", "unlock_image", "condition")},
# parallax picture that drifts against the mouse (screens: ``add TrackCursor("bg.png", 20)``)
"TrackCursor": {"methods": ()},
# Feniksdev's colour picker; the native class keeps the chosen colour and slot, the game draws its own UI
# Ren'Py's own MusicRoom, which games subclass; the player ships the playlist logic (musicroom.ts)
"MusicRoom": {"methods": ("add", "is_unlocked", "get_playlist", "Play", "Stop", "TogglePause", "Next",
"Previous", "RandomPlay", "SetLoop", "ToggleLoop", "SetSingleTrack",
"ToggleSingleTrack", "SetShuffle", "ToggleShuffle", "UnlockAll", "LockAll")},
"ColorPicker": {"methods": ("set_color", "save_color", "set_saved_color", "get_color", "swap_to_saved_color")},
}
#: modules those classes import for their event handlers; harmless once the class is replaced
NATIVE_IMPORTS = {"pygame"}
# These image factories are lowered to image IR by displayable_expr, rather than
# instantiated in Python. Their render-API classes must not execute at startup.
COMPILED_IMAGE_CLASSES = {"TransitionConditionSwitch"}
NATIVE_METHODS = {m for spec in NATIVE_CLASSES.values() for m in spec["methods"]}