View Single Post
11-09-11, 04:36 PM   #510
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 124
Re-paranting a mac frame to eg. "MerchantFrame"

Hey!! First off, regarding the previous post, ofcourse you can!!! Mac has the profiles option. Save your current bar layout and button contents (by right clicking on the minimap button and picking "Profile"), log to a different toon, and load the profile you just saved. Easy!

Hi

Phanx, I saw your post on the Macaroon forums (pasted below). I've been looking for a very long time for a way to change the Parent of one of my Macaroon Bars ("MacaroonBars38" in this case) so that instead of it being the generic "UIParent", it's "MerchantFrame" instead.

Although I've been studying the layout of Lua over the last few days, I'm still not all that good at reading it. Is it possible for the code you wrote below to achieve what I'm looking for?

Ultimately, I'd like the bar to appear only when I open a merchant frame, and hide at all other times.

Any help you or anyone else could give on this would be hugely appreciated.

Thanks in advance!!!


Originally Posted by Phanx View Post
This works, and also lets you make any other aesthetic changes you want to Macaroon's buttons in the same place:

MacaroonCustom.toc
Code:
## Interface: 40200
## Dependencies: Macaroon

MacaroonCustom.lua
MacaroonCustom.lua
Code:
local Macaroon_SkinBar = Macaroon.SkinBar
Macaroon.SkinBar = function(bar, parent)
	Macaroon_SkinBar(bar, parent)
	if bar.config.buttonList then
		for _, btnIDList in pairs(bar.config.buttonList) do
			for btnID in btnIDList:gmatch("[^;]+") do
				local button = _G[bar.btnType .. btnID]
				if button then
					button.hotkey:SetFont("Interface\\AddOns\\Stuf\\media\\font1.ttf", 8, "OUTLINE, MONOCHROME")
					-- you can also change button.count and/or button.macroname
				end
			end
		end
	end
end
As a side note, font (or other file) paths begin with just "Interface", not "\\Interface".
__________________
__________________