
On the right, you get the FileScreenshot, the slot number, the time/date and a bit of the game text.
These informations only appear here, not on the slot themselves.
Any suggestion?

Code: Select all
$ infotext = file_name+'. '+file_time+'\n'+save_name
button:
action FileAction(i)
hovered Show("moreinfo", txt=infotext, img=FileScreenshot(i))
unhovered Hide("moreinfo")Code: Select all
screen moreinfo(txt, img):
add img
text txtCode: Select all
screen file_picker():
default tt = Tooltip(("", Null()))Code: Select all
# Each file slot is a button.
$ file_name = FileSlotName(i, columns * rows)
$ file_time = FileTime(i, empty=_("Empty Slot."))
$ save_name = FileSaveName(i)
$ infotext = file_name+'. '+file_time+'\n'+save_name
button:
action FileAction(i)
hovered tt.Action((infotext, FileScreenshot(i)))Code: Select all
frame:
align (0.1, 0.9)
has vbox
text tt.value[0]
add tt.value[1]Code: Select all
init -2 python: #we initialize x and y, so the load_save_slot screen below works at startup
x=32
y=32
screen load_save_slot:
add FileScreenshot(number) xpos x ypos y
screen save:
tag menu
add "image/ui/saveload/s_back30.png"
use file_picker
screen load:
tag menu
add "image/ui/saveload/l_back30.png"
use file_picker
screen file_picker:
default tt = Tooltip(("", Null()))
# Each file slot is a button.
$ file_name = FileSlotName(i, columns * rows)
$ file_time = FileTime(i, empty=_("Empty Slot."))
$ save_name = FileSaveName(i)
$ infotext = file_name+'. '+file_time+'\n'+save_name
imagebutton auto "image/ui/saveload/stuff_%s.png" xpos 32 ypos 32 focus_mask None action FileAction(1) hovered tt.Action((infotext, FileScreenshot(i)))
use load_save_slot(number=1, x=32, y=32)
imagebutton auto "image/ui/saveload/stuff_%s.png" xpos 138 ypos 32 focus_mask None action FileAction(2) hovered tt.Action((infotext, FileScreenshot(i)))
use load_save_slot(number=2, x=138, y=32)
imagebutton auto "image/ui/saveload/stuff_%s.png" xpos 244 ypos 32 focus_mask None action FileAction(3) hovered tt.Action((infotext, FileScreenshot(i)))
use load_save_slot(number=3, x=244, y=32)
imagebutton auto "image/ui/saveload/stuff_%s.png" xpos 350 ypos 32 focus_mask None action FileAction(4) hovered tt.Action((infotext, FileScreenshot(i)))
use load_save_slot(number=4, x=32, y=32)
imagebutton auto "image/ui/saveload/stuff_%s.png" xpos 456 ypos 32 focus_mask None action FileAction(5) hovered tt.Action((infotext, FileScreenshot(i)))
use load_save_slot(number=5, x=32, y=32)
frame:
align (0.1, 0.9)
has vbox
text tt.value[0]
add tt.value[1]Code: Select all
While running game code:
File "game/screens.rpy", line 694, in execute
screen load:
File "game/screens.rpy", line 697, in execute
use file_picker
File "game/screens.rpy", line 699, in execute
screen file_picker:
File "game/screens.rpy", line 702, in execute
$ file_name = FileSlotName(i, columns * rows)
File "game/screens.rpy", line 702, in <module>
$ file_name = FileSlotName(i, columns * rows)
NameError: name 'i' is not definedCode: Select all
screen file_picker():
default tt = Tooltip(("", Null()))
frame:
style "file_picker_frame"
# ADD HERE THE POSITIONAL PROPERTIES
has vbox
# The buttons at the top allow the user to pick a
# page of files.
hbox: # MAYBE YOU DON'T NEED THIS HBOX WITH THESE BUTTONS
style_group "file_picker_nav"
textbutton _("Previous"):
action FilePagePrevious()
textbutton _("Auto"):
action FilePage("auto")
textbutton _("Quick"):
action FilePage("quick")
for i in range(1, 9):
textbutton str(i):
action FilePage(i)
textbutton _("Next"):
action FilePageNext()
$ columns = 2 # YOUR GRID HAS 5 COLUMNS AND 6 ROWS
$ rows = 5
# Display a grid of file slots.
grid columns rows:
transpose True
xfill True
style_group "file_picker"
# Display ten file slots, numbered 1 - 10.
for i in range(1, columns * rows + 1):
# Each file slot is a button.
$ file_name = FileSlotName(i, columns * rows)
$ file_time = FileTime(i, empty=_("Empty Slot."))
$ save_name = FileSaveName(i)
$ infotext = file_name+'. '+file_time+'\n'+save_name
button:
action FileAction(i)
hovered tt.Action((infotext, FileScreenshot(i)))
xfill True
has hbox
# Add the screenshot.
add FileScreenshot(i)
text "[file_name]. [file_time!t]\n[save_name!t]" # DELETE THIS
key "save_delete" action FileDelete(i)
frame:
align (0.1, 0.9) # <- Change this position to fit yours
has vbox
text tt.value[0]
add tt.value[1]
Code: Select all
$ columns = 2
$ rows = 5
Code: Select all
init python:
config.thumbnail_width = 104
config.thumbnail_height = 71
screen file_picker():
default tt = Tooltip((Null(), "", "", ""))
hbox:
xysize (600, 550)
pos (25, 25)
box_wrap True
for i in range(1, 31):
# Each file slot is a button.
$ file_name = FileSlotName(i, 30)
$ file_time = FileTime(i)
$ save_name = FileSaveName(i)
$ slot_foot = str(i)
if len(slot_foot) < 3:
$ slot_foot = '0' + slot_foot
if len(slot_foot) < 3:
$ slot_foot = '0' + slot_foot
$ slot_foot = "No " + slot_foot
vbox:
button:
left_padding 2
right_padding 2
xysize (110, 75)
background None
hover_background "#f00"
action FileAction(i)
hovered tt.Action((FileScreenshot(i), slot_foot, file_time, save_name))
xfill True
has vbox
# Add the screenshot.
if file_time:
add FileScreenshot(i) xalign .5
else:
add Solid("#900", xysize=(110, 75)) # HERE THE IMAGE OF THE EMPTY SLOT
key "save_delete" action FileDelete(i)
text slot_foot xalign .5 size 15
vbox:
xsize 200
pos (600, 100)
add tt.value[0] xalign .5
text tt.value[1] # ADD POSITIONAL VALUES TO THESE
text tt.value[2]
text tt.value[3] size 15
screen save():
tag menu
add "image/ui/saveload/s_back30.png"
use file_picker
screen load():
tag menu
add "image/ui/saveload/l_back30.png"
use file_picker
Code: Select all
add Solid("#900", xysize=(110, 75)) # HERE THE IMAGE OF THE EMPTY SLOTCode: Select all
default tt = Tooltip((Null(), "", "", "", Null())) # adds a black border on top of the right-hand FileScreenshot,
$ borderblack = "image/ui/saveload/borderblack.png" # they were in the original game so we added them, though they're useless
hbox:
xysize (600, 550)
pos (30, 30)
spacing 0
box_wrap True
if int(persistent._file_page) == 1:
$ page_sl1 = 1 # There's only 2 file pages, with 30 slots each.
$ page_sl2 = 31 # 1rst page goes from save n°01 to n°30.
else:
$ page_sl1 = 31
$ page_sl2 = 61 # 2nd page goes from save n°31 to n°60.
for i in range(page_sl1, page_sl2):
# Each file slot is a button.
$ file_name = FileSlotName(i, 30)
$ file_time = FileTime(i, format='%d/%m/%Y %H:%M')
$ slot_foot = str(i)
if len(slot_foot) < 3:
$ slot_foot = '0' + slot_foot
if len(slot_foot) < 3:
$ slot_foot = '0' + slot_foot
$ slot_foot = "No." + slot_foot
$ save_name = FileSaveName(i)
vbox:
spacing 0
button:
left_padding 2
right_padding 2
top_padding 2
bottom_padding 2
left_margin 0
right_margin 0
top_margin 0
bottom_margin 0
xysize (104, 79)
background None
hover_background "image/ui/saveload/borderred.png"
action get_save_name(i) #asks the player to name the save, coded somewhere else.
hovered tt.Action((FileScreenshot(i), slot_foot, file_time, save_name, borderblack)) #save_name shows the saved text
xfill True
add FileScreenshot(i)
key "save_delete" action FileDelete(i)
key "K_BACKSPACE" action FileDelete(i)
null height 11 width 106
add tt.value[0] xpos 625 ypos 155
add tt.value[4] xpos 625 ypos 155
vbox:
xsize 150
pos (600, 175)
text tt.value[1] ypos 80 size 15
text tt.value[2] ypos 80 size 15
text tt.value[3] xpos 5 ypos 83 size 12
Users browsing this forum: Bing [Bot], Google [Bot]