Yes/No Prompt Woes (Solved!)
Posted: Thu Oct 16, 2014 10:32 pm
Hi! So today I finally figured out how to customize the "Are you sure you want to quit?" menu in my game. It's pretty simple looking, but it is just a transparent bubble that appears over whatever background image is present.
Here's what it looks like in the main menu.
And in game with place holder bg/sprites.
But in the main menu, this is what appears if you hit the X in the top right of the window, instead of hitting the quit button within renpy.
What I'd like to happen if the player hits the x button in the main menu would be for them to see the same thing that they'd see in the first link. It doesn't do this when the game has started, or on any other screen, only the main menu.
Here is the code I'm using to do this:
If anyone has any ideas or suggestions to fix this, I would greatly appreciate it! Thank you for reading.
Here's what it looks like in the main menu.
And in game with place holder bg/sprites.
But in the main menu, this is what appears if you hit the X in the top right of the window, instead of hitting the quit button within renpy.
What I'd like to happen if the player hits the x button in the main menu would be for them to see the same thing that they'd see in the first link. It doesn't do this when the game has started, or on any other screen, only the main menu.
Here is the code I'm using to do this:
Code: Select all
screen yesno_prompt(message, yes_action, no_action):
#modal True
add "images/gui/yesnobg.png"
imagemap:
ground 'images/gui/yesno_ground.png'
idle 'images/gui/yesno_idle.png'
hover 'images/gui/yesno_hover.png'
hotspot (795,628,100,48) action yes_action
hotspot (1064,628,86,48) action no_action
if message == layout.ARE_YOU_SURE:
add "images/gui/yesno_are_you_sure.png"
elif message == layout.DELETE_SAVE:
add "images/gui/yesno_delete_save.png"
elif message == layout.OVERWRITE_SAVE:
add "images/gui/yesno_overwrite_save.png"
elif message == layout.LOADING:
add "images/gui/yesno_loading.png"
elif message == layout.QUIT:
add "images/gui/yesno_quit.png"
elif message == layout.MAIN_MENU:
add "images/gui/yesno_main_menu.png"