[Solved]Bypassing imagebutton's hovred-action corelation under condition
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.
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.
[Solved]Bypassing imagebutton's hovred-action corelation under condition
Alright, I know the subject is unintelligible, but what I mean is some time ago I realized that if you put an imagebutton's 'action' under a condition, the 'hovered' statement is automatically locked under that condition aswell. Is there a way to bypass it? (without having to write another copy/paste part of the screen)
Last edited by Doeny on Wed Feb 14, 2024 5:22 pm, edited 1 time in total.
- m_from_space
- Miko-Class Veteran
- Posts: 975
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: Bypassing imagebutton's hovred-action corelation under condition
Not sure I'm following, you probably mean the "sensitive" property is related to the "action" property. Otherwise please provide an example!Doeny wrote: ↑Wed Feb 14, 2024 1:59 pm Alright, I know the subject is unintelligible, but what I mean is some time ago I realized that if you put an imagebutton's 'action' under a condition, the 'hovered' statement is automatically locked under that condition aswell. Is there a way to bypass it? (without having to write another copy/paste part of the screen)
Re: Bypassing imagebutton's hovred-action corelation under condition
m_from_space wrote: ↑Wed Feb 14, 2024 2:57 pmAlright, I'll just show it on a part of the code.Each line here is in fact longer, I just shortened them to don't make a big mess here. But what caught my attention is that if I don't have any e.g. wood, which is a condition above action, I can't hover over certain slots to trigger them.Code: Select all
vbox: for item in decor_list: if item.type == e_type and item.place == e_place and item.slot == 1: button: if e_place == 2: xpos 230 ypos 684 else: xpos 104 ypos 686 add item.img hovered [SetVariable("decor_selected", item), SetVariable("decor_name", item.name), Show("empty_mats_needed")] unhovered [SetVariable("decor_name", ""), Hide("empty_mats_needed")] if decor_upgrade == 0: if item.wood <= wood and item.rock <= rock and item.fabric <= fabric: if e_place == 1: action [SetVariable("wood", wood - item.wood), SetVariable("rock", rock - item.rock), SetVariable("fabric", fabric - item.fabric), Jump("start")] elif e_place == 2: action [SetVariable("wood", wood - item.wood), SetVariable("rock", rock - item.rock), SetVariable("fabric", fabric - item.fabric), Jump("start")] else: action [SetVariable("wood", wood - item.wood), SetVariable("rock", rock - item.rock), SetVariable("fabric", fabric - item.fabric), Jump("start")] else: action Function(renpy.notify, "You can't do that now.") if item.type == type and item.place == e_place and item.slot == 2: ..... ..... .....
- Ocelot
- Lemma-Class Veteran
- Posts: 2405
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Bypassing imagebutton's hovred-action corelation under condition
Button with no action is considered insensitive and does not respond to evens. You have to have an action to have a working button.
< < insert Rick Cook quote here > >
- m_from_space
- Miko-Class Veteran
- Posts: 975
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: Bypassing imagebutton's hovred-action corelation under condition
Ocelot already stated it and I want to make it clear: You always need an action inside a button, even if it doesn't do anything. So in case you have no wood etc. insert this:
Code: Select all
action NullAction()
Re: Bypassing imagebutton's hovred-action corelation under condition
Alright, got it. Thank you guys!m_from_space wrote: ↑Wed Feb 14, 2024 4:50 pmOcelot already stated it and I want to make it clear: You always need an action inside a button, even if it doesn't do anything. So in case you have no wood etc. insert this:
Code: Select all
action NullAction()
Who is online
Users browsing this forum: Google [Bot]