diff --git a/game/scripts/gui/main_menu.rpy b/game/scripts/gui/main_menu.rpy index 65f4201e..521b0c75 100644 --- a/game/scripts/gui/main_menu.rpy +++ b/game/scripts/gui/main_menu.rpy @@ -333,6 +333,8 @@ screen navigation(): null height 35 textbutton "Next" action FilePageNext() at navigation_tabs textbutton "Previous" action FilePagePrevious() at navigation_tabs + null height 35 + textbutton "Last Page" action FilePageLast() at navigation_tabs use file_slots(_("Save")) elif category == "load": @@ -344,6 +346,8 @@ screen navigation(): null height 35 textbutton "Next" action FilePageNext() at navigation_tabs textbutton "Previous" action FilePagePrevious() at navigation_tabs + null height 35 + textbutton "Last Page" action FilePageLast() at navigation_tabs use file_slots(_("Load")) elif category == "settings": diff --git a/game/scripts/utility/actions.rpy b/game/scripts/utility/actions.rpy index 1c5186fd..004e8652 100644 --- a/game/scripts/utility/actions.rpy +++ b/game/scripts/utility/actions.rpy @@ -1,4 +1,19 @@ init python: + class FilePageLast(Action): + def __call__(self): + if not self.get_sensitive(): + return + + saves = renpy.list_saved_games(r"\d+") + + if not saves: + return 1 + + last_page = int(saves[-1][0][0]) + + persistent._file_page = last_page + renpy.restart_interaction() + class SetShopCategory(Action): def __init__(self, category: str, items: list): self.category = category