Files
mrleo1nidandClaude Sonnet 5.5 6d78b8b847
CI / frontend (push) Failing after 15s
CI / backend (push) Failing after 33s
feat: build profile for The Lewdest House; panoramas as GPU hints, live2d-only init branches, drag/at syntax
The build (fingerprint of its scripts) skips third-party code written against Ren'Py's render API
(colour picker demo, Kinetic Text Tags, cps_preview) and waives its one missing test screen. Converter:
xpan/ypan/matrixtransform/matrixanchor are skipped like other GPU hints, `if renpy.has_live2d()` in an
init block keeps only its else branch, `crop(...)xpos` and `crop (1, 2, 3, 4)` parse, `drag` is a screen
container, `at icon["at"]` becomes a dynamic entry, and the whitelist gains Matrix, Move, absolute and
the no-op helpers. The game now passes the strict check and converts fully (3272 files, 288 MB).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 04:29:20 +03:00

33 lines
2.1 KiB
Python

"""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": ()},
# the Preferences screen's text-speed preview (the game's copy draws slowly through renpy.Render)
"PreviewSlowText": {"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"]}