Add FilePageLast action for the save menu

This commit is contained in:
LoafyLemon 2024-06-12 16:56:39 +01:00
parent ad017851e6
commit 85b8c10ad7
2 changed files with 19 additions and 0 deletions

View File

@ -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":

View File

@ -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