Page 1 of 1
[Solved] config.menu_include_disabled only in some parts?
Posted: Tue May 07, 2019 2:28 pm
by Adrian_DVL
Hi mates!
Do you know if I can set the config.menu_include_disabled to True BUT keeping it False in some part of the games, like, for instance, a couple menus?
Thanks!
Re: config.menu_include_disabled only in some parts?
Posted: Tue May 07, 2019 2:50 pm
by nature1996
I'm not sure, but I think you can bypass this by using the sensitive key word instead of an if statement as such:
Code: Select all
button:
sensitive (#sensitive if True, else greyed out)
action (#what you want the button to do)
That will show the button in all condition, but you will only be able to interact with it if it is sensitive.
I'm not sure if that solve your problem, or is even related. If anything else, you can change the config variable on the go, but it might have unexpected result. The best way is to test it.
Re: config.menu_include_disabled only in some parts?
Posted: Tue May 07, 2019 3:30 pm
by Adrian_DVL
nature1996 wrote: ↑Tue May 07, 2019 2:50 pm
I'm not sure, but I think you can bypass this by using the sensitive key word instead of an if statement as such:
Code: Select all
button:
sensitive (#sensitive if True, else greyed out)
action (#what you want the button to do)
That will show the button in all condition, but you will only be able to interact with it if it is sensitive.
I'm not sure if that solve your problem, or is even related. If anything else, you can change the config variable on the go, but it might have unexpected result. The best way is to test it.
Nope, what you're suggesting just gives me control to choose if the player is able to press the button or not, independent of other conditions, but it's not what I'm trying to do.
My game, by default, has the config.menu_include_disabled on True, so that player can see all the options in a menu, greyed out or not depending if they can click it or not. Specifically, what I'm trying to make is a music room, which has buttons. Those buttons are greyed out if the player haven't listen to a track yet, due to the config variable. I want to make those buttons invisible until the player listens to the track at least once, but keeping the other menus and buttons greyed out when they have to be greyed out.
Re: config.menu_include_disabled only in some parts?
Posted: Tue May 07, 2019 3:38 pm
by nature1996
You could put config.menu_include_disabled on False and change all if cause to sensitive key word... or add this to your screen, it might work:
Code: Select all
screen Screen():
on "show" action SetVariable("config.menu_include_disabled", False)
on "hide" action SetVariable("config.menu_include_disabled", True)
Edit: you could also create a sub list with only the song that have been played, then use that one to print the button
Re: config.menu_include_disabled only in some parts?
Posted: Tue May 07, 2019 4:06 pm
by Adrian_DVL
nature1996 wrote: ↑Tue May 07, 2019 3:38 pm
You could put config.menu_include_disabled on False and change all if cause to sensitive key word... or add this to your screen, it might work:
Code: Select all
screen Screen():
on "show" action SetVariable("config.menu_include_disabled", False)
on "hide" action SetVariable("config.menu_include_disabled", True)
Edit: you could also create a sub list with only the song that have been played, then use that one to print the button
Setting those actions to the screen didn't work.
But you gave me an idea and I've managed to make buttons invisible if player haven't listened to a track by conditioning the buttons to an if renpy.seen_audio(), without having to set the config variable on False.
So thank you! This is solved!