View Single Post
09-23-13, 07:50 PM   #17
asett
A Defias Bandit
Join Date: Aug 2013
Posts: 2
Template Named: "MyCloseButtonTemplate"
In Lua:
Code:
NoTemplate = CreateFrame
CreateFrame = function(arg1,arg2,arg3,arg4,...)
if arg4 == "MyCloseButtonTemplate" then
	local x = NoTemplate(arg1,arg2,arg3,nil,...) 
	x:SetScript("OnClick", function(self) self:GetParent():Hide() end)
	x:SetNormalTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Up")
	x:SetPushedTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Down")
	x:SetHighlightTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Highlight")
	x:SetSize(32,32)
	x:SetFrameLevel(50);
	return x
else
return NoTemplate(arg1,arg2,arg3,arg4,...)
end
end
in XML

Code:
 <Button name="MyCloseButtonTemplate" virtual="true">
                <Size>
                        <AbsDimension x="32" y="32"/>
                </Size>
                <Scripts>
                        <OnClick>
                                HideUIPanel(this:GetParent());
                        </OnClick>
                </Scripts>
                <NormalTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Up"/>
                <PushedTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Down"/>
                <HighlightTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Highlight" alphaMode="ADD"/>
 </Button>
  Reply With Quote