Addons & Mods Depot > Arma2 - Configs & Scripting

Adding Event Handler to Existing Dialog Control

(1/1)

JasonO:
Hi,

I'm working on a small addon as part of our mod to try and extend the options within the gear dialog (the screen to manage weapons etc when you press G).

What I want to do is add an "onMouseButtonDown" event handler so when each of the ammo/item slots is right clicked it runs a function. I managed to get it to work on the whole gear dialog but you could rightclick anywhere on the screen and it would always return the gear dialog IDD, not the IDC of the control its over.

I'm not too good with the inheritance part of the dialogs. I've managed to add my own controls to the gear dialog but modifying existing ones doesn't work out. My PBO is in a mod folder that is loaded after all my other addons. The fact the other controls are added to the gear dialog make me know that it is working somewhat.

All I've got in my controls is this:

--- Code: ---class CA_Gear_slot_item1
{
onMouseButtonDown = "hint str _this;";
};
--- End code ---

However the slots aren't doing anything when clicked.

Is there more to it than just redoing the controls classname and adding what I want to add?

Thanks for your help.

Jason

i0n0s:
*err*
What exactly do you want to achieve?
Since the controls do what they should do so far, at least from the description.

Navigation

[0] Message Index

Go to full version