Choice hover sound effect with arrow keys #852
-
I asked this before but i wanted to know how I could make the choice hover sound effect work with the arrow keys instead of the mouse. I know it’s something I would need to code, but I don’t know where to start... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi you will find all the relevant functions in the DialogNode, which is massive, so it's very understandable you didn't know where to begin. The function that calls the sound is the You will want to call this function when the button get's focused, so you will want to connect the buttons 'focus_entered' signal to that function when the choice button is created. You can do so in the It should look something like this I think: Hope this helps. |
Beta Was this translation helpful? Give feedback.
Hi you will find all the relevant functions in the DialogNode, which is massive, so it's very understandable you didn't know where to begin.
The function that calls the sound is the
_on_option_focused
function (around line 1220).You will want to call this function when the button get's focused, so you will want to connect the buttons 'focus_entered' signal to that function when the choice button is created.
You can do so in the
add_choice_button
function (around line 1170 or so).It should look something like this I think:
button.connect('focus_entered', self, '_on_option_focused')
Hope this helps.