get_sensitive() and get_selected() methods in FileLoad() class (in 00action_file.rpy)

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
tofuuu
Regular
Posts: 51
Joined: Tue Apr 24, 2018 7:15 pm
Contact:

get_sensitive() and get_selected() methods in FileLoad() class (in 00action_file.rpy)

#1 Post by tofuuu »

Code: Select all

def get_sensitive(self):
            if _in_replay:
                return False

            return renpy.can_load(__slotname(self.name, self.page))

        def get_selected(self):
            if not self.confirm or not self.newest:
                return False

            return __newest_slot() == __slotname(self.name, self.page)
Can you help me about this methods, when will this method will be used?

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: get_sensitive() and get_selected() methods in FileLoad() class (in 00action_file.rpy)

#2 Post by Remix »

They will both be used when the screen renders each button in order to set the sensitive (whether the button responds to clicks or hover events) and selected (whether the button shows the selected version of it's text/background/image or not) properties of the button.

In most cases get_selected will not be used as once you click Load the screen hides to proceed with the loaded game. Systems that limit a game to using just one slot out of a set number might use this though to highlight it.
Frameworks & Scriptlets:

Post Reply

Who is online

Users browsing this forum: Google [Bot], Semrush [Bot], simple_human