- Joined
- Apr 5, 2020
- Messages
- 36
I tried to find out information about whether it is possible to track the click on the item frame (BlzGetOriginFrame (ORIGIN_FRAME_ITEM_BUTTON, X), where X = 0-5 - item frames), but I could not find information about how someone could do it. Is it possible?
From what I was able to figure out ORIGIN_FRAME_ITEM_BUTTON is SIMPLEBUTTON and among all events it only responds to FRAMEEVENT_CONTROL_CLICK. I tried doing some test code for this, but it gave no results (I tested on the frame of the first item in the inventory.):
I assumed this was not the frame I wanted. But I created a trigger that moved the position of the frame and it worked correctly - the item's frame was moved.
From what I was able to figure out ORIGIN_FRAME_ITEM_BUTTON is SIMPLEBUTTON and among all events it only responds to FRAMEEVENT_CONTROL_CLICK. I tried doing some test code for this, but it gave no results (I tested on the frame of the first item in the inventory.):
JASS:
function Trig_Frame_Detection_Actions takes nothing returns nothing
call BJDebugMsg("Work!")
call BJDebugMsg("GetTriggerPlayer: " + GetPlayerName(GetTriggerPlayer()))
endfunction
//===========================================================================
function InitTrig_Frame_Detection takes nothing returns nothing
set gg_trg_Frame_Detection = CreateTrigger()
call BlzTriggerRegisterFrameEvent( gg_trg_Frame_Detection, BlzGetOriginFrame(ORIGIN_FRAME_ITEM_BUTTON, 0), FRAMEEVENT_CONTROL_CLICK)
call TriggerAddAction( gg_trg_Frame_Detection, function Trig_Frame_Detection_Actions )
endfunction
I assumed this was not the frame I wanted. But I created a trigger that moved the position of the frame and it worked correctly - the item's frame was moved.