This problem has been pestering me for quite a while now.
I added a new button to the main menu of my visual novel called "Developer".
By default, or whenever the player reaches a bad ending, if the button is clicked then it changes the background saying "Access Denied" and a single button at the bottom that leads back to the main menu.
But if the player reaches a good ending, the main menu remains the same, but now if the button is clicked it changes the background saying "Congratulations! I hope you enjoyed the game!" and a single button at the bottom to lead back to main menu.
I've been able to get the desired effect only when I set the main menu style to "default".
Is there any way to achieve this when the main menu style is "mm_root"?
I visited the following thread but it only enabled me to change the background of the main menu once the player reaches the good ending.
http://lemmasoft.renai.us/forums/viewto ... =8&t=22612
I'm posting the code of screens.rpy in which I've defined the main menu to be displayed after the good ending. The screens pertaining to the additional button "Developer" are labeled "DAM" (for godd ending) and "DAMN" (for bad ending).
Code: Select all
# Main Menu
#
# Screen that's used to display the main menu, when Ren'Py first starts
# http://www.renpy.org/doc/html/screen_special.html#main-menu
screen main_menu:
# This ensures that any other menu screen is replaced.
tag menu
if persistent.ending == "good"
use main_menu_1
# The background of the main menu.
window:
style "mm_root"
# The main menu buttons.
frame:
style_group "mm"
xalign .98
yalign .98
has vbox
textbutton _("Start Game") action Start()
textbutton _("Load Game") action ShowMenu("load")
textbutton _("Developer") action ShowMenu("DAMN")
textbutton _("Preferences") action ShowMenu("preferences")
textbutton _("Help") action Help()
textbutton _("Quit") action Quit(confirm=False)
init -2 python:
# Make all the main menu buttons be the same size.
style.mm_button.size_group = "mm"
########################################################
##Main Menu 1
screen main_menu_1:
tag menu
# The background of the main menu.
window:
style "dam"
# The main menu buttons.
frame:
style_group "mm"
xalign .98
yalign .98
has vbox
textbutton _("Start Game") action Start()
textbutton _("Load Game") action ShowMenu("load")
textbutton _("Preferences") action ShowMenu("preferences")
textbutton _("Help") action Help()
textbutton _("Quit") action Quit(confirm=False)
textbutton _("Developer") action ShowMenu("DAM")
init -2 python:
# Make all the main menu buttons be the same size.
style.mm_button.size_group = "mm"
########################################################
#DAMN
screen DAMN:
tag menu
window:
style "damn"
frame:
style_group "mm"
xpos 0.5 xanchor 0.0
ypos 0.9 yanchor 0.0
textbutton _("Main Menu") action ShowMenu("main_menu")
init -2 python:
# Make all the main menu buttons be the same size.
style.mm_button.size_group = "mm"
#######################################################
#DAM
screen DAM:
tag menu
window:
style "dam"
frame:
style_group "mm"
xpos 0.5 xanchor 0.0
ypos 0.9 yanchor 0.0
textbutton _("Main Menu") action ShowMenu("main_menu_1")
init -2 python:
# Make all the main menu buttons be the same size.
style.mm_button.size_group = "mm"
Is there any way to make it work with main_menu style "mm_root".
I'm also posting the code in options.rpy in which I've defined the styles "dam" and "damn".
Code: Select all
init python:
style.damn=Style(style.default)
style.damn.background="damn.jpg"
init python:
style.dam=Style(style.default)
style.dam.background="dam.jpg"Thank You.