[Updated] Continue button

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
Neyunse
Newbie
Posts: 8
Joined: Fri Aug 17, 2018 7:08 pm
Projects: Roses Of Love
Organization: KagariSoft
Github: Neyunse
itch: KagariSoft
Location: Argentina
Contact:

[Updated] Continue button

#1 Post by Neyunse »

Well, after publishing this post (viewtopic.php?t=63397) I made some adjustments to the code, so here is an updated version.

Code: Select all

init python:
  class Continue(Action):
        """
        :doc: menu_action
        
        Causes the last save to be loaded.
        The purpose of this is to load the player's last save 
        from the main menu.
        
        `regexp`
            If present, will be used in `renpy.newest_slot`. 
        """

        def __init__(self, regexp=r"(?!_reload).+", confirm=False):
            self.regexp = regexp
       

        def __call__(self):
            recent_save = renpy.newest_slot(self.regexp)

            if recent_save:
                renpy.load(recent_save)

        def get_sensitive(self): 
            if _in_replay:
                return False
            return renpy.newest_slot(self.regexp) is not None
            
 screen navigation():
 	textbutton "Continue" action Continue()
on the other hand, this is something I submitted in a PR in the official Ren'Py repository (https://github.com/renpy/renpy/pull/4921), and this code has a slight change.
----------------------------------------------------
My Twitter: @Neyunse
My Discord: ねゆんせ#7916
----------------------------------------------------
KagariSoft Twitter: @KagariSoft
My Discord Server

Post Reply

Who is online

Users browsing this forum: No registered users