Disabling/Enabling Menu Items/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.
Message
Author
User avatar
jdlang
Newbie
Posts: 13
Joined: Wed Mar 22, 2017 2:59 pm
Contact:

Re: Disabling/Enabling Menu Items/Options

#16 Post by jdlang »

Necroing because this solution isn't compatible with the current version of screens.rpy. I've tried some things, but it's been unresponsive so far. Anyone got an idea?

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: Disabling/Enabling Menu Items/Options

#17 Post by IrinaLazareva »

Code: Select all

screen choice(items):
    style_prefix "choice"

    vbox:
        for i in items:
            if " (disabled)" in i.caption:
                textbutton i.caption.replace(" (disabled)", "") action None
            else:                
                textbutton i.caption action i.action

User avatar
jdlang
Newbie
Posts: 13
Joined: Wed Mar 22, 2017 2:59 pm
Contact:

Re: Disabling/Enabling Menu Items/Options

#18 Post by jdlang »

Nice, working perfectly. Thanks so much!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Alex, Google [Bot], Majestic-12 [Bot], NoFanru