Jump to content
Sign in to follow this  
VictorFarbau

Button sounds in dialogs

Recommended Posts

As it happens I am now creating a mini GUI for my VFAI addon. Actually, I was hoping the dialog would a no-brainer (never looked at Arma dialogs before).

All works fine, but I never hear any button sounds. I was using the default code template from BIS which specifies this for a CT_BUTTON type:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> soundEnter[] = {"\ca\ui\data\sound\mouse2", 0.2, 1};

soundPush[] = {"\ca\ui\data\sound\new1", 0.2, 1};

soundClick[] = {"\ca\ui\data\sound\mouse3", 0.2, 1};

soundEscape[] = {"\ca\ui\data\sound\mouse1", 0.2, 1};

Doesn't work. I looked at other addons (good old Troopmon, EMSI_UAV_management) that use the same code templates, same effect, no button sounds. Then I tried custom sounds (wss and ogg) using different syntactial methods including hyphens and no hyphens:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">soundEnter[] = {"\testaddon\snd\on.wss", 1, 1};

soundEnter[] = {"\testaddon\snd\on.ogg", 1, 1};

soundEnter[] = {"\testaddon\snd\on", 1, 1};

No luck either. Any hot tips to make the GUI responsive in terms of sound? I presume I don't need to define CfgSound classes in the config.cpp in order to use these right?

Thanks,

VictorFarbau

Share this post


Link to post
Share on other sites

So you use RscButton as a base class for your buttons and still no sound?

Share this post


Link to post
Share on other sites

Hi Q,

well, now I do  smile_o.gif Alas, same difference confused_o.gif

Being a good boy I import

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class RscButton {}; in my config.cpp.

EDIT: well assuming that RscButton is a valid parent class of ARMA already...? I did not care about inheritance optimization so far either. But I want SOUND smile_o.gif/EDIT

My example button looks like this now

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class option1: RscButton {

idc = -1;

type = CT_BUTTON;

style = ST_CENTER;

x = (vfaictlx + 0.01); y = (vfaictly + (vfaictldist*2));

w = ((vfaictlw/2) - 0.02); h = 0.035;

font = FontM;

sizeEx = 0.024;

colorText[] = {1, 1, 1, 1};

colorFocused[] = {0,0.8,0,0.5};   // border color for focused state

colorDisabled[] = { 0, 0, 1, 0.7 };   // text color for disabled state

colorBackground[] = { 1, 1, 1, 0.1 };

colorBackgroundDisabled[] = { 1, 1, 1, 0.5 };   // background color for disabled state

colorBackgroundActive[] = { 1, 1, 1, 0.5 };   // background color for active state

offsetX = 0.003;

offsetY = 0.003;

offsetPressedX = 0.002;

offsetPressedY = 0.002;

colorShadow[] = {0, 0, 0, 0};

colorBorder[] = {0, 0, 0, 0};

borderSize = 0;

soundEnter[] = {"\ca\ui\data\sound\mouse2", 0.15, 1};

soundPush[] = {"\ca\ui\data\sound\new1", 0.15, 1};

soundClick[] = {"\ca\ui\data\sound\mouse3", 0.15, 1};

soundEscape[] = {"\ca\ui\data\sound\mouse1", 0.15, 1};

action = "dummy = [] execVM ""\VFAI_ControlPanel\function\enable_eqai.sqf"";";

text = "Enable Equipment.AI";

};

It all works and displays fine but no sound whatsoever. Actually, I was looking at many different examples using dialogs. They all seem to be based on the BIS example - and none of them has any sound, regardless if I reference Arma engine sounds or my own.

Needless to say the same sounds work fine in the editor when used in a description.ext "CfgSounds" section.

Have you come across any dialog that produces any sound by chance? I'd really be eager to study the config.cpp of that one then. All the ones I could find are silent.

Thanks,

VictorFarbau

Share this post


Link to post
Share on other sites

Can you please post the whole config in http://pastebin.com/.

Inheritance should look like this:

Quote[/b] ]class RscButton;

Share this post


Link to post
Share on other sites

With pleasure: http://pastebin.com/m68cf3e2f

Don't take that "class RscDialog {};" too serious, I have tried without before with the same result. Something is just fundamentally wrong. Also, arma.rpt reveals no hidden quirks as I see it.

Thanks,

Victor

Share this post


Link to post
Share on other sites

I did the CWR UI with working sound afaik. Can't remember that I did anything special to get the sound working.

Share this post


Link to post
Share on other sites

I'll have a look at the CWR mod rightaway, thanks T_D. EDIT: was I too fast? Seems like the mod has not been released yet.

The quest continues whistle.gif

Cheers,

VictorFarbau

Share this post


Link to post
Share on other sites

Solved. Using the CWR demo and my headphones I could hear some very remote dialog sounds. I have a hunch that something screwed up my volume levels (probably some recent BSOD I had when playing Arma). I had to remove my Arma.cfg file and move all volume sliders down and up again. After this "reset" I hear all the sounds fine now. So my fault, solved. Has only cost me hours of troubleshooting. Thanks for the support though, appreciated biggrin_o.gif

Cheers,

VictorFarbau

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×