I'm pretty sure my title doesn't even come CLOSE to accurately describing what I'm trying to do, but honestly I struggled to describe it properly in 10 words or less.
So here's the important bit of screen code
It works correctly (with one caveat). You can purchase the wallpapers in a separate store screen. If purchased, they show up here and you can assign them. If not purchased, it displays a "Not purchased" image, and the first option (persnum = 0), allows you to set the default (blank) image instead.
All of it works correctly - HOWEVER. What I haven't yet been able to figure out is this:
Currently, hitting next page cycles through the images, displaying a "Not purchased" image for any that haven't been bought yet. What I'd like it to do is just skip it entirely - so for example, if wallpaperbought_list[3],[5],[7] are bought, and all the rest aren't, I'd like it to cycle through those 3 via next/previous page, and not even trigger "not purchased" for 1,2,4,6,8,9,10.
Getting the top part of the display (the part where it actually displays the image) to do that is easy, the problem I'm running into is figuring out how to get the next/previous buttons to function that way.
In other words, in the above scenario (3,5,7 bought only), you open the screen at 0 (the default image). Hitting next, I'd like it to jump directly to 3, next again directly to 5, etc - this way I could skip the "not purchased" bit entirely.
Atm the only way I've come up with to accomplish that is terrible (basically a ton of if/elif/else statements, for each condition), and I'd rather keep it as is than do that.
So here's the important bit of screen code
Code:
if persnum == 0:
imagebutton:
idle "wallpapernone"
pos 900,350
action NullAction()
textbutton "Set Wallpaper":
style "quick_button"
pos 925,650
action SetVariable("phonebg","bgoff"), SelectedIf(credits==11919123129)
elif not persistent.wallpaperbought_list[persnum]:
imagebutton:
idle "notbought"
pos 900,350
action NullAction()
elif persistent.wallpaperbought_list[persnum]:
imagebutton:
idle "wallpaper" + str(persnum) + "ico"
pos 900,350
action Show('imagescrn',img="images/phone/wallpapers/wallpaper[persnum].webp")
textbutton "Set Wallpaper":
style "quick_button"
pos 925,650
action SetVariable("phonebgnum",persnum),SetVariable("phonebg","bgon"), SelectedIf(credits==11919123129)
hbox:
spacing 20
xpos 830
ypos 750
if persnum > 0:
textbutton "Prev. Page":
style "quick_button"
action SetVariable('persnum',persnum - 1), SelectedIf(credits==11919123129)
else:
fixed:
xysize 150,130
if persnum < 10:
textbutton "Next Page":
style "quick_button"
action SetVariable('persnum',persnum + 1), SelectedIf(credits==11919123129)
It works correctly (with one caveat). You can purchase the wallpapers in a separate store screen. If purchased, they show up here and you can assign them. If not purchased, it displays a "Not purchased" image, and the first option (persnum = 0), allows you to set the default (blank) image instead.
All of it works correctly - HOWEVER. What I haven't yet been able to figure out is this:
Currently, hitting next page cycles through the images, displaying a "Not purchased" image for any that haven't been bought yet. What I'd like it to do is just skip it entirely - so for example, if wallpaperbought_list[3],[5],[7] are bought, and all the rest aren't, I'd like it to cycle through those 3 via next/previous page, and not even trigger "not purchased" for 1,2,4,6,8,9,10.
Getting the top part of the display (the part where it actually displays the image) to do that is easy, the problem I'm running into is figuring out how to get the next/previous buttons to function that way.
In other words, in the above scenario (3,5,7 bought only), you open the screen at 0 (the default image). Hitting next, I'd like it to jump directly to 3, next again directly to 5, etc - this way I could skip the "not purchased" bit entirely.
Atm the only way I've come up with to accomplish that is terrible (basically a ton of if/elif/else statements, for each condition), and I'd rather keep it as is than do that.