I am working on coding a save / load screen into my game. It is transparent, so that the background of the game shows whenever you open up the menu, like this:
However, I would like to program both screens to overwrite saves or loads when you click on them (still haven't figured out how to do that, yet!)
But when you click on the save slots in the load screen, the background just goes black, kind of like in this screenshot:
Can anyone help me figure out why this is happening? And is there a way to program an overwrite into the save / load menu code so that players can over write their save / load slots when they click on them?
Here is the code I currently have in place:
Code: Select all
## Load and Save screens #######################################################
##
## These screens are responsible for letting the player save the game and load
## it again. Since they share nearly everything in common, both are implemented
## in terms of a third screen, file_slots.
##
## https://www.renpy.org/doc/html/screen_special.html#save https://
## www.renpy.org/doc/html/screen_special.html#load
screen save():
tag menu
zorder 100
add "gui/coverup.png"
imagemap:
ground "gui/save-inactive.png"
hover "gui/save-active.png"
selected_idle "gui/save-active.png"
alpha True
hotspot (567, 68, 506, 173) clicked FileSave(1):
use load_save_slot(number=1)
hotspot (567, 295, 506, 173) clicked FileSave(2):
use load_save_slot(number=2)
hotspot (567, 522, 506, 173) clicked FileSave(3):
use load_save_slot(number=3)
hotspot (567, 749, 506, 173) clicked FileSave(4):
use load_save_slot(number=4)
hotspot (1242, 70, 506, 173) clicked FileSave(5):
use load_save_slot(number=5)
hotspot (1242, 297, 506, 173) clicked FileSave(6):
use load_save_slot(number=6)
hotspot (1242, 524, 506, 173) clicked FileSave(7):
use load_save_slot(number=7)
hotspot (1242, 751, 506, 173) clicked FileSave(8):
use load_save_slot(number=8)
hotspot (828, 942, 55, 55) action FilePage(1)
hotspot (936, 942, 55, 55) action FilePage(2)
hotspot (90, 424, 304, 62) action Return()
hotspot (90, 502, 304, 62) action ShowMenu('load')
screen load():
tag menu
add "gui/coverup.png"
if main_menu:
add "bg/T7.jpg"
imagemap:
ground "gui/load-inactive.png"
hover "gui/load-active.png"
selected_idle "gui/load-active.png"
alpha True
hotspot (567, 68, 506, 173) clicked FileLoad(1):
use load_save_slot(number=1)
hotspot (567, 295, 506, 173) clicked FileLoad(2):
use load_save_slot(number=2)
hotspot (567, 522, 506, 173) clicked FileLoad(3):
use load_save_slot(number=3)
hotspot (567, 749, 506, 173) clicked FileLoad(4):
use load_save_slot(number=4)
hotspot (1242, 70, 506, 173) clicked FileLoad(5):
use load_save_slot(number=5)
hotspot (1242, 297, 506, 173) clicked FileLoad(6):
use load_save_slot(number=6)
hotspot (1242, 524, 506, 173) clicked FileLoad(7):
use load_save_slot(number=7)
hotspot (1242, 751, 506, 173) clicked FileLoad(8):
use load_save_slot(number=8)
hotspot (828, 942, 55, 55) action FilePage(1)
hotspot (936, 942, 55, 55) action FilePage(2)
hotspot (90, 424, 304, 62) action Return()
hotspot (90, 502, 304, 62) action ShowMenu('save')
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
## The page name, which can be edited by clicking on a button.
button:
style "page_label"
key_events True
xalign 0.7
action page_name_value.Toggle()
## Buttons to access other pages.
hbox:
style_prefix "page"
xalign 0.5
yalign 1.0
spacing gui.page_spacing
textbutton _("<") 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.
for page in range(1, 10):
textbutton "[page]" action FilePage(page)
textbutton _(">") action FilePageNext()
style page_label is gui_label
style page_label_text is gui_label_text
style page_button is gui_button
style page_button_text is gui_button_text
style slot_button is gui_button
style slot_button_text is gui_button_text
style slot_time_text is slot_button_text
style slot_name_text is slot_button_text
style page_label:
xpadding 50
ypadding 3
style page_label_text:
text_align 0.5
layout "subtitle"
hover_color gui.hover_color
idle_color gui.idle_color
style page_button:
properties gui.button_properties("page_button")
style page_button_text:
properties gui.button_text_properties("page_button")
style slot_button:
properties gui.button_properties("slot_button")
style slot_button_text:
properties gui.button_text_properties("slot_button")
screen load_save_slot:
key "save_delete" action FileDelete(number)
$ file_text = "% 2s. %s\n%s" % (
FileSlotName(number, 3),
FileTime(number, empty=_("Empty Slot")),
FileSaveName(number))
add FileScreenshot(number) size(221,143) xpos -29 ypos 12
add AlphaMask("gui/circle_alphamask.png", FileScreenshot(number)) xpos -31 ypos -32
text FileTime(number, format=_("{#file_time}%A, %B %d, %H:%M"), empty=_("")):
style "slot_time_text" ypos 83 xpos 344
text FileSaveName(number):
style "slot_name_text"
screen game_menu():
tag menu
add "gui/pixel.png"
##############################################################################