Hey, I'm trying to us a normal button in xml to swap an image in a frame. It just doesn't do anything OnClick. Any ideas please?
snippets:
XML Options Panel
Code:
<Button name="AquaBgButton" toplevel="true" enableMouse="true" text="Aqua Skin">
<Size>
<AbsDimension x="130" y="35" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="19" y="-55" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self:RegisterForClicks("LeftButtonUp", "RightButtonUp");
</OnLoad>
<OnClick>
DWMPackBaseFrame_OnClick(self);
</OnClick>
</Scripts>
<NormalTexture file="interface\glues\common\glue-panel-button-up-blue">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</NormalTexture>
<PushedTexture file="interface\glues\common\glue-panel-button-down-blue">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</PushedTexture>
<DisabledTexture file="Interface\Buttons\UI-Panel-Button-Disabled">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</DisabledTexture>
<HighlightTexture file="interface\glues\common\glue-panel-button-highlight-blue" alphaMode="ADD">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875" />
</HighlightTexture>
<ButtonText name="$parentText">
<FontHeight>
<AbsValue val="10" />
</FontHeight>
</ButtonText>
<NormalFont style="GameFontNormal" />
<HighlightFont style="GameFontHighlight" />
<DisabledFont style="GameFontDisable" />
<PushedTextOffset x="0" y="0" />
</Button>
Lua Base
Code:
local textureName, DWMBgTexture1, DWMBgTexture2, DWMBgTexture3, DWMBgTexture4, DWMBgTexture5, DWMBgTexture6;
function DWMPackBaseFrame_OnClick(self)
if ( AquaBgButton == "LeftButton" ) then
DWMBgTexture1:SetTexture(Texture1, "Interface\\AddOns\\DWMPack\\Skins\\Aqua-Panel_S1");
DWMBgTexture2:SetTexture(Texture2, "Interface\\AddOns\\DWMPack\\Skins\\Aqua-Panel_S2");
DWMBgTexture3:SetTexture(Texture3, "Interface\\AddOns\\DWMPack\\Skins\\Aqua-Panel_S3");
DWMBgTexture4:SetTexture(Texture4, "Interface\\AddOns\\DWMPack\\Skins\\Aqua-Panel_S4");
DWMBgTexture5:SetTexture(Texture5, "Interface\\AddOns\\DWMPack\\Skins\\Aqua-Panel_S5");
DWMBgTexture6:SetTexture(Texture6, "Interface\\AddOns\\DWMPack\\Skins\\Aqua-Panel_S6");
end
end
Xml BaseFrame
Code:
<Frame name="DWMBgTexture2" id="2">
<Size>
<AbsDimension x="256" y="256" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="256" y="0" />
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer>
<Texture name="$parentTexture2" setAllPoints="true" file="interface\AddOns\DWMPack\Backs\DWM-Base-Bg-TopMid">
<TexCoords left="0" right="1" top="0" bottom="1" />
</Texture>
</Layer>
</Layers>
</Frame>