+ Reply to Thread
Results 1 to 4 of 4

Thread: Drag Event?

  1. #1
    Soulwalker schneirw's Avatar
    Join Date
    Feb 2011
    Posts
    15

    Default Drag Event?

    Hello! I'm new to add-on development, but did a little of research and can't find too much information on drag events. Basically I want to be able to drag an item (loot) onto my addon window and have an event fire. Is this possible? Does Rift think you're "destroying" the item? If you can capture the event, can you get details on the what dropped?

    Thanks and sorry for this noobish question.
    Delleb of <Sacred Fire>

  2. #2
    RIFT Guide Writer Noshei's Avatar
    Join Date
    Feb 2011
    Posts
    1,886

    Default

    So what I do is watch for a couple of different things, I use the below to see when the mouse moves into my frame and check if it has an item held.

    Code:
    sendTab.Attach.Event.MouseIn = function()
    	local held,id = Inspect.Cursor()
    	if not held then return end
    	if held == "item" then
    		local item = Inspect.Item.Detail(id)
    	end
    end
    From here I now have the item information and can go from there, I store it into a table.

    Code:
    sendTab.Attach.Event.LeftUp = function()
    	Command.Cursor(nil)
    end
    So this will prevent the game from thinking you want to destory the item when the user "drops" it into your addon.

  3. #3
    Plane Walker Imhothar's Avatar
    Join Date
    Feb 2012
    Posts
    439

    Default

    The MouseIn thing is actually not necessary, as the cursor still cotains the item when Event.LeftUp is triggered, so you can get it fom there.
    Author of the Imhothar's Bags addon.

  4. #4
    Soulwalker schneirw's Avatar
    Join Date
    Feb 2011
    Posts
    15

    Default

    Most excellent. Thanks for the info!
    Delleb of <Sacred Fire>

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts