The "x" button at the top right uses the action return() function, and will return players back to the game if they click on it.
However, this doesn't work in-game if the player tries to quit and then clicks the "x" button at the top right of the menu. It works on all other menus, just not in-game. If I'm in game, I can even hover over it and the button itself will change to the "hover", and clicking on it does forwards along the rest of text/story progression in the game while the menu still stays up. I'm scratching my head trying to figure out why!
Here is the code I'm using:
Code: Select all
screen yesno_prompt:
on "show" action With(dissolve)
#modal True
add "images/gui/yesno_background.png"
imagemap:
ground 'images/gui/yesno_ground.png'
idle 'images/gui/yesno_idle.png'
hover 'images/gui/yesno_hover.png'
alpha True
# This is so that everything transparent is invisible to the cursor.
hotspot (421, 306, 85, 45) action yes_action
hotspot (557, 306, 65, 45) action no_action
hotspot (886, 176, 35, 35) action Return()
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_load_save.png"
elif message == layout.QUIT:
add "images/gui/yesno_quit.png"
elif message == layout.MAIN_MENU:
add "images/gui/yesno_main_menu.png"
init python:
config.quit_action = Quit()