Page 1 of 1

[Solved] Disabling the quick menu momentarily

Posted: Mon Mar 20, 2017 8:41 pm
by SethRiley
Good day to all (^_^)/

At certain moments during game play I would like to have the quick menu disappear briefly, to simulate the feeling of a short cut scene as it were.

By default, pressing 'H' on the keyboard hides the interface. I am looking for a similar effect, though it should be triggered at some points in the script, so that when the player reaches that part of the story, the quick menu disappears, until it is triggered to come back again.

I found this post at the forum where basically the same question has been asked before:viewtopic.php?f=8&t=12229
PyTom replied:
The quick menu is included as part of the screen, rather than its own screen.

Generally, you don't want dialogue in your splashscreen - that's not what it's for. However, if you do want dialogue in the splashscreen, you can always change the say screen to read:

Code:
if quick_menu:
use quick_menu


Then you can update the quick_menu variable to control when the quick menu is shown.
I've added that bit of code to the say screen, but I'm not sure what to do next.

I've tried defining "quick_menu" as a boolean which is set to either False or True at certain points during the story like so:

Code: Select all

$ quick_menu = False
...though this seems ineffective and is most likely completely wrong.

Could some one please explain further how to implement the method as described by PyTom?

Re: Disabling the quick menu momentarily

Posted: Mon Mar 20, 2017 8:56 pm
by indoneko
I would just add showif inside the quickmenu screen to hide the hbox which wraps all of those textbuttons.
Then set a variable in script.rpy to tell the quickmenu to show or hide it.

Re: Disabling the quick menu momentarily

Posted: Mon Mar 20, 2017 9:09 pm
by SethRiley
Thank you indoneko. Please forgive the noobish nature of my reply, I am new to Ren'Py.

I've tried putting "define persistent.showquickmenu = True" in the script, and using "$ persistent.showquickmenu = False" to flip the value during the story. My quick screen doesn't have an hbox, just some image buttons:

Code: Select all

screen quick_menu():

    zorder 100

    showif persistent.showquickmenu = True:
    
        imagebutton idle "gui/gui_1.png" xpos 0 ypos 0 action ShowMenu('save')
        imagebutton idle "gui/gui_2.png" xpos 1115 ypos 0 action ShowMenu('preferences')
        imagebutton idle "gui/gui_3.png" xpos 0 ypos 70 action Rollback()

init python:
    config.overlay_screens.append("quick_menu")
This, as may be expected, does not work :oops:
Could you please elaborate indoneko?

Re: Disabling the quick menu momentarily

Posted: Mon Mar 20, 2017 9:27 pm
by indoneko
There's a mistake in your code. Instead of :
showif persistent.showquickmenu = True:

It should be :
showif persistent.showquickmenu:

Btw, why do you need to use persistent variable?

Re: Disabling the quick menu momentarily

Posted: Mon Mar 20, 2017 9:37 pm
by SethRiley
Thanks a lot indoneko, now it works indeed.

That is a very clear and concise way of showing and hiding the quick menu, by making use of "showif". I did not know the command.

And indeed, there is no need for a persistent variable. It works both ways, but I've removed the "persistent." bit.

Thanks ever so much (^_^)