Continue button
Posted: Mon Oct 25, 2021 4:28 pm
Well this code is based on this old publication...(viewtopic.php?t=48154) And I thought you might be interested in this updated code.
Code: Select all
init +1 python:
def Can_load():
lastsave=renpy.newest_slot() # get the newest slot
CanLoad = renpy.can_load(lastsave, test=False) # check if it can be loaded
print(lastsave)
if lastsave is not None: # prevent crash if '_reload-*' not exist in saves
if '_reload' in lastsave:
return False # if '_reload' in saves, return False.
else:
if CanLoad:
return CanLoad # Return True if the save can be loaded.
else:
return CanLoad # Return False if the save cannot be loaded.
else:
return False
def Load_NewSave():
lastsave=renpy.newest_slot() # Get the newest save slot.
renpy.load(lastsave) # The load the save.
screen ContinueButton():
if Can_load():
textbutton _("Continue") action Function(Load_NewSave)
screen navigation():
use ContinueButton()
# ...