mirror of
https://github.com/Dasemu/vnpipe.git
synced 2026-11-27 07:46:37 +00:00
feat(renpy): fade the music out with the end card
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c759374e4d
commit
a811e0c3c9
2 files changed
+5
No files matched your search
@@ -637,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",
|
||||||
|
|||||||
@@ -197,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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user