Quantcast Help Figuring Out Moveing Action Bars - WoWInterface
Thread Tools Display Modes
08-16-19, 08:17 AM   #1
Dejablue
A Wyrmkin Dreamwalker
 
Dejablue's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 54
Help Figuring Out Moveing Action Bars

Hey guys. I have been moving the action bars for a long time, but this last patch, 8.2, seems to ahve broken moving action buttons 1 -12.

I have an addon, DejaView, that moves each set of bars, Action Buttons, multibar left and right, pet action buttons, stance buttons, etc. They all still work except for action buttons 1 - 12.

Here is a short 20 second video that shows me attaching MultiBarBottomLeftButton1 to a colored frame I made, mbars, and then freely moving it around where I want. In chat you can see that dragging has been triggered and then OnDragStop it gets the position of the frame.

Then I change it to ActionButton1 and show that it won't move, other buttons move around and the chat shows drag starts but no points are retrieved OnDragStop.

Below is a simple version of the code where I create the colored frame to attach the buttons to. Change the frame in the last three lines between MultiBarBottomLeftButton1 and ActionButton1 to see how they behave differently.

Any help is appreciated.

Cheers!

Code:
local mbars=CreateFrame("Frame", "mbars", UIParent)
    mbars:SetFrameStrata("HIGH")
    mbars:SetClampedToScreen(true)
    mbars:SetMovable(true)
    mbars:SetUserPlaced(true) 
    mbars:EnableMouse(true)
    mbars:RegisterForDrag("LeftButton")
    mbars:SetWidth(476)
    mbars:SetHeight(36)
    mbars:Show()		

    mbars:ClearAllPoints()		
    mbars:SetPoint("CENTER", "UIParent", "CENTER", 0, 0)
    
    mbars:SetScript("OnDragStart", function(self) 
        self:StartMoving() 
        self:SetUserPlaced(true)
        print("DragStart")
    end)
    
   
    mbars:SetScript("OnDragStop", function(self) 
        self:StopMovingOrSizing() 
        self:SetUserPlaced(false) 
        
        point, relativeTo, relativePoint, xOfs, yOfs = self:GetPoint()
            if ( relativeTo ) then
                relativeTo = relativeTo:GetName();
            else
                relativeTo = self:GetParent():GetName();
            end
    
        -- These are debugging messages for the frame points
        -- Un-comment them to help debug
        point = point
        relativeTo = relativeTo
        relativePoint = relativePoint
        xOffset = xOfs
        yOffset = yOfs
        print(point,relativeTo,relativePoint,xOffset,yOffset)--Debugging
    end)

local mbarsFS = mbars:CreateFontString("FontString","OVERLAY","GameTooltipText")
    mbarsFS:SetPoint("CENTER",mbars,"CENTER",0,0)
    mbarsFS:SetFont("Fonts\\FRIZQT__.TTF", 10, "THINOUTLINE")
    mbarsFS:SetText("mbars");
    mbarsFS:SetTextColor(1, 1, 1);
    
local dragTexture=mbars:CreateTexture(nil,"ARTWORK")
    dragTexture:SetAllPoints(mbars)
    dragTexture:SetColorTexture(0, 192, 255, 0.7)

    MultiBarBottomLeftButton1:ClearAllPoints()
    MultiBarBottomLeftButton1:SetParent(mbars)
    MultiBarBottomLeftButton1:SetPoint("BOTTOMLEFT",mbars,"BOTTOMLEFT",0,3)
  Reply With Quote
08-28-19, 03:33 AM   #2
sigz
A Kobold Labourer
AddOn Author - Click to view addons
Join Date: Aug 2019
Posts: 1
you should try mbars:SetAllPoints(UIParent); instead of mbars:SetPoint("CENTER", "UIParent", "CENTER", 0, 0), else your mbars frame will not have volume.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Help Figuring Out Moveing Action Bars

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off