Jump to content

GUI sound effects for non buttons


Duion

Recommended Posts

As I tried to add sound effects for my GUI items I found out that everything that is not from the button category cannot have sound effects.

This is because in the engine there is no function for it, even though you can set it in the ingame editor to have a sound.


Here is the source function that plays the sound for buttons:

https://github.com/GarageGames/Torque3D/blob/c83efa59e0a11fc15c68afaf106807643191ac6f/Engine/source/gui/buttons/guiButtonBaseCtrl.cpp#L255-L256

And here you see it is missing for other elements:

https://github.com/GarageGames/Torque3D/blob/c83efa59e0a11fc15c68afaf106807643191ac6f/Engine/source/gui/controls/guiPopUpCtrlEx.cpp#L1653


Before I start to fumble around I wanted to ask, if anyone already has implemented a similar feature or knows a good way to do it.

What would better, to add in in source code or through script? I would do it through script, since I'm not good at C++.


My thoughts were it would be nice to have additional functionality for more events, since in source I see a lot of callbacks, for mouse over, mouse down, mouse up, mouse leave etc, but by default only mouse over and mouse down for buttons have a sound effect added.

Would it be too much work? I would like that feature, but I do not plan on putting too much work into it, since it is a not so important feature for now.

So any ideas?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...