Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Hi! Your code is cool, but is there any chance to make tooltips work with disabled choices?

(6 edits)

Hi! That's actually a good question, it would be nice if it worked for disabled choices too.

I just did some tests and whenever a button has the sensitive False property,  the Ren'Py tooltip will not display. I think this is because insensitive in Ren'Py affects more than just the styling, making it so the user can't interact with the screen element at all (so it can't run an action, display a tooltip, etc) .

The easiest fix I can think of is to circumvent the sensitive button property and instead make it look disabled (and make the action do nothing) if the player fails the check. In my test project it looks the same as an insensitive button but does display the tooltip.

Replace the textbutton part of the screen code with this

You may want to play around with the disabled button styling based on your set up and whether you're using a "gui/button/choice_insensitive_background.png"

There might be a more elegant solution, but I'm not aware of it. Let me know if this works for you!

Thank you! I found another but almost the same way: 

if i.action.sensitive is False:

....textbutton i.caption:

........action NullAction()

else:

.....textbutton i.caption action i.action

I'm not sure which option is better, though. Seems like it doesn't really matter. But I keep testing. Thanks for the reply!

I will keep testing more as well and then upload a version that includes this since I do think it should be a feature! Thanks for pointing it out

No problem. For some reason it's a rare case, and all coding is about making tooltips for something that is available. But for my game I really needed tips for the locked choices.

I updated the code and added an extra feature where you can write in a different tooltip message for when a choice is disabled vs. not (which I thought might be handy for this use case), which is up now!

The main difference from my pastebin code is just that the styles for disabled choice buttons are now consolidated with the other styles rather than handled in the screen.

Thank you! I suddenly found out  that the tooltips don't work in the choice menu like this:

$ x = {1: True, 2: True, 3: True, 4: True, 5: True}

while x[1] or x[2] or x[3] or x[4] or x[5]:

        menu:

            "Blablabla"  if x[1] and y == 1:

                $ x[1] = False

                $ y = 0             

                pass

            "Yaddayaddayadda" if x[2] and b== 1:

                $ x[2] = False

                $ b= 0

                pass

But I didn't test your code.  So I wonder, does your code work with the choice menu like this one?

Resolved. I didn't add some lines in screen.rpy x_x