WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Problem with Actionbar Script (https://www.wowinterface.com/forums/showthread.php?t=56481)

sivo 08-01-18 09:10 AM

Problem with Actionbar Script
 
Hey,
first of all the Script:
Code:

local Frame = CreateFrame('Frame', nil, UIParent)

local function test()

        local HiddenFrame = CreateFrame('Frame', nil, UIParent)
        HiddenFrame:Hide()
        MainMenuBar:SetParent(HiddenFrame)
       
        local ActionbarFrame = CreateFrame('Frame', nil, UIParent)       
        ActionbarFrame:SetPoint("BOTTOM", UIParent, "BOTTOM")
        ActionbarFrame:SetSize(50,50)       
        ActionbarFrame:Show()

        local function move(frame,anchorPoint,relativeTo,relativePoint,xoff,yoff)
                frame:ClearAllPoints()
                frame:SetParent(ActionbarFrame)       
                frame:SetPoint(anchorPoint,relativeTo,relativePoint,xoff,yoff)
        end
        move(ActionButton1,"BOTTOM",ActionbarFrame,"BOTTOM",-220,20)
        move(MultiBarBottomLeftButton1,"BOTTOMLEFT",ActionButton1,"TOPLEFT",0,6)
        move(MultiBarBottomRightButton1,"BOTTOMLEFT",MultiBarBottomLeftButton1,"TOPLEFT",0,6)

        for _,bar in pairs({"ActionButton","MultiBarBottomLeftButton","MultiBarBottomRightButton"}) do
                for i=2,12 do
                        move(_G[bar..i],"LEFT",_G[bar..(i-1)],"RIGHT",4,0)
                end
        end
end

local function HandleEvents (self, event, ...)
        if (event == 'PLAYER_ENTERING_WORLD') then
                test()
    end
end

Frame:RegisterEvent('PLAYER_ENTERING_WORLD')
Frame:SetScript('OnEvent', HandleEvents)

Now is my problem that the spells repeat in each bar. A picture to make it easier: https://i.imgur.com/nH1U0xz.png ...

i have tried this on other similar ways but it always looks the same...

MunkDev 08-01-18 11:42 AM

I'd guess the regular action buttons grab their page number from their parent. It's probably defaulting to action bar 1. If you want to use those buttons and refrain from creating your own, it might be a good idea to create one bar frame for each row of buttons.
Lua Code:
  1. parent:SetAttribute("actionpage", num)
This also means that paging on your main action bar won't work unless you use a SecureHandlerStateTemplate with a macro condition to evaluate which action page to show.


All times are GMT -6. The time now is 04:51 AM.

vBulletin © 2018, Jelsoft Enterprises Ltd
© 2004 - 2017 MMOUI