mirror of
https://github.com/Dasemu/vnpipe.git
synced 2026-11-27 07:46:37 +00:00
Merge branch 'feat/qa' into development
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
0f12ed438a
8 files changed
+114
-30
No files matched your search
+3
-2
@@ -77,7 +77,8 @@ mood (`ann.music`), unless overridden:
|
|||||||
the scene's `subtitle` (else its number).
|
the scene's `subtitle` (else its number).
|
||||||
- **Credits**: text author/translator/Gutenberg source from `[work]` and `[source]`; the art
|
- **Credits**: text author/translator/Gutenberg source from `[work]` and `[source]`; the art
|
||||||
line from the manifest's renditions (non-placeholder `source`, e.g. "ChatGPT (OpenAI)");
|
line from the manifest's renditions (non-placeholder `source`, e.g. "ChatGPT (OpenAI)");
|
||||||
the music from `<work>/audio/credits.toml` (`[[track]]` with `file`, `attribution`; only
|
the music from `<work>/audio/credits.toml` (`[[track]]` with `file`, `attribution`, optional
|
||||||
tracks whose file exists). Attributions are printed verbatim. Labels follow `[work].language`.
|
`attribution_<language>` used instead when it matches `[work].language`; only tracks whose file
|
||||||
|
exists). Attributions are printed verbatim. Labels follow `[work].language`.
|
||||||
- Defaults: `preferences.text_cps = 40`, `afm_time = 15`, `window auto`, a blinking
|
- Defaults: `preferences.text_cps = 40`, `afm_time = 15`, `window auto`, a blinking
|
||||||
click-to-continue arrow. Verse boxes stay at 4 lines; NVL keeps stanza pages.
|
click-to-continue arrow. Verse boxes stay at 4 lines; NVL keeps stanza pages.
|
||||||
@@ -317,8 +317,13 @@ def process_asset(work_root: Path, asset: dict[str, Any], style: str) -> None:
|
|||||||
rendition["status"] = "processed"
|
rendition["status"] = "processed"
|
||||||
|
|
||||||
|
|
||||||
def placeholder(asset: dict[str, Any], label_color: str = "#d8cfc0") -> Image.Image:
|
def placeholder(
|
||||||
"""Deterministic stand-in image so the game always runs."""
|
asset: dict[str, Any], label_color: str = "#d8cfc0", label: bool = True
|
||||||
|
) -> Image.Image:
|
||||||
|
"""Deterministic stand-in image so the game always runs.
|
||||||
|
|
||||||
|
``label`` draws the asset id (for the art pipeline); the game ships it without, since
|
||||||
|
the id is an internal name the player should not see."""
|
||||||
if asset["kind"] == "background":
|
if asset["kind"] == "background":
|
||||||
img = Image.new("RGB", BG_SIZE, "#1d1a17")
|
img = Image.new("RGB", BG_SIZE, "#1d1a17")
|
||||||
draw = ImageDraw.Draw(img)
|
draw = ImageDraw.Draw(img)
|
||||||
@@ -330,6 +335,7 @@ def placeholder(asset: dict[str, Any], label_color: str = "#d8cfc0") -> Image.Im
|
|||||||
draw = ImageDraw.Draw(img)
|
draw = ImageDraw.Draw(img)
|
||||||
draw.ellipse([170, 40, 330, 220], fill=(60, 52, 46, 230))
|
draw.ellipse([170, 40, 330, 220], fill=(60, 52, 46, 230))
|
||||||
draw.rounded_rectangle([110, 230, 390, SPRITE_HEIGHT], 60, fill=(60, 52, 46, 230))
|
draw.rounded_rectangle([110, 230, 390, SPRITE_HEIGHT], 60, fill=(60, 52, 46, 230))
|
||||||
|
if label:
|
||||||
draw = ImageDraw.Draw(img)
|
draw = ImageDraw.Draw(img)
|
||||||
font = ImageFont.load_default(size=40)
|
font = ImageFont.load_default(size=40)
|
||||||
draw.text((30, 30), asset["id"], fill=label_color, font=font)
|
draw.text((30, 30), asset["id"], fill=label_color, font=font)
|
||||||
|
|||||||
+23
-7
@@ -325,7 +325,8 @@ def collect_images(work: Work, manifest: dict[str, Any] | None) -> list[ImageEnt
|
|||||||
candidate = work.path("assets") / rel
|
candidate = work.path("assets") / rel
|
||||||
if style == default:
|
if style == default:
|
||||||
# the fallback may also be a placeholder; otherwise one is generated
|
# the fallback may also be a placeholder; otherwise one is generated
|
||||||
ok = rendition and rendition["status"] in {"processed", "approved", "placeholder"}
|
# (a placeholder is always regenerated, without the asset id label)
|
||||||
|
ok = rendition and rendition["status"] in {"processed", "approved"}
|
||||||
variants.append((style, rel, candidate if ok and candidate.is_file() else None))
|
variants.append((style, rel, candidate if ok and candidate.is_file() else None))
|
||||||
elif usable_rendition(asset, style) and candidate.is_file():
|
elif usable_rendition(asset, style) and candidate.is_file():
|
||||||
variants.append((style, rel, candidate))
|
variants.append((style, rel, candidate))
|
||||||
@@ -636,6 +637,7 @@ def render_script(work: Work, annotated: dict[str, Any], audio: Audio | None = N
|
|||||||
raise ValueError(f"cues refer to unknown line ids: {sorted(missing)}")
|
raise ValueError(f"cues refer to unknown line ids: {sorted(missing)}")
|
||||||
out += [
|
out += [
|
||||||
"label the_end:",
|
"label the_end:",
|
||||||
|
*([" stop music fadeout 3.0"] if audio.files else []),
|
||||||
" scene black",
|
" scene black",
|
||||||
" with fade",
|
" with fade",
|
||||||
" show card_end at truecenter",
|
" show card_end at truecenter",
|
||||||
@@ -671,12 +673,21 @@ def _check_image(selected: bool, round_: bool) -> Image.Image:
|
|||||||
return img
|
return img
|
||||||
|
|
||||||
|
|
||||||
|
def _slot_image(border_alpha: int, fill_alpha: int) -> Image.Image:
|
||||||
|
"""Save-slot frame (Ren'Py scales it with gui.slot_button_borders): thin outline plus tint."""
|
||||||
|
img = Image.new("RGBA", (48, 48), IVORY + (fill_alpha,))
|
||||||
|
ImageDraw.Draw(img).rectangle([0, 0, 47, 47], outline=ACCENT + (border_alpha,), width=2)
|
||||||
|
return img
|
||||||
|
|
||||||
|
|
||||||
def gui_extra_images() -> dict[str, Image.Image]:
|
def gui_extra_images() -> dict[str, Image.Image]:
|
||||||
"""Deterministic simple GUI images, keyed by path relative to ``game/``."""
|
"""Deterministic simple GUI images, keyed by path relative to ``game/``."""
|
||||||
base: dict[str, Image.Image] = {
|
base: dict[str, Image.Image] = {
|
||||||
"button/background.png": _solid((24, 24), (0, 0, 0, 0)),
|
"button/background.png": _solid((24, 24), (0, 0, 0, 0)),
|
||||||
"button/hover_background.png": _solid((24, 24), ACCENT + (60,)),
|
"button/hover_background.png": _solid((24, 24), ACCENT + (60,)),
|
||||||
"button/selected_background.png": _solid((24, 24), ACCENT + (35,)),
|
"button/selected_background.png": _solid((24, 24), ACCENT + (35,)),
|
||||||
|
"button/slot_idle_background.png": _slot_image(110, 14),
|
||||||
|
"button/slot_hover_background.png": _slot_image(255, 40),
|
||||||
"button/check_foreground.png": _check_image(False, False),
|
"button/check_foreground.png": _check_image(False, False),
|
||||||
"button/check_selected_foreground.png": _check_image(True, False),
|
"button/check_selected_foreground.png": _check_image(True, False),
|
||||||
"button/radio_foreground.png": _check_image(False, True),
|
"button/radio_foreground.png": _check_image(False, True),
|
||||||
@@ -807,14 +818,15 @@ def title_cards(work: Work, annotated: dict[str, Any]) -> dict[str, tuple[str, s
|
|||||||
|
|
||||||
|
|
||||||
def render_card(heading: str, subtitle: str | None) -> str:
|
def render_card(heading: str, subtitle: str | None) -> str:
|
||||||
"""A heading, plus a smaller italic line below it when the scene has a subtitle."""
|
"""A spaced-out heading; with a subtitle, a thin gold rule and a smaller italic line below."""
|
||||||
props = "size=60, text_align=0.5"
|
props = "size=76, kerning=3, text_align=0.5, xmaximum=1600"
|
||||||
if not subtitle:
|
if not subtitle:
|
||||||
return f'Text("{escape_text(heading)}", {props})'
|
return f'Text("{escape_text(heading)}", {props})'
|
||||||
sub_props = 'size=30, italic=True, color="#c9a25b", text_align=0.5'
|
sub_props = 'size=34, italic=True, color="#c9a25b", text_align=0.5, xmaximum=1600'
|
||||||
return (
|
return (
|
||||||
f'VBox(Text("{escape_text(heading)}", {props}, xalign=0.5), '
|
f'VBox(Text("{escape_text(heading)}", {props}, xalign=0.5), '
|
||||||
f'Text("{escape_text(subtitle)}", {sub_props}, xalign=0.5), spacing=28)'
|
'Solid("#c9a25b", xsize=200, ysize=2, xalign=0.5), '
|
||||||
|
f'Text("{escape_text(subtitle)}", {sub_props}, xalign=0.5), spacing=26)'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -903,7 +915,11 @@ def credits_sections(work: Work, manifest: dict[str, Any] | None) -> list[tuple[
|
|||||||
sections.append((ui["art"], [ui["art_with"].format(", ".join(sources))]))
|
sections.append((ui["art"], [ui["art_with"].format(", ".join(sources))]))
|
||||||
tracks = credit_tracks(work)
|
tracks = credit_tracks(work)
|
||||||
if tracks: # attributions are printed verbatim (CC BY-SA requires them)
|
if tracks: # attributions are printed verbatim (CC BY-SA requires them)
|
||||||
sections.append((ui["music"], [t["attribution"] for t in tracks]))
|
lang = info.get("language", "es")
|
||||||
|
# `attribution_<language>` is the same credit translated, used when present
|
||||||
|
sections.append(
|
||||||
|
(ui["music"], [t.get(f"attribution_{lang}") or t["attribution"] for t in tracks])
|
||||||
|
)
|
||||||
about_tail = ABOUT_LABELS.get(info.get("language", "es"), ABOUT_LABELS["en"])[2]
|
about_tail = ABOUT_LABELS.get(info.get("language", "es"), ABOUT_LABELS["en"])[2]
|
||||||
sections.append(("vnpipe", [about_tail]))
|
sections.append(("vnpipe", [about_tail]))
|
||||||
return [(title, [_markup(e) for e in entries]) for title, entries in sections]
|
return [(title, [_markup(e) for e in entries]) for title, entries in sections]
|
||||||
@@ -1039,7 +1055,7 @@ def generate(
|
|||||||
if source:
|
if source:
|
||||||
shutil.copyfile(source, dest)
|
shutil.copyfile(source, dest)
|
||||||
else:
|
else:
|
||||||
placeholder(e.asset).save(dest, "WEBP", quality=90)
|
placeholder(e.asset, label=False).save(dest, "WEBP", quality=90)
|
||||||
|
|
||||||
return sorted(written)
|
return sorted(written)
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ define gui.game_menu_background = "@@MENU_BG@@"
|
|||||||
## time.
|
## time.
|
||||||
|
|
||||||
## The height of the textbox containing dialogue.
|
## The height of the textbox containing dialogue.
|
||||||
define gui.textbox_height = 278
|
define gui.textbox_height = 310
|
||||||
|
|
||||||
## The placement of the textbox vertically on the screen. 0.0 is the top, 0.5 is
|
## The placement of the textbox vertically on the screen. 0.0 is the top, 0.5 is
|
||||||
## center, and 1.0 is the bottom.
|
## center, and 1.0 is the bottom.
|
||||||
@@ -130,11 +130,11 @@ define gui.namebox_tile = False
|
|||||||
## The placement of dialogue relative to the textbox. These can be a whole
|
## The placement of dialogue relative to the textbox. These can be a whole
|
||||||
## number of pixels relative to the left or top side of the textbox, or 0.5 to
|
## number of pixels relative to the left or top side of the textbox, or 0.5 to
|
||||||
## center.
|
## center.
|
||||||
define gui.dialogue_xpos = 402
|
define gui.dialogue_xpos = 360
|
||||||
define gui.dialogue_ypos = 75
|
define gui.dialogue_ypos = 70
|
||||||
|
|
||||||
## The maximum width of dialogue text, in pixels.
|
## The maximum width of dialogue text, in pixels.
|
||||||
define gui.dialogue_width = 1116
|
define gui.dialogue_width = 1250
|
||||||
|
|
||||||
## The horizontal alignment of the dialogue text. This can be 0.0 for left-
|
## The horizontal alignment of the dialogue text. This can be 0.0 for left-
|
||||||
## aligned, 0.5 for centered, and 1.0 for right-aligned.
|
## aligned, 0.5 for centered, and 1.0 for right-aligned.
|
||||||
@@ -180,9 +180,9 @@ define gui.button_text_xalign = 0.0
|
|||||||
##
|
##
|
||||||
## These customizations are used by the default interface:
|
## These customizations are used by the default interface:
|
||||||
|
|
||||||
define gui.radio_button_borders = Borders(27, 6, 6, 6)
|
define gui.radio_button_borders = Borders(48, 6, 6, 6)
|
||||||
|
|
||||||
define gui.check_button_borders = Borders(27, 6, 6, 6)
|
define gui.check_button_borders = Borders(48, 6, 6, 6)
|
||||||
|
|
||||||
define gui.confirm_button_text_xalign = 0.5
|
define gui.confirm_button_text_xalign = 0.5
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ define gui.choice_button_text_insensitive_color = '#8888887f'
|
|||||||
define gui.slot_button_width = 414
|
define gui.slot_button_width = 414
|
||||||
define gui.slot_button_height = 309
|
define gui.slot_button_height = 309
|
||||||
define gui.slot_button_borders = Borders(15, 15, 15, 15)
|
define gui.slot_button_borders = Borders(15, 15, 15, 15)
|
||||||
define gui.slot_button_text_size = 21
|
define gui.slot_button_text_size = 26
|
||||||
define gui.slot_button_text_xalign = 0.5
|
define gui.slot_button_text_xalign = 0.5
|
||||||
define gui.slot_button_text_idle_color = gui.idle_small_color
|
define gui.slot_button_text_idle_color = gui.idle_small_color
|
||||||
define gui.slot_button_text_selected_idle_color = gui.selected_color
|
define gui.slot_button_text_selected_idle_color = gui.selected_color
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ style window:
|
|||||||
yalign gui.textbox_yalign
|
yalign gui.textbox_yalign
|
||||||
ysize gui.textbox_height
|
ysize gui.textbox_height
|
||||||
|
|
||||||
background Image("gui/textbox.png", xalign=0.5, yalign=1.0)
|
background Frame("gui/textbox.png", 0, 0)
|
||||||
|
|
||||||
style namebox:
|
style namebox:
|
||||||
xpos gui.name_xpos
|
xpos gui.name_xpos
|
||||||
|
|||||||
@@ -13,27 +13,50 @@ screen vn_art_style_picker():
|
|||||||
|
|
||||||
modal True
|
modal True
|
||||||
|
|
||||||
add Solid("#000000")
|
add gui.main_menu_background
|
||||||
|
add Solid("#000000c8")
|
||||||
|
|
||||||
vbox:
|
vbox:
|
||||||
xalign 0.5
|
xalign 0.5
|
||||||
yalign 0.5
|
yalign 0.45
|
||||||
spacing 30
|
spacing 24
|
||||||
|
|
||||||
text "@@ART_STYLE_TITLE@@" xalign 0.5 size 60
|
text "@@ART_STYLE_TITLE@@":
|
||||||
text "@@ART_STYLE_HINT@@" xalign 0.5 size 28
|
xalign 0.5
|
||||||
|
size gui.title_text_size
|
||||||
|
color gui.accent_color
|
||||||
|
|
||||||
null height 20
|
text "@@ART_STYLE_HINT@@":
|
||||||
|
xalign 0.5
|
||||||
|
size 30
|
||||||
|
italic True
|
||||||
|
|
||||||
|
null height 40
|
||||||
|
|
||||||
for style_id, style_label in vn_art_styles:
|
for style_id, style_label in vn_art_styles:
|
||||||
textbutton style_label:
|
textbutton style_label:
|
||||||
|
style_prefix "vn_picker"
|
||||||
xalign 0.5
|
xalign 0.5
|
||||||
action [SetField(persistent, "art_style", style_id),
|
action [SetField(persistent, "art_style", style_id),
|
||||||
SetField(persistent, "art_style_chosen", True), Return()]
|
SetField(persistent, "art_style_chosen", True), Return()]
|
||||||
|
|
||||||
|
style vn_picker_button is gui_button
|
||||||
|
style vn_picker_button_text is gui_button_text
|
||||||
|
|
||||||
|
style vn_picker_button:
|
||||||
|
xminimum 420
|
||||||
|
padding (30, 12)
|
||||||
|
|
||||||
|
style vn_picker_button_text:
|
||||||
|
size 44
|
||||||
|
xalign 0.5
|
||||||
|
text_align 0.5
|
||||||
|
|
||||||
## Shown once, before the first scene, when there is a choice to make.
|
## Shown once, before the first scene, when there is a choice to make.
|
||||||
label vn_pick_art_style:
|
label vn_pick_art_style:
|
||||||
if len(vn_art_styles) > 1 and not persistent.art_style_chosen:
|
if len(vn_art_styles) > 1 and not persistent.art_style_chosen:
|
||||||
scene black
|
scene black
|
||||||
|
$ quick_menu = False
|
||||||
call screen vn_art_style_picker
|
call screen vn_art_style_picker
|
||||||
|
$ quick_menu = True
|
||||||
return
|
return
|
||||||
@@ -316,6 +316,7 @@ def test_renpy_condition_switch_and_fallback(work_root, tmp_path):
|
|||||||
assert 'default persistent.art_style = "paint"' in styles
|
assert 'default persistent.art_style = "paint"' in styles
|
||||||
assert "define vn_art_styles = [('paint', 'Paint'), ('ink', 'Ink')]" in styles
|
assert "define vn_art_styles = [('paint', 'Paint'), ('ink', 'Ink')]" in styles
|
||||||
assert "@@" not in styles
|
assert "@@" not in styles
|
||||||
|
assert "$ quick_menu = False" in styles # the picker hides the in-game quick menu
|
||||||
assert "call vn_pick_art_style" in (out / "game/script.rpy").read_text(encoding="utf-8")
|
assert "call vn_pick_art_style" in (out / "game/script.rpy").read_text(encoding="utf-8")
|
||||||
screens = (out / "game/screens.rpy").read_text(encoding="utf-8")
|
screens = (out / "game/screens.rpy").read_text(encoding="utf-8")
|
||||||
assert "Estilo visual" in screens and 'SetField(persistent, "art_style", style_id)' in screens
|
assert "Estilo visual" in screens and 'SetField(persistent, "art_style", style_id)' in screens
|
||||||
@@ -353,3 +354,26 @@ def test_two_style_project_lints_and_plays(work_root, tmp_path):
|
|||||||
report = lint.stdout + lint.stderr
|
report = lint.stdout + lint.stderr
|
||||||
assert lint.returncode == 0 and "error" not in report.lower(), report
|
assert lint.returncode == 0 and "error" not in report.lower(), report
|
||||||
test_renpy_gen.run_e2e(out, home)
|
test_renpy_gen.run_e2e(out, home)
|
||||||
|
|
||||||
|
|
||||||
|
def test_placeholder_label_only_when_asked():
|
||||||
|
from PIL import ImageChops
|
||||||
|
|
||||||
|
from vnpipe.assets import placeholder
|
||||||
|
|
||||||
|
asset = {"id": "bg_x", "kind": "background"}
|
||||||
|
labelled, plain = placeholder(asset), placeholder(asset, label=False)
|
||||||
|
assert ImageChops.difference(labelled, plain).getbbox() is not None
|
||||||
|
# the shipped placeholder is the plain gradient: no pixel brighter than its last row
|
||||||
|
assert plain.getpixel((0, 0)) != plain.getpixel((0, plain.height - 1)) # a bare gradient
|
||||||
|
|
||||||
|
|
||||||
|
def test_renpy_regenerates_placeholders_and_adds_slot_frames(work_root, tmp_path):
|
||||||
|
assets.ensure_placeholder(
|
||||||
|
work_root, assets.find_asset(assets.load_manifest(work_root), "bg_theatre"), "paint"
|
||||||
|
)
|
||||||
|
out = gen(work_root, tmp_path)
|
||||||
|
shipped = Image.open(out / "game/images/bg/paint/theatre.webp").convert("RGB")
|
||||||
|
assert shipped.getpixel((0, 40)) == shipped.getpixel((300, 40)) # no label on the row
|
||||||
|
assert (out / "game/gui/button/slot_idle_background.png").is_file()
|
||||||
|
assert (out / "game/gui/button/slot_hover_background.png").is_file()
|
||||||
+19
-5
@@ -175,7 +175,10 @@ def test_characters_and_images(project):
|
|||||||
|
|
||||||
def test_title_card_images(project):
|
def test_title_card_images(project):
|
||||||
images = (project / "game/images.rpy").read_text(encoding="utf-8")
|
images = (project / "game/images.rpy").read_text(encoding="utf-8")
|
||||||
assert 'image card_talk = Text("CONVERSACIÓN", size=60, text_align=0.5)' in images
|
assert (
|
||||||
|
'image card_talk = Text("CONVERSACIÓN", size=76, kerning=3, text_align=0.5, xmaximum=1600)'
|
||||||
|
in images
|
||||||
|
)
|
||||||
assert 'image card_end = Text("Continuará…"' in images
|
assert 'image card_end = Text("Continuará…"' in images
|
||||||
|
|
||||||
|
|
||||||
@@ -194,12 +197,16 @@ def test_music_only_when_audio_exists(work, annotated, tmp_path):
|
|||||||
out = tmp_path / "p"
|
out = tmp_path / "p"
|
||||||
renpy_gen.generate(work, annotated, out)
|
renpy_gen.generate(work, annotated, out)
|
||||||
assert "play music" not in (out / "game/script.rpy").read_text(encoding="utf-8")
|
assert "play music" not in (out / "game/script.rpy").read_text(encoding="utf-8")
|
||||||
|
assert "label the_end:\n scene black" in (out / "game/script.rpy").read_text(
|
||||||
|
encoding="utf-8"
|
||||||
|
)
|
||||||
(out / "game/audio").mkdir()
|
(out / "game/audio").mkdir()
|
||||||
(out / "game/audio/sacred.ogg").write_bytes(b"OggS")
|
(out / "game/audio/sacred.ogg").write_bytes(b"OggS")
|
||||||
renpy_gen.generate(work, annotated, out)
|
renpy_gen.generate(work, annotated, out)
|
||||||
text = (out / "game/script.rpy").read_text(encoding="utf-8")
|
text = (out / "game/script.rpy").read_text(encoding="utf-8")
|
||||||
assert 'play music "audio/sacred.ogg" fadeout 1.0 fadein 1.0 if_changed' in text
|
assert 'play music "audio/sacred.ogg" fadeout 1.0 fadein 1.0 if_changed' in text
|
||||||
assert "stop music fadeout 1.0" in text # mood "none" on the Lord's first line
|
assert "stop music fadeout 1.0" in text # mood "none" on the Lord's first line
|
||||||
|
assert "label the_end:\n stop music fadeout 3.0" in text # the music fades with the end card
|
||||||
assert (out / "game/audio/sacred.ogg").is_file() # regeneration keeps user audio
|
assert (out / "game/audio/sacred.ogg").is_file() # regeneration keeps user audio
|
||||||
|
|
||||||
|
|
||||||
@@ -498,9 +505,12 @@ def test_title_card_subtitle(work, annotated, tmp_path):
|
|||||||
scenes = [{"heading": "CONVERSACIÓN", "id": "talk", "subtitle": "Escenario · Día"}]
|
scenes = [{"heading": "CONVERSACIÓN", "id": "talk", "subtitle": "Escenario · Día"}]
|
||||||
out = _project(work, annotated, tmp_path, scenes=scenes)
|
out = _project(work, annotated, tmp_path, scenes=scenes)
|
||||||
images = (out / "game/images.rpy").read_text(encoding="utf-8")
|
images = (out / "game/images.rpy").read_text(encoding="utf-8")
|
||||||
assert 'image card_talk = VBox(Text("CONVERSACIÓN", size=60' in images
|
assert 'image card_talk = VBox(Text("CONVERSACIÓN", size=76' in images
|
||||||
assert 'Text("Escenario · Día", size=30, italic=True' in images
|
assert 'Text("Escenario · Día", size=34, italic=True' in images
|
||||||
assert 'image card_lyric = Text("LÍRICA", size=60, text_align=0.5)' in images # no subtitle
|
assert (
|
||||||
|
'image card_lyric = Text("LÍRICA", size=76, kerning=3, text_align=0.5, xmaximum=1600)'
|
||||||
|
in images
|
||||||
|
) # no subtitle
|
||||||
|
|
||||||
|
|
||||||
def test_scene_labels_and_menus(project, script):
|
def test_scene_labels_and_menus(project, script):
|
||||||
@@ -528,8 +538,11 @@ def test_credits_from_work_audio_and_manifest(work, tmp_path):
|
|||||||
root = tmp_path / "w"
|
root = tmp_path / "w"
|
||||||
(root / "audio").mkdir(parents=True)
|
(root / "audio").mkdir(parents=True)
|
||||||
(root / "audio/a.ogg").write_bytes(b"OggS")
|
(root / "audio/a.ogg").write_bytes(b"OggS")
|
||||||
|
(root / "audio/b.ogg").write_bytes(b"OggS")
|
||||||
(root / "audio/credits.toml").write_text(
|
(root / "audio/credits.toml").write_text(
|
||||||
'[[track]]\nfile = "audio/a.ogg"\nattribution = "Bach [x]. CC BY-SA 4.0."\n'
|
'[[track]]\nfile = "audio/a.ogg"\nattribution = "Bach [x]. CC BY-SA 4.0."\n'
|
||||||
|
'[[track]]\nfile = "audio/b.ogg"\nattribution = "Liszt. Performed by X."\n'
|
||||||
|
'attribution_es = "Liszt. Interpretación de X."\n'
|
||||||
'[[track]]\nfile = "audio/missing.ogg"\nattribution = "not shipped"\n',
|
'[[track]]\nfile = "audio/missing.ogg"\nattribution = "not shipped"\n',
|
||||||
encoding="utf-8",
|
encoding="utf-8",
|
||||||
)
|
)
|
||||||
@@ -547,7 +560,8 @@ def test_credits_from_work_audio_and_manifest(work, tmp_path):
|
|||||||
assert sections["Texto"][1] == "Traducción: T. Translator"
|
assert sections["Texto"][1] == "Traducción: T. Translator"
|
||||||
assert "Proyecto Gutenberg, n.º 42" in sections["Texto"][2]
|
assert "Proyecto Gutenberg, n.º 42" in sections["Texto"][2]
|
||||||
assert sections["Ilustraciones"] == ["Ilustraciones generadas con ChatGPT (OpenAI)"]
|
assert sections["Ilustraciones"] == ["Ilustraciones generadas con ChatGPT (OpenAI)"]
|
||||||
assert sections["Música"] == ["Bach [[x]. CC BY-SA 4.0."] # verbatim, markup-escaped only
|
# verbatim (markup-escaped only); a translated `attribution_<language>` wins when present
|
||||||
|
assert sections["Música"] == ["Bach [[x]. CC BY-SA 4.0.", "Liszt. Interpretación de X."]
|
||||||
|
|
||||||
|
|
||||||
def test_main_menu_background_from_ui(work, annotated, tmp_path):
|
def test_main_menu_background_from_ui(work, annotated, tmp_path):
|
||||||
|
|||||||
Reference in new issue
Block a user