Asked to Overwrite Save on Load Screen? [SOLVED]
Posted: Fri Nov 23, 2018 7:22 pm
Hello! This is my first time making a custom game menu screen to this extent, and unfortunately, I've run into an issue with the confirm (yes/no) prompt in save/load/delete screen. I've made different yes/no prompt images for saving, loading, and deleting files, but they don't show up accordingly. No matter whether I'm trying to save, load, or delete a save file, the only confirm message that pops up is "Do you want to overwrite the save?" Not only that, I can only overwrite saves. For example, even on the load file screen, I'm not able to load the actual save file, only overwrite it. I'm almost sure this is why only one confirm message pops up.
Can someone help me to make it so that yes/no prompts show up on the correct screen and executes the correct function (save, load, delete file)? Thanks for your time!
Can someone help me to make it so that yes/no prompts show up on the correct screen and executes the correct function (save, load, delete file)? Thanks for your time!
Code: Select all
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.5
action page_name_value.Toggle()
input:
style "page_label_text"
value page_name_value
## The grid of file slots.
grid gui.file_slot_cols gui.file_slot_rows:
style_prefix "slot"
xalign 0.5
yalign 0.5
spacing gui.slot_spacing
for i in range(gui.file_slot_cols * gui.file_slot_rows):
$ slot = i + 1
button:
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.
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()
Code: Select all
screen load_save_slot:
$ file_text = "% 2s. %s\n%s" % (
FileSlotName(number, 4),
FileTime(number, empty=_("Empty Slot")),
FileSaveName(number))
add FileScreenshot(number) xpos 220 ypos 20
text file_text xpos 0 ypos 10 size 40 color "#ffffff" outlines [ (2, "#302B54") ] kerning 2 font "fonts/Laborate.ttf"
key "save_delete" action FileDelete(number)