Page 1 of 1

Overlay Yes/No Prompt when leaving the game

Posted: Fri Jan 17, 2014 9:54 pm
by Keinart
I changed the Yes/No Prompt background to a transparent one so the screen gets darker when the message appears. It works fine except when pressing the X in windows mode to exit just as you can see in the picture. Is there anyway to change this?

Image

Basically I want to see how the screen gets darker instead of changing completly, no matter if I'm in the middle of the novel or in any menu.

Thanks in advance.

Re: Overlay Yes/No Prompt when leaving the game

Posted: Sat Jan 18, 2014 4:38 am
by Crazy Li
You're lucky. In Ren'py 6.16, clicking the 'X' there just gives me an error message (regular quitting works fine though). At least you can click it without crashing your game. I suspect something changed in newer versions of Ren'py that made clicking the 'X' call the screen differently than activating "Quit()" because in the version I first got (6.13), it didn't have that error message problem. Clicking the 'X' functioned 100% the same as Quitting in any other fashion. It also did the darker message thing that you wanted perfectly fine for me.

I often find that when the background changes like that, it's an issue with the fact that it's a menu. When Ren'py calls a menu, it calls it as a brand new screen, erasing any other open menus (including the main menu). If you try for a transparent BG, you'll end up getting that checkerboard behind it because there is no background under your new menu. Sometimes even with simple prompts, it can get confused and resort to this behavior. Without re-doing the way the screens function significantly, you pretty much can't see anything behind a menu unless the only thing under it was the game itself. If you go from a menu to another menu, you lose that game behind it effect.

Re: Overlay Yes/No Prompt when leaving the game

Posted: Sat Jan 18, 2014 8:02 am
by DesertFox
If you go to screens.rpy and to your Yes/No prompt section you'll see:

Code: Select all

screen yesno_prompt:

    tag menu
    modal True
The line 'tag menu' means that this screen will replace other screens instead of just overlay them. So just comment with a # or remove it.

Code: Select all

screen yesno_prompt:

    #tag menu
    modal True

Re: Overlay Yes/No Prompt when leaving the game

Posted: Sat Jan 18, 2014 12:34 pm
by Keinart
DesertFox wrote:If you go to screens.rpy and to your Yes/No prompt section you'll see:

Code: Select all

screen yesno_prompt:

    tag menu
    modal True
The line 'tag menu' means that this screen will replace other screens instead of just overlay them. So just comment with a # or remove it.

Code: Select all

screen yesno_prompt:

    #tag menu
    modal True
Thanks for replying.
I tried this but it doesn't seem to work, and I haven't made any changes on the code for the Yes/No Prompt so I don't really think I messed anywhere :? In fact, in any other menu or part of the game, it seems to work fine, it only changes the background completly when I press the X to exit. Pics related:

Image

Image

Crazy Li wrote:You're lucky. In Ren'py 6.16, clicking the 'X' there just gives me an error message (regular quitting works fine though). At least you can click it without crashing your game. I suspect something changed in newer versions of Ren'py that made clicking the 'X' call the screen differently than activating "Quit()" because in the version I first got (6.13), it didn't have that error message problem. Clicking the 'X' functioned 100% the same as Quitting in any other fashion. It also did the darker message thing that you wanted perfectly fine for me.

I often find that when the background changes like that, it's an issue with the fact that it's a menu. When Ren'py calls a menu, it calls it as a brand new screen, erasing any other open menus (including the main menu). If you try for a transparent BG, you'll end up getting that checkerboard behind it because there is no background under your new menu. Sometimes even with simple prompts, it can get confused and resort to this behavior. Without re-doing the way the screens function significantly, you pretty much can't see anything behind a menu unless the only thing under it was the game itself. If you go from a menu to another menu, you lose that game behind it effect.
So, maybe it's something related with the new version? I just updated to it so maybe is related

Re: Overlay Yes/No Prompt when leaving the game

Posted: Sat Jan 18, 2014 3:17 pm
by Crazy Li
So only yes/no when you click the X? If you click your "Salir" button, that yes/no prompt works right? If that's the case, I really do suspect the version is the culprit.

Re: Overlay Yes/No Prompt when leaving the game

Posted: Sat Jan 18, 2014 4:11 pm
by Keinart
Crazy Li wrote:So only yes/no when you click the X? If you click your "Salir" button, that yes/no prompt works right? If that's the case, I really do suspect the version is the culprit.
Exactly, if I press "Salir" it works fine. It doesn't really make any sense :?

Re: Overlay Yes/No Prompt when leaving the game

Posted: Sun Jan 19, 2014 4:21 am
by Crazy Li
Yep, that's my problem. Except worse because it won't even show the yes/no prompt, instead just giving me an error message. Something about overlays or something. I just stick to my older version because it works without errors.

Re: Overlay Yes/No Prompt when leaving the game

Posted: Wed Jan 21, 2015 12:26 am
by Pierrou
I have the same problem... It works fine everywhere but not when i click on the "Red X" :/

Exactly the same bug...

Does anyone know why ?

I'm on Mac OS X Yosemite // Ren'Py 6.18.3

Re: Overlay Yes/No Prompt when leaving the game

Posted: Wed Jan 21, 2015 4:26 am
by OokamiKasumi
Have you tried this solution?
http://lemmasoft.renai.us/forums/viewto ... 21#p343438

Though this is normally used with an Imagemap it can be adapted by adding just this to the Top:

Code: Select all

# Yes/No Prompt

screen yesno_prompt(message, yes_action, no_action):
    modal True

    # window:
        # style "gm_root"

    if message == layout.QUIT:
        if main_menu:
             add "background.jpg"
However, this adds a background to ALL the Quit screens, (and only the Quit screens.)

Re: Overlay Yes/No Prompt when leaving the game

Posted: Wed Jan 21, 2015 4:37 am
by Yuuji
But what should I do if I want previous background to stay without changes? Yes/no prompt should appear in front of all layers, right?(modal True) Why this screen clears all layers behind it in case of "red x" click?

Re: Overlay Yes/No Prompt when leaving the game

Posted: Wed Jan 21, 2015 6:59 am
by xela
It's like dejavu from 10 days ago...

Re: Overlay Yes/No Prompt when leaving the game

Posted: Wed Jan 21, 2015 7:23 am
by shivanshs9
Just like what xela suggested...
In the Ren'Py documentation:config.quit_action
First, use the bit of code as DesertFox suggested and then add this in options.rpy under init python...

Code: Select all

init python:
    config.quit_action = Quit()
And, it's done!

Re: Overlay Yes/No Prompt when leaving the game

Posted: Wed Jan 21, 2015 7:45 am
by Yuuji
Thank you very much!

Re: Overlay Yes/No Prompt when leaving the game

Posted: Wed Jan 21, 2015 11:05 am
by Pierrou
xela wrote:It's like dejavu from 10 days ago...

Haaaa that Xela :mrgreen: I love you <3