<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="MainMenuBarBagButtons.lua"/>
<Frame name="ItemAnimTemplate" virtual="true" alpha="1">
<Animations>
<AnimationGroup target="$parentAnimIcon" parentKey="flyin">
<Scale target="$parentAnimIcon" scaleX=".125" scaleY=".125" duration=".2" order="3"/>
<Scale target="$parentAnimIcon" scaleX="2" scaleY="2" duration=".5" order="2"/>
<Alpha target="$parentAnimIcon" change="1" duration=".25" order="2"/>
<Path target="$parentAnimIcon" curve="SMOOTH" duration=".5" order="2">
<ControlPoints>
<ControlPoint offsetX="-15" offsetY="30"/>
<ControlPoint offsetX="-75" offsetY="60"/>
</ControlPoints>
</Path>
<Scale target="$parentAnimIcon" scaleX=".5" scaleY=".5" duration="0" order="1"/>
<Alpha target="$parentAnimIcon" change="-1" duration="0" order="1"/>
<Scripts>
<OnPlay>
local iconFrame = self:GetParent();
self.strata = iconFrame:GetFrameStrata();
iconFrame:SetFrameStrata("HIGH");
iconFrame.animIcon:Show();
</OnPlay>
<OnFinished>
local iconFrame = self:GetParent();
iconFrame:SetFrameStrata(self.strata);
iconFrame.animIcon:Hide();
</OnFinished>
</Scripts>
</AnimationGroup>
</Animations>
<Layers>
<Layer level="OVERLAY">
<Texture name="$parentAnimIcon" parentKey="animIcon" setAllPoints="true">
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
ItemAnim_OnLoad(self);
--need to call this from the inheriting frame if it has an OnLoad
</OnLoad>
<OnEvent>
ItemAnim_OnEvent(self, event, ...);
--also might need to call this from inheriting frame
</OnEvent>
</Scripts>
</Frame>
<CheckButton name="BagSlotButtonTemplate" inherits="ItemButtonTemplate,ItemAnimTemplate" virtual="true">
<Size x="30" y="30"/>
<Scripts>
<OnLoad>
ItemAnim_OnLoad(self);
PaperDollItemSlotButton_OnLoad(self);
self:RegisterEvent("BAG_UPDATE_DELAYED");
self:RegisterEvent("INVENTORY_SEARCH_UPDATE");
self.isBag = 1;
self.UpdateTooltip = BagSlotButton_OnEnter;
_G[self:GetName().."NormalTexture"]:SetWidth(50);
_G[self:GetName().."NormalTexture"]:SetHeight(50);
_G[self:GetName().."Count"]:SetPoint("BOTTOMRIGHT", -2, 2);
self.maxDisplayCount = 999;
</OnLoad>
<OnEvent>
ItemAnim_OnEvent(self, event, ...);
if ( event == "BAG_UPDATE_DELAYED" ) then
PaperDollItemSlotButton_Update(self);
elseif ( event == "INVENTORY_SEARCH_UPDATE" ) then
if ( IsContainerFiltered(self:GetID() - CharacterBag0Slot:GetID() + 1) ) then
self.searchOverlay:Show();
else
self.searchOverlay:Hide();
end
else
PaperDollItemSlotButton_OnEvent(self, event, ...);
end
</OnEvent>
<OnShow>
PaperDollItemSlotButton_OnShow(self, true);
</OnShow>
<OnHide>
PaperDollItemSlotButton_OnHide(self);
</OnHide>
<OnClick>
if ( IsModifiedClick() ) then
BagSlotButton_OnModifiedClick(self, button);
else
BagSlotButton_OnClick(self, button);
end
</OnClick>
<OnDragStart>
BagSlotButton_OnDrag(self, button);
</OnDragStart>
<OnReceiveDrag>
BagSlotButton_OnClick(self);
</OnReceiveDrag>
<OnEnter>
BagSlotButton_OnEnter(self, motion);
</OnEnter>
<OnLeave>
GameTooltip:Hide();
ResetCursor();
</OnLeave>
</Scripts>
<CheckedTexture alphaMode="ADD" file="Interface\Buttons\CheckButtonHilight"/>
</CheckButton>
<CheckButton name="MainMenuBarBackpackButton" inherits="ItemButtonTemplate,ItemAnimTemplate" parent="MainMenuBarArtFrame" id="0">
<Size>
<AbsDimension x="30" y="30"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-4" y="6"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
ItemAnim_OnLoad(self);
self:RegisterForClicks("LeftButtonUp", "RightButtonUp");
MainMenuBarBackpackButtonIconTexture:SetTexture("Interface\\Buttons\\Button-Backpack-Up");
self:RegisterEvent("PLAYER_ENTERING_WORLD");
self:RegisterEvent("CVAR_UPDATE");
self:RegisterEvent("BAG_UPDATE");
self:RegisterEvent("INVENTORY_SEARCH_UPDATE");
_G[self:GetName().."NormalTexture"]:SetWidth(50);
_G[self:GetName().."NormalTexture"]:SetHeight(50);
_G[self:GetName().."Count"]:SetPoint("BOTTOMRIGHT", -2, 2);
</OnLoad>
<OnClick>
if ( IsModifiedClick() ) then
BackpackButton_OnModifiedClick(self, button);
else
BackpackButton_OnClick(self, button);
end
</OnClick>
<OnReceiveDrag function="BackpackButton_OnClick"/>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_LEFT");
GameTooltip:SetText(BACKPACK_TOOLTIP, 1.0, 1.0, 1.0);
local keyBinding = GetBindingKey("TOGGLEBACKPACK");
if ( keyBinding ) then
GameTooltip:AppendText(" "..NORMAL_FONT_COLOR_CODE.."("..keyBinding..")"..FONT_COLOR_CODE_CLOSE);
end
GameTooltip:AddLine(string.format(NUM_FREE_SLOTS, (self.freeSlots or 0)));
GameTooltip:Show();
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
<OnEvent>
ItemAnim_OnEvent(self, event, ...);
MainMenuBarBackpackButton_OnEvent(self, event, ...);
</OnEvent>
</Scripts>
<CheckedTexture alphaMode="ADD" file="Interface\Buttons\CheckButtonHilight"/>
</CheckButton>
<CheckButton name="CharacterBag0Slot" inherits="BagSlotButtonTemplate" parent="MainMenuBarArtFrame">
<Anchors>
<Anchor point="RIGHT" relativeTo="MainMenuBarBackpackButton" relativePoint="LEFT">
<Offset>
<AbsDimension x="-2" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="CharacterBag1Slot" inherits="BagSlotButtonTemplate" parent="MainMenuBarArtFrame">
<Anchors>
<Anchor point="RIGHT" relativeTo="CharacterBag0Slot" relativePoint="LEFT">
<Offset>
<AbsDimension x="-2" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="CharacterBag2Slot" inherits="BagSlotButtonTemplate" parent="MainMenuBarArtFrame">
<Anchors>
<Anchor point="RIGHT" relativeTo="CharacterBag1Slot" relativePoint="LEFT">
<Offset>
<AbsDimension x="-2" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
<CheckButton name="CharacterBag3Slot" inherits="BagSlotButtonTemplate" parent="MainMenuBarArtFrame">
<Anchors>
<Anchor point="RIGHT" relativeTo="CharacterBag2Slot" relativePoint="LEFT">
<Offset>
<AbsDimension x="-2" y="0"/>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
</Ui>