Ren'Py Tooltip & config.menu_include_disabled [Solved]

JohnDupont

Active Member
Modder
May 26, 2017
812
2,720
Hello,

I'd like to use both to show unavailable choices and in the screen choice. Sadly, the disabled buttons are insensitive and can't be interacted with, which seems to include mouseover. Is there a solution?
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,581
2,219
Whilst not exactly the same thing; the last time I did something like this, I altered the screen which handles menu choices to be able to alter whether menu choices were available or not per menu rather than globally.

https://f95zone.to/threads/greying-out-choices-that-dont-meet-requirements.55499/post-3737589

You might need to be a bit more creative than simply sensitive False, which if I recall correctly was only there as a way of overriding the default coloring. Perhaps remove that sensitive keyword and add a style override?

I am assuming here that simple having a menu choice defined to have action NullAction() would still honor the tooltip functionality.

This would require .
 
  • Like
Reactions: JohnDupont

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,363
15,281
I am assuming here that simple having a menu choice defined to have action NullAction() would still honor the tooltip functionality.
I confirm that.

Personally I would use something like that:
Python:
screen choice( items ):
    style_prefix "choice"

    vbox:
        for i in items:
            if i.action.sensitive is False: # Disabled menu choice.
                #  Just turning the value to True do not make the
                # button sensitive, but the choice enabled. Therefore 
                # it's in the /action/ that is the trick. Use your own 
                # one instead of the embedded one. And this action 
                # is /NullAction/ since you want nothing to happen.
                #  You also need to overwrite the style for the button
                # to not looks sensitive.
                textbutton i.caption action NullAction() style "WHATEVER YOU WANT" tooltip [whatever you want]
            else: # Regular choice.
                textbutton i.caption action i.action tooltip [whatever you want]
And it's done. Two lines, plus the definition of the style.
 
  • Like
Reactions: JohnDupont