I'm working with a modified load/ave game screen, and have added some icons to place behind some tuple string entries that have been added to FileSaveName.
First question:
I'd like to only have my screenshot_overlay.png (the graphic that has all of the icons for the numbers I'm displaying in the save slot) only show up in 'occupied' save slots. I have this graphic appearing on top of the FileScreenshot(i) pic in each save slot (so if there are 10 slots, it appears 10 times), but of course it is also appearing on top of the empty save slots. What would be the proper way to code a chedk for 'if save/load slot is occupied, add screenshot_overlay.png, else (nothing happens)?
This question also applies to some text strings that I'm placing on top of the screenshot overlay (the overlay provides pretty background icons for the numbers to be placed on top of), so I plan to use use the 'if load/save slot not empty' check here as well, or just assign all of them to the same 'if' check.
------
Secondly, I have four values which have been added to FileSaveName as a set. I have a fifth value that I'd like to add to the string set, but only for FileSaveName strings which do not have the fifth value.
Here's the init python code I have which is currently checking older saves for data, and it adds placeholder info to the string sets which don't have the separator. I've commented out the attempted code check that didn't work out for me, I was attempting to temporarily assign 'Day ?' to the output variable if the fifth string slot was empty, although I also need to know how to check the strings in order to assign a fifth value if it's not there already:
%@ is the separator that is being used between each of the values in the string, for FileSaveName(number) strings that have more than one value included.
Code: Select all
init python:
def info_string_save(data):
if '%@' in data:
#if len(FileSaveName(number)) > 4:
# s_description, disp_might, disp_dex, disp_con, disp_day = data.split('%@', 4)
#else: line below needs indent if comment out is removed.
sgame_description, disp_might, disp_dex, disp_con = data.split('%@', 3)
disp_day = 'Day ?'
else:
disp_might = '?'
disp_dex = '?'
disp_con = '?'
disp_day = 'Day ?'
s_description ='None'
return (s_description, disp_might, disp_dex, disp_con, disp_day)