Code for better screenshot locations
Image of the modified save/load screen - catbox
This will NOT work on the following games, due to their code being retarded:
- My Dorm
CLICK HERE TO DOWNLOAD A PRE-MADE FILE
This file is hosted at the above gitlab repo, link included just for ease of access.
The code in the block below is for the screens.rpy file, or another file to overwrite that.
It changes the screen so that:
Saves can be named - toggled
Saves are now scrollable, 3 per row, unlimited rows
Page buttons now track the current page
New page buttons to navigate +/- 10 pages at once
These can all be disabled easily through commenting the appropriate lines out.
Use this by adding it to a text file, saving as "All files" then as a .rpy file
This file is hosted at the above gitlab repo, link included just for ease of access. The below code WILL NOT be updated anymore (2025-05-31), check the gitlab.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | default persistent.namedSaves = False
init -1500 python:
def pageInfo():
currentPage = int(persistent._file_page)
if currentPage >= 10:
digit = currentPage % 10
tens = currentPage // 10
return [tens,digit]
else:
digit = currentPage % 10
return [0,digit]
class FilePageNextTen(Action, DictEquality):
alt = _("Forward 10 pages.")
def __init__(self, max=None, wrap=False, auto=True, quick=True):
page = persistent._file_page
if page == "auto":
if config.has_quicksave and quick:
page = "quick"
else:
page = "1"
elif page == "quick":
page = "1"
else:
pageVal = pageInfo()
page = ((pageVal[0] + 1 ) * 10+ pageVal[1])
if max is not None:
if page > max:
if wrap:
if config.has_autosave and auto:
page = "auto"
elif config.has_quicksave and quick:
page = "quick"
else:
page = "1"
else:
page = None
if page is not None:
page = str(page)
self.page = page
def __call__(self):
if not self.get_sensitive():
return
persistent._file_page = self.page
renpy.restart_interaction()
def get_sensitive(self):
return self.page is not None
def predict(self):
_predict_file_page(self.page)
class FilePagePreviousTen(Action, DictEquality):
alt = _("Forward 10 pages.")
def __init__(self, max=None, wrap=False, auto=True, quick=True):
page = persistent._file_page
if page == "auto":
if config.has_quicksave and quick:
page = "quick"
else:
page = "1"
elif page == "quick":
page = "1"
else:
tmp2 = pageInfo()
tmpV=(( tmp2[0]- 1 ) * 10 + tmp2[1])
if (tmpV < 1):
page = 1
else:
page =(( tmp2[0]- 1 ) * 10 + tmp2[1])
if max is not None:
if page > max:
if wrap:
if config.has_autosave and auto:
page = "auto"
elif config.has_quicksave and quick:
page = "quick"
else:
page = "1"
else:
page = None
if page is not None:
page = str(page)
self.page = page
def __call__(self):
if not self.get_sensitive():
return
persistent._file_page = self.page
renpy.restart_interaction()
def get_sensitive(self):
return self.page is not None
def predict(self):
_predict_file_page(self.page)
screen setNamedSave(slot):
modal True
zorder 200
style_prefix "confirm"
frame:
vbox:
spacing 25
xsize 650
if FileLoadable(slot):
hbox:
label _("Overwriting Save Name:") style "confirm_prompt"
textbutton _("Clear") action SetVariable("save_name","") xpos 0.9 ypos -0.1
else:
label _("New Save Name:") style "confirm_prompt"
input:
value VariableInputValue('save_name')
length 30
xalign 0.5
hbox:
xfill True
textbutton _("Yes") action FileAction(slot, confirm=False), Hide("setNamedSave") xalign 0.5
textbutton _("No") action Hide("setNamedSave") xalign 0.5
screen file_slots(title):
default page_name_value = FilePageNameInputValue(pattern=_("Page {}"), auto=_("Automatic saves"), quick=_("Quick saves"))
use game_menu(title):
fixed:
## This ensures the input will get the enter event before any of the
## buttons do.
order_reverse True
if persistent.namedSaves:
textbutton _("Named Saves Enabled") text_size 32 action ToggleField(persistent,"namedSaves")
else:
textbutton _("Named Saves Disabled") text_size 32 action ToggleField(persistent,"namedSaves")
## The page name, which can be edited by clicking on a button.
button:
style "page_label"
key_events True
xalign 0.5
action page_name_value.Toggle()
input:
style "page_label_text"
value page_name_value
## The grid of file slots.
vpgrid:
style_prefix "slot"
xalign 0.5
yalign 0.5
spacing gui.slot_spacing
cols 3
ysize 0.8
mousewheel True
scrollbars "vertical"
$ existing_saves = sorted(FileUsedSlots(page=FileCurrentPage(), highest_first=False), key=lambda x: FileTime(x, format=_("{#file_time}%Y %m %d, %H:%M:%S")))
$ last_save_slot = (FileUsedSlots(page=FileCurrentPage(), highest_first=True) or [0])[0]
$ new_slot = last_save_slot + 1
if "load" not in title.lower():
button:
if persistent.namedSaves:
action SetVariable("save_name", FileSaveName(new_slot)), Show("setNamedSave", slot=new_slot)
else:
action SetVariable("save_name", FileSaveName(new_slot)), FileAction(new_slot)
has vbox
add FileScreenshot(new_slot) xalign 0.5
text FileTime(new_slot, format=_("{#file_time}%A, %B %d %Y, %H:%M"), empty=_("empty slot")):
style "slot_time_text"
text FileSaveName(new_slot):
style "slot_name_text"
key "save_delete" action FileDelete(new_slot)
for slot in existing_saves[::-1]:
button:
if "load" not in title.lower():
if persistent.namedSaves:
action SetVariable("save_name", FileSaveName(slot)), Show("setNamedSave", slot=slot)
else:
action SetVariable("save_name", FileSaveName(slot)), FileAction(slot)
else:
action FileAction(slot)
has vbox
add FileScreenshot(slot) xalign 0.5
text FileTime(slot, format=_("{#file_time}%A, %B %d %Y, %H:%M"), empty=_("empty slot")):
style "slot_time_text"
text FileSaveName(slot):
style "slot_name_text"
key "save_delete" action FileDelete(slot)
## Buttons to access other pages.
vbox:
style_prefix "page"
xalign 0.5
yalign 1.0
hbox:
xalign 0.5
spacing gui.page_spacing
textbutton _("<<<") action FilePagePreviousTen()
textbutton _("<") action FilePagePrevious()
#UNCOMMENT THE LINE TO ALLOW FOR MOUSEWHEEL PAGE CHANGE
# key "save_page_prev" action FilePagePrevious()
if config.has_autosave:
textbutton _("{#auto_page}A") action FilePage("auto")
if config.has_quicksave:
textbutton _("{#quick_page}Q") action FilePage("quick")
## range(1, 10) gives the numbers from 1 to 9.
if (persistent._file_page in ["auto", "quick"] or int(persistent._file_page) < 10):
for page in range(1, 10):
textbutton "[page]" action FilePage(page)
else:
for page in range(int(persistent._file_page)-4, int(persistent._file_page)+4):
textbutton "[page]" action FilePage(page)
textbutton _(">") action FilePageNext()
textbutton _(">>>") action FilePageNextTen()
#UNCOMMENT THE LINE TO ALLOW FOR MOUSEWHEEL PAGE CHANGE
# key "save_page_next" action FilePageNext()
|