This is getting a bit annoying now, but what I'm trying to do is create a screen in my game that's like a notebook that the player can open to check some progress notes. I would like a sound to play when this happens, so I sourced a clip of a page being turned which sounds quite fitting.
However, it seems to play on every mouse click / button press as you are progressing through the dialogue, as well as the screen too.
Here's my code:
To set up the toggle key:
Code: Select all
screen notepad_toggle:
if renpy.get_screen("crush_notes"):
key "n" action Hide("crush_notes")
else:
key "n" action Show("crush_notes")The screen that opens:
Code: Select all
screen crush_notes():
$ renpy.play("fx/open_notebook.ogg")
key "dismiss" action Hide("crush_notes")
style_prefix "notebook"
vbox:
spacing 15
frame:
xalign 0.5
ypos 0
xpadding 50
ypadding 70
xfill True
yfill True
background "notepad bg"
vbox:
box_wrap True
xsize 340
xpos 480
ypos 35
text notesIs there a way of doing this?