feat: Simple Sound module tibia 13 Qt #1098
Closed
+1,403
−79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The content of this PR is not intended to be merged. I don't use sounds, I don't use Tibia 13, and I don't know how the g_sound works. I just wanted to learn about the JSON from protobuf #1074
The sounds sent by the server work perfectly, but ambient or UI sounds don't work because I think it would be necessary to use onAddThing and onPositionChange to determine if the player is with in X sqm of the item emitting the sound.
For UI sounds:
I believe onTalk should be used
I don't know how to do it in an optimized way.
also
Since the server doesn't send that information, it's necessary to dive into the 16k-line JSON to find the sounds. 💀
"functional"
without client_options filters:
test in 13.40 (opentibiabr/canary#1017)
ENABLE sound of the video
2025-02-10.20-27-04.mp4
how does it work?
UI
callback
1) soundMain
Activates or deactivates this
2) soundMain and 3) enableSound
info of
ProtocolGame::parseMagicEffect(const InputMessagePtr& msg)
soundSource = Type of "numericSoundType"(protobuf)
SoundID = ID of "numericSoundEffect" (protobuf)
pos = position of effect
Example : Server send 2045
soundSource = 0 (used for filter in client_options)
SoundID =2045
pos = 100,100,7
New functions
devMode
modules.game_sound.toggleDebugMode()