Page 1 of 1

Switching Quick Menus?

Posted: Tue Nov 07, 2017 12:10 pm
by madocallie
Is it possible to change the layout of quick menus when switching from ADV-mode to NVL-mode?

I have the ADV quick menu all sorted out, but is there like, a condition I can use in screens.rpy for the quick menu to change its appearance when switching to NVL mode?

Re: Switching Quick Menus?

Posted: Tue Nov 07, 2017 12:32 pm
by Divona
I can't find variable needed in the documentation, so here is my take on making one up:

First, declare a boolean variable:

Code: Select all

default nvl_showing = False
In "screens.rpy" search for "screen nvl". Then add two line of code:

Code: Select all

screen nvl(dialogue, items=None):

    # Add these two lines.
    on "show" action SetVariable("nvl_showing", True)
    on "hide" action SetVariable("nvl_showing", False)
Now you have a variable to check when NVL screen is showing:

Code: Select all

screen quick_menu():

    if nvl_showing == False:
        # ADV quick menu
    else:
        # NVL quick menu
It's rather strange that there is no existing check for ADV or NVL mode. Maybe I miss something, but oh well, there is workaround.

EDIT: Turn out there is a way to check ADV or NVL mode.

Code: Select all

if renpy.get_mode() == "nvl":

Re: Switching Quick Menus?

Posted: Tue Nov 07, 2017 12:41 pm
by Divona
The method above does have an issue, though. If "window hide" is use, the variable reset to False. Another way to do it is to set the variable in two places.

First for ADV:

Code: Select all

screen say(who, what):
    style_prefix "say"

    on "show" action SetVariable("nvl_showing", False)
Now for NVL:

Code: Select all

screen nvl(dialogue, items=None):

    on "show" action SetVariable("nvl_showing", True)

Re: Switching Quick Menus?

Posted: Tue Nov 07, 2017 3:49 pm
by madocallie
Excellent! That worked perfectly, thank you!