Page 1 of 1

[SOLVED] NVL menu is showing up for the ADV menu as well?

Posted: Mon May 18, 2020 9:34 am
by Kinmoku
Hi all,

I use choice menus in my project from both NVL and ADV modes. However, when I'm in ADV, the NVL menu shows up, with the NVL frame too. My code is below:

Code: Select all

screen choice(items):
    style_prefix "choice"

    vbox:
        for i in items:
            textbutton i.caption action i.action

screen nvl(dialogue, items=None):
    frame:
        pos (540, 30)
        
        side "c":
            area (0, 0, 844, 780)

            viewport id "vp":
                yadjustment ui.adjustment (value=9999, range=9999)

                vbox:
                    spacing gui.nvl_spacing
                    
                    use nvl_dialogue(dialogue)
                    
        ## Displays the menu, if given. The menu may be displayed incorrectly if
        ## config.narrator_menu is set to True, as it is above.
    vbox:
        pos(0, 850)
        for i in items:
                textbutton i.caption:
                    action i.action
                    style "nvl_button"
Does anyone know why this is happening? I'd like to use both menus in both situations.

Re: NVL menu is showing up for the ADV menu as well?

Posted: Wed May 20, 2020 5:52 am
by gas
I'm not totally sure, but probably you can leave the normal menu behaviour as default, and use the menu argument to determine when a menu is a NVL one or a normal one.

Code: Select all

# this one should be seen as NVL mode...
menu (nvl = True):

    "Gas is a genius":
        jump no_way

    "Gas is stupid":
        jump more_probably


Re: NVL menu is showing up for the ADV menu as well?

Posted: Fri May 22, 2020 11:24 am
by Kinmoku
gas wrote:
Wed May 20, 2020 5:52 am
I'm not totally sure, but probably you can leave the normal menu behaviour as default, and use the menu argument to determine when a menu is a NVL one or a normal one.

Code: Select all

# this one should be seen as NVL mode...
menu (nvl = True):

    "Gas is a genius":
        jump no_way

    "Gas is stupid":
        jump more_probably

Weirdly, I use this for the NVL menu (which appears later in the game) but both menus still look the same. Is "menu (nvl = False):" what I should be using?

Re: NVL menu is showing up for the ADV menu as well?

Posted: Fri May 22, 2020 2:31 pm
by gas
According to documentation if you set (nvl = True) as a menu argument, that menu should be seen in nvl type.
While others should look as ADV.
So, why this doesn't work is out of my knowledge.

Another approach can be to assign the menu variable.

Code: Select all

default adv_menu = menu # create a copy of the standard menu
From now onward you can do:

Code: Select all

$ menu = adv_menu
menu:
     "bla bla"
to set a normal menu

Code: Select all

$ menu= nvl_menu
menu:
    "bla bla"
to have instead the menu look as a nvl menu

Re: NVL menu is showing up for the ADV menu as well?

Posted: Fri May 22, 2020 5:54 pm
by MaydohMaydoh
I would think what Gas first said is right. Check to make sure you don't have "define menu = nvl_menu" somewhere in your code.

Re: NVL menu is showing up for the ADV menu as well?

Posted: Mon May 25, 2020 9:17 am
by Kinmoku
Thanks both. I think that's what was happening.

I now have:

Code: Select all

define adv_menu = menu
define menu = nvl_menu
And then use:

Code: Select all

$ menu = adv_menu

menu:
	"Choice 1":
		"Choice 1"
	"Choice 2":
		"Choice 2"
		
# for adv menu, and...

$ menu = nvl_menu

menu:
	"Choice 1":
		"Choice 1"
	"Choice 2":
		"Choice 2"

# for nvl menu. Seems to be working :D