Switching Quick Menus?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
madocallie
Regular
Posts: 38
Joined: Tue May 14, 2013 1:57 am
Tumblr: madoarts
Skype: madocallie
Location: UK
Contact:

Switching Quick Menus?

#1 Post by madocallie » Tue Nov 07, 2017 12:10 pm

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?

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Switching Quick Menus?

#2 Post by Divona » Tue Nov 07, 2017 12:32 pm

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":
Last edited by Divona on Tue Nov 07, 2017 1:43 pm, edited 2 times in total.
Completed:
Image

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Switching Quick Menus?

#3 Post by Divona » Tue Nov 07, 2017 12:41 pm

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)
Completed:
Image

User avatar
madocallie
Regular
Posts: 38
Joined: Tue May 14, 2013 1:57 am
Tumblr: madoarts
Skype: madocallie
Location: UK
Contact:

Re: Switching Quick Menus?

#4 Post by madocallie » Tue Nov 07, 2017 3:49 pm

Excellent! That worked perfectly, thank you!

Post Reply

Who is online

Users browsing this forum: Google [Bot]