Code: Select all
define config.menu_include_disabled = True
Code: Select all
default button_presses = 0
label choice_test:
menu():
"How many times can you press the button? [button_presses] times pressed so far."
"Press the button.":
"You press the button!"
$button_presses++
jump choice_test
# I want this choice to be greyed out but visible, so the player knows
# if they press the button ten times, they will win a stuffed bunny.
"Collect the ten-button-press prize." if button_presses >= 10:
"You win a stuffed bunny!"
jump choice_test
# I want this choice to be invisible until the condition is met, so that
# the player does *not* know that they can win an orangutan if they
# keep pressing the button.
"Collect the hundred-button-press prize." if button_presses >= 100:
"Oh wow, you have won a live orangutan!"
jump choice_test
I think I can maybe see how I could do this by editing screens.rpy? If I were to attach some special string to menu item.caption, I could maybe skip drawing that particular menuitem, but this seems overly convoluted. Does there exist any more elegant way? I would love to be able to just add some flag to the menu choice that would specify whether it gets hidden when disabled or not.