Thread Tools Display Modes
08-01-18, 09:10 AM   #1
sivo
A Kobold Labourer
Join Date: Aug 2018
Posts: 1
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...
  Reply With Quote
08-01-18, 11:42 AM   #2
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
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.
__________________

Last edited by MunkDev : 08-01-18 at 11:44 AM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Problem with Actionbar Script

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