Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
Exiscoming
- Regular
- Posts: 127
- Joined: Tue Apr 29, 2014 5:37 pm
-
Contact:
#1
Post
by Exiscoming » Wed Sep 02, 2020 10:47 am
So I've got a drop down menu and it's working fine. However, whenever you select an option, it becomes greyed out. Making players think the option is disabled eventhough it's not. Renpy automatically seems to remember what item was selected last and assign a new color to it. Is there a way to change this?
I'm using a
textbutton for this.
Here's the code:
Code: Select all
screen bagInteractGadgets:
modal True
default x = renpy.get_mouse_pos()[0]
default y = renpy.get_mouse_pos()[1]
frame:
pos (x - 253, y + 15)
has vbox
textbutton "Hypno Earrings":
action Hide("bagInteractGadgets"), SetVariable("gadgetUsed", 1), Jump("gadgetUsed")
textbutton "Distraction Powder":
action Hide("bagInteractGadgets"), SetVariable("gadgetUsed", 2), Jump("gadgetUsed")
textbutton "Flashbang Belt":
action Hide("bagInteractGadgets"), SetVariable("gadgetUsed", 3), Jump("gadgetUsed")
textbutton "AC Drone":
action Hide("bagInteractGadgets"), SetVariable("gadgetUsed", 4), Jump("gadgetUsed")
textbutton "Cancel":
action Hide("bagInteractGadgets")
-
Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
-
Contact:
#2
Post
by Remix » Wed Sep 02, 2020 11:10 am
It greys them out because it recognizes them as selected (due to the SetVariable already being the value it will be set to)
You could either reset gadgetUsed to zero when showing the screen or add selected False to each button
-
Exiscoming
- Regular
- Posts: 127
- Joined: Tue Apr 29, 2014 5:37 pm
-
Contact:
#3
Post
by Exiscoming » Wed Sep 02, 2020 11:17 am
Remix wrote: ↑Wed Sep 02, 2020 11:10 am
It greys them out because it recognizes them as selected (due to the SetVariable already being the value it will be set to)
You could either reset gadgetUsed to zero when showing the screen or add
selected False to each button
Thanks, I'll try that!
Users browsing this forum: Bing [Bot], Google [Bot]