Converter - screens.py parses the screen language: containers (fixed, frame, vbox, hbox, grid, vpgrid, viewport, button, has), widgets (text, textbutton, imagebutton, add, bar ...), if/for/use/transclude, default, python, key, timer, on, inline ATL, conditional properties, and decompiled forms (unparenthesised operators, glued property values, comma separated actions) - style statements, call/show/hide screen operators and Python-level renpy.show_screen are translated; only screens the game shows are audited, unused stock screens no longer block an import; undefined screens do - ATL values may be computed at run time and transforms take parameters (at blink(0.2, 0.3)); blur property Player - screens.ts builds the DOM from the IR and rebuilds it on state changes; buttons with idle/hover/selected/insensitive states, tooltips, sounds, modal screens, timers and keys that survive re-rendering, saved with the save file - Actions: Jump, Call, Return, SetVariable, Toggle*, SetScreenVariable, Show, Hide, ToggleScreen, Function, Play, Notify, If, Language, ShowMenu, OpenURL ... - Crop/LiveCrop/Solid/Frame/Transform/DynamicDisplayable values, crop property, globals(), renpy.variant/change_language/seen_image, transition stubs Tests: screen parser and runtime (linkedom DOM), screens fixture compiled from tests/fixtures/screens.rpy. Docs: docs/SCREENS.md. Twisted-Thoughts now passes the strict compatibility check. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
95 lines
2.4 KiB
Plaintext
95 lines
2.4 KiB
Plaintext
# Source of screens.json. Regenerate from backend/ with:
|
|
# python -m tests.make_screens ../frontend/tests/fixtures/screens.rpy ../frontend/tests/fixtures/screens.json
|
|
|
|
style hud_text:
|
|
size 30
|
|
color "#abc"
|
|
|
|
style hud_button:
|
|
background "#123"
|
|
hover_background "#456"
|
|
padding (10, 4)
|
|
|
|
transform fade_in:
|
|
alpha 0.0
|
|
linear 0.1 alpha 1.0
|
|
|
|
screen hud(day=1):
|
|
tag hud
|
|
zorder 5
|
|
style_prefix "hud"
|
|
default open = False
|
|
frame:
|
|
xalign 0.0
|
|
yalign 0.0
|
|
vbox:
|
|
spacing 6
|
|
text "Day [day]"
|
|
if money > 10:
|
|
text "Rich"
|
|
else:
|
|
text "Poor"
|
|
for item in inventory:
|
|
textbutton item action SetVariable("held", item)
|
|
textbutton "Menu" action ToggleScreenVariable("open") selected open
|
|
if open:
|
|
text "open!"
|
|
textbutton "Go" action [SetVariable("went", True), Jump("elsewhere")]
|
|
key "K_h" action SetVariable("hotkey", True)
|
|
timer 0.02 action SetVariable("ticked", True)
|
|
|
|
screen shop(item="none"):
|
|
modal True
|
|
imagebutton auto "buy_%s.png" action Return(item) at fade_in
|
|
textbutton "Cancel" action Return(None) sensitive can_cancel
|
|
|
|
screen counter():
|
|
add "#fff" xysize (10, 10)
|
|
bar value VariableValue("score", 10) xsize 100
|
|
|
|
transform blink(delay, cycle=1.0):
|
|
alpha 0.0
|
|
pause delay
|
|
linear cycle alpha 1.0
|
|
|
|
screen card(title):
|
|
frame:
|
|
has vbox
|
|
text title
|
|
transclude
|
|
|
|
screen deck():
|
|
use card("Deck"):
|
|
text "child " + "one"
|
|
textbutton "Pick" action Return(1)
|
|
add "pic.png" crop(1, 2, 30, 40)
|
|
add "dot.png" at blink(0.02, 0.02)
|
|
add "bg.png":
|
|
alpha 0.0
|
|
linear 0.1 alpha 1.0
|
|
on "show" action SetVariable("shown", True)
|
|
on "hide" action SetVariable("hid", True)
|
|
text "x" pos(5, 6)
|
|
vpgrid:
|
|
cols 2
|
|
text "a"
|
|
text "b"
|
|
textbutton "Language" action [Language("ru"), ToggleScreen("counter")]
|
|
add Crop((0, 0, 8, 8), "sprite.png")
|
|
|
|
screen mood():
|
|
imagebutton:
|
|
if money > 10:
|
|
idle "rich.png"
|
|
else:
|
|
idle "poor.png"
|
|
action SetVariable("mood_clicked", 1), SetVariable("mood_done", True)
|
|
|
|
label start:
|
|
show screen mood
|
|
show screen deck
|
|
show screen hud(2)
|
|
call screen shop("sword")
|
|
show screen counter
|
|
return
|