New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sound to press events of some formspecs elements #10402
Conversation
A question: can sounds be played when any button is being at hovered state also (currently afaik only buttons support states)? |
No, for now it's just on clicks. But technically, nothing prevents that sort of addition. But this brings a new problem: sounds should be attached to events (enter, exit, click, release, ...) not states (pressed, hovered). So maybe the style states are not adapted to sounds. |
How does it work? I tried the following code but there's no sound: (devtest/testformspec)
If you have a working snippet, would you please be so nice to add it to devtest as well? |
You need to remove the “.ogg” part |
🤦 haha. Modder newbie mistakes do happen. Thanks, it works now just fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works \o/
@SmallJoker |
I wish I had been paying attention to this earlier, but I don't think this PR should have been merged in its present state. Since the sound only applies to press despite any states, it will be hard to change the behaviour without breaking compatibility. I'm also not too happy with the implementation as it puts more stuff in GUIFormSpecMenu. |
Nothing prevents you to revert since it's not released yet. |
This PR adds the possibility associate play sound to some formspecs client events (mouse clicks on items).
Sound is played by the client before any client-server-client dialog, avoiding any lag.
Sounds are fetched:
To do
This PR is Ready for Review
How to test
Try this formspec using minetest_game: