• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Is it possible to track a click on an item frame?

Status
Not open for further replies.
Level 6
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.):

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.
 
Status
Not open for further replies.
Top