+ Reply to Thread
Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By caels

Thread: Native Events

  1. #1
    Join Date
    Jan 2018

    Default Native Events

    I've done some tinkering around to try and figure out how to make native events fire properly, and this is what I've learned.

    In my trials, I've been using the guild bank window.

    Events that work without problems:

    Events that require finagling (more on this following):

    I did not test Event:Strata()

    Now, the finagling...

    I used the Event:Loaded() to attach/detach Move() events.

    function UI.Native.BankGuild.Event:Loaded()
        if self:GetLayer() > -1 then
    	self.Event.Move = nil
    	self.Event.Move = function(handle, args)
    	    print("Move --> handle: " .. tostring(handle) .. ", args: " .. tostring(args))
    Upon attachment, the dump of UI.Native.BankGuild.Event reveals the following:
    Layer = nil
    Loaded = nil --[[function: 0x156ee560]]
    Move = nil --[[function: 0xcfe18]]
    Size = nil
    Strata = nil

    So far, so good... but, as most addon developers probably know, nothing happens to fire off the move event at this point.

    I discovered on accident how to change that. Before the move event will trigger, another Native window has to be opened, moved, then closed. Once the second native window is closed, the Move() and Size() events will both begin to trigger for the Guild Bank. Also, the GetTop(), GetLeft(), GetBottom(), and GetRight() functions will now return the offset properly, though the GetBounds() will only return the Left coordinate.

    I have tested this using both the minion window and the character window.

    Unfortunately, closing the Guild Bank resets the issue, so every time you need the position of the native window, you have to open another, move it, and close it.

    Next I intend to try doing the finagling automatically, and will report my findings. I hope this information of use to other developers. If a Rift dev happens to take interest, can you please tell us why this is so, or put up a bug report if not already done so?

    My thanks for your attention.

  2. #2
    Join Date
    Jan 2018


    Additional note:

    If you simply move an open inventory bag, the Move() and Size() events start firing without having to open/move/close another native window.

    Alternatively, you can split a stack of items, or at least begin to split, then cancel. Sadly, utilizing Command.Item.Split() does not force the update (likely because it does not show the Native split popup)

    Follow up on first post:

    Since there seems to be no way to move any of the Native windows programmatically, I currently have no acceptable alternative to the manual method.
    Last edited by caels; 01-04-2018 at 09:32 PM.

+ Reply to Thread


Posting Permissions

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