Specific color / background for disabled choices in menu?

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
Errilhl
Regular
Posts: 164
Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Deviantart: studioerrilhl
Github: studioerrilhl
Contact:

Specific color / background for disabled choices in menu?

#1 Post by Errilhl »

Hi.

I'n the choice-menu, in-game, I have disabled entries (because conditions aren't met yet), and I would like these to be a different color (either text or background, or both) - how, exactly, can I do this?

I'm using this code for the choice-menu with conditions:

Code: Select all

screen choice(items):
    style_prefix "choice"
    # window:
        # style "menu_window"
        # xalign 0.5
        # yalign 0.5

    vbox:
        # style "menu"
        spacing 20
        for caption, action, chosen in items:
            if action:
                if conditions.check(caption):
                    button:
                        style "choice_button"
                        text conditions.text(caption) style "choice_button"
                else:
                    button:
                        action action
                        style "choice_button"
                        text caption style "choice_button"                 
            else:                           
                text caption style "choice_button"
init -2:
    $ config.narrator_menu = True

    style choice_vbox is vbox
    style choice_button is button
    style choice_button_text is button_text

    style choice_vbox:
        xalign 0.5
        ypos 405
        yanchor 0.5

        spacing gui.choice_spacing

    style choice_button is default:
        properties gui.button_properties("choice_button")

    style choice_button_text is default:
        properties gui.button_text_properties("choice_button")
It works just fine, but I can't seem to assign another class or name to the disabled entries. (The ones in the first if).

Any tips to how I can do this, preferably by defining gui.button_text_disabled or similar in the gui.rpy. If that's not possible, any solution will work.
Currently working on: Image

Post Reply

Who is online

Users browsing this forum: Google [Bot]