Or ... Correct me if im wrong. and sorry.
Whatever, i add a button code for "Delete" that can Help "User" delete data and free up spaces.
Without do "Overwrites".
Its Just a Simple Logics, and .. its really simple.
This code from my game :
Code: Select all
##############################################################################
# Save, Load
#
screen file_picker :
$ config.thumbnail_height = 480
$ config.thumbnail_width = 700
default current_file = 0
if current_file != 0:
add FileScreenshot(current_file) xalign 0.15 yalign 0.30
frame:
area (850, 45, 400, 600)
style "file_picker_frame"
viewport:
scrollbars "vertical"
mousewheel True
has vbox
$ rows = 10
# Display fifty file slots, numbered 1 - 10.
for i in range(1, rows + 1):
if delete == True :
button:
action FileDelete(i)
hovered SetScreenVariable("current_file", i)
unhovered SetScreenVariable("current_file", 0)
xfill True
has hbox
$ file_name = FileSlotName(i, rows)
$ file_time = FileTime(i, empty=_("{color=#00FF00}Kosong{/color}"))
text "=================================={vspace=3}File no : [file_name]{vspace=3}{space=145}[file_time!t]{vspace=3}=================================="
else :
button:
action FileAction(i)
hovered SetScreenVariable("current_file", i)
unhovered SetScreenVariable("current_file", 0)
xfill True
has hbox
$ file_name = FileSlotName(i, rows)
$ file_time = FileTime(i, empty=_("{space=147}{color=#00FF00}Kosong{/color}"))
text "=================================={vspace=3}File no : [file_name]{vspace=3}{space=145}[file_time!t]{vspace=3}=================================="
key "save_delete" action FileDelete(i)
screen save:
# This ensures that any other menu screen is replaced.
tag menu
$ delete = False
use navigationsave
use file_picker
screen load:
# This ensures that any other menu screen is replaced.
tag menu
$ delete = False
use navigationsave
use file_picker
screen delete:
# This ensures that any other menu screen is replaced.
tag menu
$ delete = True
use navigationsave
use file_picker
init -2:
style file_picker_frame is menu_frame
style file_picker_nav_button is small_button
style file_picker_nav_button_text is small_button_text
style file_picker_button is large_button
style file_picker_text is large_button_text
Code: Select all
screen navigationsave:
# The background of the game menu.
window:
style "gm_root"
# The various buttons.
frame:
style_group "gm_nav"
xalign .22
yalign .94
has vbox
textbutton _("{size=+5}Manual{/size}") action FilePage(1)
textbutton _("{size=+5}Automatic{/size}") action FilePage("auto")
textbutton _("{size=+5}Back{/size}") action Return()
frame:
style_group "gm_nav"
xalign .37
yalign .94
has vbox
textbutton _("{size=+5}Save{/size}") action ShowMenu("save")
textbutton _("{size=+5}Continue{/size}") action ShowMenu("load")
textbutton _("{size=+5}Delete{/size}") action ShowMenu("delete")
frame:
xalign .96
yalign .96
has hbox
textbutton _("◄"):
action FilePagePrevious()
for i in range(1, 8):
textbutton str(i):
action FilePage(i)
textbutton _("►"):
action FilePageNext()
init -2:
# Make all game menu navigation buttons the same size.
style gm_nav_button:
size_group "gm_nav"
The "Key" :
Code: Select all
action FileDelete(i)
Oh yes, Ignore this code :
( its just a style )
Code: Select all
==================================
And, If u try to delete and then pop up menu like :
"Are you sure wanna quit ?"
(Y) U will delete file save
(N) No action tough.
Actually, Its because :
Code: Select all
screen yesno_prompt:
( Example : I'm replacing "Are you sure wanna quit ?" with "Are you sure ?". )
Oh, one left..
You Can delete All Saves Games, From All Pages include Automatic Save Pages, and Quick Save Pages.