Loading...

Editing Actionbar problem

#1
So i've been messing around with the actionbar layout for a while now and I have managed to turn the 6x2 left and right bars into 1 9x1 but it seems to be a quickfix version tho, atm the first time I log in my bars look like this until i press the hide top row button then the backdrop is back to normal.
Image
Back to how it should be
Image

Image
The code im using:

Code: Select all

local T, C, L = Tukui:unpack()

if (C["ActionBars"].Layout2) then
	local Panels = T.Panels
	local ActionBars = T.ActionBars
	local Num = NUM_ACTIONBAR_BUTTONS
	local Size = C.ActionBars.NormalButtonSize
	local Spacing = C.ActionBars.ButtonSpacing
	
	hooksecurefunc(ActionBars, 'CreateBar2', function()
		local Size = C.ActionBars.NormalButtonSize
		local Spacing = C.ActionBars.ButtonSpacing
		local ActionBar2 = Panels.ActionBar2

		for i = 1, NUM_ACTIONBAR_BUTTONS do
			local Button = _G["MultiBarBottomLeftButton"..i]
			local PreviousButton = _G["MultiBarBottomLeftButton"..i-1]

			Button:Size(Size)
			Button:ClearAllPoints()
			Button.noGrid = false
			Button:SetAttribute("showgrid", 1)

			if (i == 1) then
				Button:SetPoint("BOTTOMRIGHT", ActionBar2, -Spacing, Spacing)
				
				ActionBar2:SetWidth((Button:GetWidth() * 9) + (Spacing * 10))
				ActionBar2:SetHeight((Button:GetWidth() * 1) + (Spacing * 1))
			elseif (i == 10) then
				Button:SetPoint("TOPRIGHT", ActionBar2, -Spacing, -Spacing)
			else
				Button:SetPoint("RIGHT", PreviousButton, "LEFT", -Spacing, 0)
			end

			ActionBar2["Button"..i] = Button
		end

		for i = 7, 12 do
			local Button = _G["MultiBarBottomLeftButton"..i]
			local Button1 = _G["MultiBarBottomLeftButton1"]

			Button:SetFrameLevel(Button1:GetFrameLevel() - 2)
		end
		
	end)

	hooksecurefunc(ActionBars, 'CreateBar3', function()
		local Size = C.ActionBars.NormalButtonSize
		local Spacing = C.ActionBars.ButtonSpacing
		local ActionBar3 = Panels.ActionBar3

		for i = 1, NUM_ACTIONBAR_BUTTONS do
			local Button = _G["MultiBarBottomRightButton"..i]
			local PreviousButton = _G["MultiBarBottomRightButton"..i-1]

			Button:Size(Size)
			Button:ClearAllPoints()
			Button.noGrid = false
			Button:SetAttribute("showgrid", 1)

			if (i == 1) then
				Button:SetPoint("BOTTOMLEFT", ActionBar3, Spacing, Spacing)
				
				ActionBar3:SetWidth((Button:GetWidth() * 9) + (Spacing * 10))
				ActionBar3:SetHeight((Button:GetWidth() * 1) + (Spacing * 1))
			elseif (i == 10) then
				Button:SetPoint("TOPLEFT", ActionBar3, Spacing, -Spacing)
			else
				Button:SetPoint("LEFT", PreviousButton, "RIGHT", Spacing, 0)
			end

			ActionBar3["Button"..i] = Button
		end

		for i = 7, 12 do
			local Button = _G["MultiBarBottomRightButton"..i]
			local Button1 = _G["MultiBarBottomRightButton1"]

			Button:SetFrameLevel(Button1:GetFrameLevel() - 2)
		end
		
	end)

	function ActionBars:HideTopButtons()
		local Bar2 = T.Panels["ActionBar2"]
		local Bar3 = T.Panels["ActionBar3"]


		Bar2:Height((MultiBarBottomLeftButton1:GetWidth() * 1) + (C.ActionBars.ButtonSpacing * 2))
		Bar3:Height((MultiBarBottomRightButton1:GetWidth() * 1) + (C.ActionBars.ButtonSpacing * 2))
	end

	function ActionBars:ShowTopButtons(bar)
		local Button
		local Value = bar.NextColumnToHide or 10


		bar:Height((MultiBarBottomLeftButton1:GetWidth() * 1) + (C.ActionBars.ButtonSpacing * 2))
		bar:Height((MultiBarBottomRightButton1:GetWidth() * 1) + (C.ActionBars.ButtonSpacing * 2))
	end
end
If someone could find what i've done wrong or need to that would be great xd

Editing Actionbar problem

#3
I'm not at home right now, check the actionbar code for MaxUI, I did a lot of different layouts and changes to the actionbars.
It has some examples how I recoded the actionbars.

https://www.tukui.org/addons.php?id=106, maybe this helps?

I guess you don't want to show the fourth bar, that's actionbar4 I think. The background of actionbar1 is actually the actionbar4 background but 2 buttonsizes high. If you don't want it to show, you need to kill/remove/hide actionbar4. clicking the expand button shows actionbar 4 and it's background or hides it.
Maximvs-Aszune, MaxUI

Editing Actionbar problem

#4
Ah nice, I'll have a look and see what I can learn, I didnt't find the part of the code that messed with the backdrop, probably didnt look hard enough, gonna look abit more.

What i'd really would want to do is to separate each actionbar so that they each have a backdrop so that I have full control for each bar (can show/hide the backdrop if i want, decide how many buttons/rows and so on) but i'll have to learn some more lua first before I go all crazy with the actionbars.

Atm the goal is to get a less glitchy version of the bar layout I have managed to make so that I can feel happy enuff with the edit, to share it and after that work on some additions (so many ideas....)

Who is online

Users browsing this forum: No registered users and 1 guest