Multiple animated main menus using persistent data- SOLVED
Posted: Sun Mar 22, 2015 9:13 am
Okay, while I know how to change the menu using persistent data, what I don't know is how to give each menu their animated background.
The code I have at the moment (shortened for convenience) is as follows:
This is so that, in the options:
And in screens:
It's not returning an error- but it's not working in game, either.
Am I putting the 'if' wrong, by shoving it in the code?
Should I link to the 'slideshow' in the screens file?
I'm really lost.
I should also note the menu choice I'm using to test it goes like this:
I did that to try and make it easier for me to distinguish for my own use... It's a bit clutter-y now.
The code I have at the moment (shortened for convenience) is as follows:
Code: Select all
if persistent.ending1 == True:
image slideshow:
"1s5.png" with dissolve
pause 0.07
"1s6.png" with dissolve
pause 0.07
"1s7.png" with dissolve
pause 0.07
"1s8.png" with dissolve
pause 0.07
"1s5.png" with dissolve
pause 0.07
repeat
elif persistent.ending2 == True:
image slideshow:
"2s5.png" with dissolve
pause 0.07
"2s6.png" with dissolve
pause 0.07
"2s7.png" with dissolve
pause 0.07
"2s8.png" with dissolve
pause 0.07
"2s5.png" with dissolve
pause 0.07
repeat
else:
image slideshow:
"s5.png" with dissolve
pause 0.07
"s6.png" with dissolve
pause 0.07
"s7.png" with dissolve
pause 0.07
"s8.png" with dissolve
pause 0.07
"s5.png" with dissolve
pause 0.07
repeatCode: Select all
mm_root = "slideshow",Code: Select all
screen main_menu():
tag menu
if persistent.ending == "Ending 1":
use main_menu_1
elif persistent.ending == "Ending 2":
use main_menu_2
else:
use main_menu_default
screen main_menu_default:
tag menu
window:
style "mm_root"
frame:
style_group "mm"
xalign .5
yalign .95
has hbox
textbutton _("Load Game") action ShowMenu("load")
textbutton _("Start") action Start()
textbutton _("Preferences") action ShowMenu("preferences")
textbutton _("Quit") action Quit(confirm=False)
screen main_menu_1:
tag menu
window:
style "mm_root"
frame:
style_group "mm"
xalign .5
yalign .95
has hbox
textbutton _("Load Game") action ShowMenu("load")
if persistent.Understand:
textbutton _("I Understand") action Start("Understood")
else:
textbutton _("Try to Understand") action Start()
textbutton _("Preferences") action ShowMenu("preferences")
textbutton _("Quit") action Quit(confirm=False)
screen main_menu_2:
tag menu
window:
style "mm_root"
frame:
style_group "mm"
xalign .5
yalign .95
has hbox
textbutton _("Load Game") action ShowMenu("load")
textbutton _("Try Again") action Start()
textbutton _("Preferences") action ShowMenu("preferences")
textbutton _("Quit") action Quit(confirm=False)It's not returning an error- but it's not working in game, either.
Am I putting the 'if' wrong, by shoving it in the code?
Should I link to the 'slideshow' in the screens file?
I'm really lost.
I should also note the menu choice I'm using to test it goes like this:
Code: Select all
menu:
"No.":
$ persistent.ending = "Ending 1"
$ persistent.ending1 = True
jump good_ending
"Yes.":
$ persistent.ending = "Ending 2"
$ persistent.ending2 = True
$ persistent.Understand = True
jump bad_ending