FOnline Development > Questions and Answers

GUI sounds

(1/1)

hexer:
I've noticed how FOnline's GUI is relatively silent compared to Fallout 2's. When I click most buttons there's no sound coming out of my speakers. I would like to add back all the sounds that seem to be missing. Now is this a case of missing files, wrong configuration or those hardcoded screens are the issue?

Wipe:
It's just lack of implementation, but it's not a problem to add them back in scripts - i remember doing PoC for What Remains back in days.

In client scripts create "sound object" which acts as button, but does not have any graphic set (but still need width/height!) and never "steals" the click. When it's pressed, it simply calls PlaySound() and that's all.

Now for a scripted screens you just add such object to your button, and call sound-making function whenever it's pressed. As for hardcoded screens, you'd need first to collect all interesting you buttons - here's where GetIfaceIniStr() comes into play. Once you have all that, you create and adds our "sound object" to GUIScreen::Elements of hardcoded screens. As our object is scripted, its callback will be called as first. As it never "steals" the click, hardcoded screens will work as usual.

Not 100% sure how it would work with unmodified TLA GUI - i think this one had only mouse_up callback, and here for best results you'll need both, mouse_down and mouse_up.

hexer:
Great news and thanks for this PoC!

Navigation

[0] Message Index

Go to full version