I want to switch out the profiles on the characters' birthdays. I guess I could create a new spot for the new profile for each year, but it'd be redundant to have the old profile still visible or lock it and have a bunch of locked images in front of the new ones.
Can someone please direct me so I can figure out how I would write the code so that the right profile is displayed in the right spot at the right time?
Code: Select all
init python:
gl = Gallery()
#The image I have programmed to display
gl.button("t1")
gl.condition("persistent.t12")
gl.image("t1.png")
#The image I want to display later in the same spot
#I'm thinking I probably want the new button to also be "t1" and not "t3", but
# for the sake of dividing them while writing the code, I did this.
gl.button("t3")
gl.condition("persistent.t34")
gl.image("t3.png")
screen gallery2:
tag menu
add "/gui/game_menu.png"
vpgrid:
cols 10
rows 2
spacing 5
draggable True
scrollbars "horizontal" yalign -0.5
xfill True
yfill False
#This is where I have the button made for persistent.t12
add gl.make_button("t1","t1.png", locked = "/gui/lock.png", xalign=0.5, yalign=0.5)
textbutton "Return" action Return() xalign 0.9 yalign 1.0
I don't remember what the error was, but it didn't work when I did it right in the add gl.make_button(...) or when I did it after the return button was added at the end of the code. I searched around the vpgrid documentation and just the general renpy documentation, but I couldn't find anything that I could get to work. I'm using a vpgrid, but I could not get the normal grid to understand what dimensions I was using.
If I can't directly replace the picture based on the condition, I would hope I would be able to delete the old profile out of the grid when it's not needed and have the new profile just at the end of the list. I just don't even know if this is possible right now.