Jump to content
Tova

Action on doubleClick for custom inventory item

Recommended Posts

Hello !

 

I already know that I can create a custom inventory item through a config.cpp this way thanks to@R3vo:

 

class CfgWeapons
{
    class ItemCore;
    class InventoryItem_Base_F;
    
    class MyItem: ItemCore
    {
        displayName = "Tova's cool item";
        model = "\A3\structures_f_epa\Items\medical\antibiotic_F";
        scope = 2;      
        scopeArsenal = 2;
        scopeCurator = 2;
        picture = "";
        descriptionShort = "This item is very cool";
        class ItemInfo: InventoryItem_Base_F
        {
            mass=5;
        };
    };
};

But I'd also like to execute a script when this I double click on that item in the inventory, however I don't know how I could do that...

 

NB : I believe it may have something to do with the "LBDblClick" eventhandler, but I have to say that I am clueless.

  • Like 1

Share this post


Link to post
Share on other sites
waituntil {!(isnull (finddisplay 602))};
{
((findDisplay 602) displayCtrl _x) ctrlSetEventHandler ["LBDblClick", "if (""<ITEM>"" == lbText [ctrlIDC (_this select 0), _this select 1]) then {execVM ""script.sqf""};"];
} count [633, 638, 619];

I think that should work. Found it on some skethcy forum and slightly modified it. 

  • Like 3

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

×