[Solved]How do you know if a button is visible or not? How can you get a count of QuickSaves?

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
henvu50
Veteran
Posts: 322
Joined: Wed Aug 22, 2018 1:22 am
Contact:

[Solved]How do you know if a button is visible or not? How can you get a count of QuickSaves?

#1 Post by henvu50 » Thu Oct 20, 2022 7:28 pm

EDIT: Long story short, I needed to specify an insensitive image for my custom quick load button. So I don't need to know if the button is visible or not, just specify the insensitive image for it's disabled state, then the button will get shown properly.

I want to know if the QuickLoad button is hidden or not. If it's not possible to know the visible state of a button; for example, looking up its visible state by ID, then is there a way to count how many Quick Saves are? If you know there are 0 quick saves, then you can safely assume the Quick Load button is hidden, yes?

For now, the only solution I can think of is to force a Quick Save right at the beginning of a new game, so the Quick Load button doesn't hide.

Code: Select all

$ renpy.save('quick-1')
The reason I need to know if the Quick Load button is hidden or not, is because I put a hotkey label over it, so the user knows what hotkey to press to use it fast. If there's no Quick Load button, I don't want to show my label.
Last edited by henvu50 on Fri Oct 28, 2022 1:21 am, edited 2 times in total.

User avatar
Tess
Newbie
Posts: 23
Joined: Thu Aug 04, 2022 3:43 pm
Projects: The Songbird Guild
Organization: Yurisoft
Github: wainwt2
Discord: Tess#7782
Contact:

Re: How do you know if a button is visible or not? How can you get a count of QuickSaves?

#2 Post by Tess » Thu Oct 20, 2022 9:51 pm

Testing out a new project, it looks like the Q. Load button doesn't hide itself when you have no quick saves, it just greys out. Maybe it's blending in with your textbox or background?

If it isn't the stuff behind it and the quick load button is truly going away, could you post your quick screen code? It should be pretty easy to get it to go back (knock on wood XD).

henvu50
Veteran
Posts: 322
Joined: Wed Aug 22, 2018 1:22 am
Contact:

Re: How do you know if a button is visible or not? How can you get a count of QuickSaves?

#3 Post by henvu50 » Fri Oct 28, 2022 1:20 am

Tess wrote:
Thu Oct 20, 2022 9:51 pm
Testing out a new project, it looks like the Q. Load button doesn't hide itself when you have no quick saves, it just greys out. Maybe it's blending in with your textbox or background?

If it isn't the stuff behind it and the quick load button is truly going away, could you post your quick screen code? It should be pretty easy to get it to go back (knock on wood XD).
Yea, you were right, it's supposed to grey out, so I supplied an insensitive greyed out image and it shows properly. Thanks for your help!

Post Reply

Who is online

Users browsing this forum: Bing [Bot]