visible, but inactive menu options

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
pucedragonlord
Regular
Posts: 159
Joined: Wed May 09, 2012 2:49 am
Projects: The Diviner
Organization: Two Crowns Entertainment
Location: Now: Charlottesville, VA
Contact:

visible, but inactive menu options

#1 Post by pucedragonlord » Sun Apr 21, 2013 2:13 pm

Is there a way I can get a menu: to have an inactive, but visible option in it? It's just an aesthetic thing I'd like to have, and I'm curious if there's some simple way to do it before I go and make my own custom menus.
The more you know

pwisaguacate
Veteran
Posts: 356
Joined: Mon Mar 11, 2013 11:03 pm
Contact:

Re: visible, but inactive menu options

#2 Post by pwisaguacate » Sun Apr 21, 2013 4:10 pm

I don't know how to gray out a menu choice, so if anybody could tell us, then that would be helpful.

Here's a simple snippet where choosing the "inactive" choice loops back:

Code: Select all

label menu1:
    menu:
        "Enter the room.":
            jump enter

        "[Leave.]" if leave_unlock == False:
            # "I haven't checked the room yet." # Optional message
            jump menu1 # Forces the player to repeat the menu

        "Leave." if leave_unlock == True:
            jump leave

User avatar
pucedragonlord
Regular
Posts: 159
Joined: Wed May 09, 2012 2:49 am
Projects: The Diviner
Organization: Two Crowns Entertainment
Location: Now: Charlottesville, VA
Contact:

Re: visible, but inactive menu options

#3 Post by pucedragonlord » Sun Apr 21, 2013 4:30 pm

Yeah, That's what I've done in the meantime.

It would be a neat little feature, though, I think. There's something different about a choice that's there, but you can't touch.
The more you know

User avatar
wyverngem
Miko-Class Veteran
Posts: 615
Joined: Mon Oct 03, 2011 7:27 pm
Completed: Simple as Snow, Lady Luck's Due,
Projects: Aether Skies, Of the Waterfall
Tumblr: casting-dreams
itch: castingdreams
Location: USA
Contact:

Re: visible, but inactive menu options

#4 Post by wyverngem » Sun Apr 21, 2013 9:55 pm

Code: Select all

    menu:
        "Question"
        "Option 1":
            pass
        "Option 2":
            "Do stuff."
    "Continue here."
You can use "pass" to skip and go to the next part.

User avatar
pucedragonlord
Regular
Posts: 159
Joined: Wed May 09, 2012 2:49 am
Projects: The Diviner
Organization: Two Crowns Entertainment
Location: Now: Charlottesville, VA
Contact:

Re: visible, but inactive menu options

#5 Post by pucedragonlord » Mon Apr 22, 2013 1:37 pm

still not quite the same thing, I'm afraid.

It's not that the button shouldn't do anything, it's that it should bi visible, but un-selctable. Greyed and inactive.

At this point I think I'll just have to make my own custom menu that can do that
The more you know

Cabriolean
Regular
Posts: 44
Joined: Sun Dec 09, 2012 6:59 am
Contact:

Re: visible, but inactive menu options

#6 Post by Cabriolean » Tue Apr 23, 2013 4:03 am

pucedragonlord wrote:still not quite the same thing, I'm afraid.

It's not that the button shouldn't do anything, it's that it should bi visible, but un-selctable. Greyed and inactive.

At this point I think I'll just have to make my own custom menu that can do that
One thing I did while playing around was figure out exactly where I wanted all my buttons, then edit the inactive button into the background image, so it wasn't actually technically a button at all, yes, I am fun when drunk..... No, I don't need an inactive button, I don't even really want one, but I am a weird but fairly stationary drunk, and my flatmates were giving me a headache.

I have a special set of files for drunk editing. This is because I do things like turn the buttons opaque and green, I also disable the help button, I actually kind of like the way it looks (not the green one, the translucent one), but not much use, for me anyway, although I did briefly consider turning the whole thing into a horror, this is why I disabled the help button, I think, I'm going off the weird bits of dialogue and crazy #notes, but zombies and vampires seemed to be the gist of it.
Attachments
screenshot 4.jpg
screenshot 3.jpg

pwisaguacate
Veteran
Posts: 356
Joined: Mon Mar 11, 2013 11:03 pm
Contact:

Re: visible, but inactive menu options

#7 Post by pwisaguacate » Thu May 09, 2013 7:03 am

Two weeks have passed, but I just realized that the easiest way to have a menu with an inactive choice is to simply define a screen with textbuttons and assign "action None" to whichever one is to be made inactive.

The following example copies the default choice menu style and uses a variable to activate the inactive button:

Code: Select all

init:
    $ btn_width = int(config.screen_width * 0.75)
    $ flag = False

screen ex_menu_with_inactive:
    vbox xalign 0.5 yalign 0.5:
        textbutton "Exit demo." action Return() xminimum btn_width
        if not flag:
            textbutton "(Quit first to activate button.)" action None xminimum btn_width
        else:
            textbutton "(LOL) Rage Quit" action Quit() xminimum btn_width
    
label start:
    "DEMO: a custom choice menu with an inactive button"
    call screen ex_menu_with_inactive
    "Just kidding. The second choice is now activated."
    $ flag = True
    call screen ex_menu_with_inactive
    jump start
(Here is a much simpler example, which keeps a choice permanently inactive:)

Code: Select all

init:
    $ btn_width = int(config.screen_width * 0.75)

screen menu_ask:
    vbox xalign 0.5 yalign 0.5:
        textbutton "(LOCKED: not enough manliness)" action None xminimum btn_width
        textbutton "... to ask her later." action Jump("later") xminimum btn_width

label start:
    [...]
    call screen menu_ask:

label later:
    [...]
Attachments
inactive_choice_screenshot_2.png

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], zyric