режим предателя + UI референсы и DragonUI
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
function BarberShop_OnLoad(self)
|
||||
BarberShop_UpdateHairCustomization();
|
||||
BarberShop_UpdateFacialHairCustomization();
|
||||
self:RegisterEvent("BARBER_SHOP_APPEARANCE_APPLIED");
|
||||
self:RegisterEvent("BARBER_SHOP_SUCCESS");
|
||||
|
||||
if ( CanAlterSkin() ) then
|
||||
BarberShop_ToFourAttributeFormat();
|
||||
end
|
||||
end
|
||||
|
||||
function BarberShop_OnShow(self)
|
||||
CloseAllBags();
|
||||
BarberShop_ResetLabelColors();
|
||||
BarberShop_UpdateCost();
|
||||
if ( BarberShopBannerFrame ) then
|
||||
BarberShopBannerFrame:Show();
|
||||
BarberShopBannerFrame.caption:SetText(BARBERSHOP);
|
||||
end
|
||||
self:ClearAllPoints();
|
||||
self:SetPoint("RIGHT", min(-50, -CONTAINER_OFFSET_X), -50);
|
||||
|
||||
PlaySound("BarberShop_Sit");
|
||||
|
||||
WatchFrame:Hide();
|
||||
|
||||
--load the texture
|
||||
BarberShopFrameBackground:SetTexture("Interface\\Barbershop\\UI-Barbershop");
|
||||
end
|
||||
|
||||
function BarberShop_OnHide(self)
|
||||
BarberShopBannerFrame:Hide();
|
||||
|
||||
WatchFrame:Show();
|
||||
|
||||
--unload the texture to save memory
|
||||
BarberShopFrameBackground:SetTexture(nil);
|
||||
end
|
||||
|
||||
function BarberShop_OnEvent(self, event, ...)
|
||||
if(event == "BARBER_SHOP_SUCCESS") then
|
||||
PlaySound("Barbershop_Haircut");
|
||||
end
|
||||
BarberShop_Update(self);
|
||||
end
|
||||
|
||||
function BarberShop_UpdateCost()
|
||||
MoneyFrame_Update(BarberShopFrameMoneyFrame:GetName(), GetBarberShopTotalCost());
|
||||
-- The 4th return from GetBarberShopStyleInfo is whether the selected style is the active character style
|
||||
if ( select(4, GetBarberShopStyleInfo(1)) and select(4, GetBarberShopStyleInfo(2)) and select(4, GetBarberShopStyleInfo(3)) and ( not BarberShopFrameSelector4:IsShown() or select(4, GetBarberShopStyleInfo(4)) ) ) then
|
||||
BarberShopFrameOkayButton:Disable();
|
||||
BarberShopFrameResetButton:Disable();
|
||||
else
|
||||
BarberShopFrameOkayButton:Enable();
|
||||
BarberShopFrameResetButton:Enable();
|
||||
end
|
||||
end
|
||||
|
||||
function BarberShop_UpdateBanner(name)
|
||||
if ( name ) then
|
||||
BarberShopBannerFrameCaption:SetText(name);
|
||||
end
|
||||
end
|
||||
|
||||
function BarberShop_Update(self)
|
||||
BarberShop_UpdateCost();
|
||||
BarberShop_UpdateSelector(BarberShopFrameSelector4);
|
||||
BarberShop_UpdateSelector(BarberShopFrameSelector3);
|
||||
BarberShop_UpdateSelector(BarberShopFrameSelector2);
|
||||
BarberShop_UpdateSelector(BarberShopFrameSelector1);
|
||||
end
|
||||
|
||||
function BarberShop_UpdateSelector(self)
|
||||
local name, _, _, isCurrent = GetBarberShopStyleInfo(self:GetID());
|
||||
BarberShop_UpdateBanner(name);
|
||||
local frameName = self:GetName();
|
||||
BarberShop_SetLabelColor(_G[frameName.."Category"], isCurrent);
|
||||
end
|
||||
|
||||
function BarberShop_UpdateHairCustomization()
|
||||
local hairCustomization = GetHairCustomization();
|
||||
BarberShopFrameSelector1Category:SetText(_G["HAIR_"..hairCustomization.."_STYLE"]);
|
||||
BarberShopFrameSelector2Category:SetText(_G["HAIR_"..hairCustomization.."_COLOR"]);
|
||||
end
|
||||
|
||||
function BarberShop_UpdateFacialHairCustomization()
|
||||
BarberShopFrameSelector3Category:SetText(_G["FACIAL_HAIR_"..GetFacialHairCustomization()]);
|
||||
end
|
||||
|
||||
function BarberShop_SetLabelColor(label, isCurrent)
|
||||
if ( isCurrent ) then
|
||||
label:SetTextColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
|
||||
else
|
||||
label:SetTextColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
|
||||
end
|
||||
end
|
||||
|
||||
function BarberShop_ResetLabelColors()
|
||||
BarberShop_SetLabelColor(BarberShopFrameSelector1Category, 1);
|
||||
BarberShop_SetLabelColor(BarberShopFrameSelector2Category, 1);
|
||||
BarberShop_SetLabelColor(BarberShopFrameSelector3Category, 1);
|
||||
BarberShop_SetLabelColor(BarberShopFrameSelector4Category, 1);
|
||||
end
|
||||
|
||||
function BarberShop_ToFourAttributeFormat()
|
||||
BarberShopFrameSelector2:SetPoint("TOPLEFT", BarberShopFrameSelector1, "BOTTOMLEFT", 0, 3);
|
||||
BarberShopFrameSelector3:SetPoint("TOPLEFT", BarberShopFrameSelector2, "BOTTOMLEFT", 0, 3);
|
||||
BarberShopFrameSelector4:Show();
|
||||
BarberShopFrameMoneyFrame:SetPoint("TOP", BarberShopFrameSelector4, "BOTTOM", 7, -7);
|
||||
BarberShopFrameOkayButton:SetPoint("RIGHT", BarberShopFrameSelector4, "BOTTOM", -2, -36);
|
||||
end
|
||||
@@ -0,0 +1,10 @@
|
||||
## Interface: 30300
|
||||
## Title: Blizzard Barber Shop UI
|
||||
## Notes: The barber's blade went snicker-snack! Have you seen my Jabberwocky?
|
||||
## Secure: 1
|
||||
## Author: Blizzard Entertainment
|
||||
## Version: 1.0
|
||||
## LoadOnDemand: 1
|
||||
Blizzard_BarberShopUI.lua
|
||||
Blizzard_BarberShopUI.xml
|
||||
Localization.lua
|
||||
@@ -0,0 +1,277 @@
|
||||
<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">
|
||||
<Frame name="BarberShopSelectorTemplate" virtual="true">
|
||||
<Size>
|
||||
<AbsDimension x="175" y="32"/>
|
||||
</Size>
|
||||
<Layers>
|
||||
<Layer level="BACKGROUND">
|
||||
<FontString name="$parentCategory" inherits="GameFontNormal" text="Hair Style">
|
||||
<Size>
|
||||
<AbsDimension x="90" y="14"/>
|
||||
</Size>
|
||||
</FontString>
|
||||
</Layer>
|
||||
</Layers>
|
||||
<Frames>
|
||||
<Button name="$parentPrev" virtual="true">
|
||||
<Size>
|
||||
<AbsDimension x="32" y="32"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="RIGHT" relativeTo="$parentCategory" relativePoint="LEFT">
|
||||
<Offset>
|
||||
<AbsDimension x="-5" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
local parent = self:GetParent();
|
||||
SetNextBarberShopStyle(parent:GetID(), 1);
|
||||
PlaySound("UChatScrollButton");
|
||||
BarberShop_UpdateCost();
|
||||
BarberShop_UpdateSelector(parent);
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
<NormalTexture file="Interface\Buttons\UI-SpellbookIcon-PrevPage-Up"/>
|
||||
<PushedTexture file="Interface\Buttons\UI-SpellbookIcon-PrevPage-Down"/>
|
||||
<DisabledTexture file="Interface\Buttons\UI-SpellbookIcon-PrevPage-Disabled"/>
|
||||
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
|
||||
</Button>
|
||||
<Button name="$parentNext" virtual="true">
|
||||
<Size>
|
||||
<AbsDimension x="32" y="32"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="LEFT" relativeTo="$parentCategory" relativePoint="RIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="5" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
local parent = self:GetParent();
|
||||
SetNextBarberShopStyle(parent:GetID());
|
||||
PlaySound("UChatScrollButton");
|
||||
BarberShop_UpdateCost();
|
||||
BarberShop_UpdateSelector(parent);
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
<NormalTexture file="Interface\Buttons\UI-SpellbookIcon-NextPage-Up"/>
|
||||
<PushedTexture file="Interface\Buttons\UI-SpellbookIcon-NextPage-Down"/>
|
||||
<DisabledTexture file="Interface\Buttons\UI-SpellbookIcon-NextPage-Disabled"/>
|
||||
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
|
||||
</Button>
|
||||
</Frames>
|
||||
</Frame>
|
||||
<Frame name="BarberShopFrame" parent="UIParent" toplevel="true" hidden="true" enableMouse="true">
|
||||
<Size>
|
||||
<AbsDimension x="265" y="319"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="RIGHT" relativeTo="UIParent" relativePoint="RIGHT">
|
||||
<Offset x="-18" y="-54"/>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Layers>
|
||||
<Layer level="BACKGROUND">
|
||||
<Texture name="$parentBackground" setAllPoints="true">
|
||||
<TexCoords left="0" right="0.517578" top="0" bottom="0.623047"/>
|
||||
</Texture>
|
||||
</Layer>
|
||||
</Layers>
|
||||
<Frames>
|
||||
<Frame name="$parentSelector1" inherits="BarberShopSelectorTemplate" id="1">
|
||||
<Anchors>
|
||||
<Anchor point="TOP" relativeTo="$parent">
|
||||
<Offset>
|
||||
<AbsDimension x="2" y="-74"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
_G[self:GetName().."Category"]:SetText("Hair Style");
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentSelector2" inherits="BarberShopSelectorTemplate" id="2">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentSelector1" relativePoint="BOTTOMLEFT">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="-1"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
_G[self:GetName().."Category"]:SetText("Hair Color");
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentSelector3" inherits="BarberShopSelectorTemplate" id="3">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentSelector2" relativePoint="BOTTOMLEFT">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="-1"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
_G[self:GetName().."Category"]:SetText("Facial Style");
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentSelector4" inherits="BarberShopSelectorTemplate" id="4" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$parentSelector3" relativePoint="BOTTOMLEFT">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="3"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
_G[self:GetName().."Category"]:SetText(SKIN_COLOR);
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentMoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors>
|
||||
<Anchor point="TOP" relativeTo="$parentSelector3" relativePoint="BOTTOM">
|
||||
<Offset>
|
||||
<AbsDimension x="7" y="-10"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Layers>
|
||||
<Layer level="BACKGROUND">
|
||||
<Texture file="Interface\MoneyFrame\UI-MoneyFrame-Border">
|
||||
<Size>
|
||||
<AbsDimension x="128" y="32"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="CENTER">
|
||||
<Offset>
|
||||
<AbsDimension x="-8" y="-6"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</Texture>
|
||||
</Layer>
|
||||
</Layers>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad(self);
|
||||
MoneyFrame_SetType(self, "GUILD_REPAIR");
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Button name="$parentOkayButton" inherits="UIPanelButtonTemplate" text="OKAY">
|
||||
<Size>
|
||||
<AbsDimension x="80" y="24"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="RIGHT" relativeTo="$parentSelector3" relativePoint="BOTTOM">
|
||||
<Offset>
|
||||
<AbsDimension x="-2" y="-48"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnClick function="ApplyBarberShopStyle"/>
|
||||
</Scripts>
|
||||
</Button>
|
||||
<Button name="$parentCancelButton" inherits="UIPanelButtonTemplate" text="COINPICKUP_CANCEL">
|
||||
<Size>
|
||||
<AbsDimension x="80" y="24"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="LEFT" relativeTo="$parentOkayButton" relativePoint="RIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="5" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
CancelBarberShop();
|
||||
PlaySound("igCharacterInfoClose");
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
<Button name="$parentResetButton" inherits="UIPanelButtonTemplate" text="RESET">
|
||||
<Size>
|
||||
<AbsDimension x="80" y="24"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="BOTTOM">
|
||||
<Offset>
|
||||
<AbsDimension x="2" y="50"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
BarberShopReset();
|
||||
BarberShop_ResetLabelColors();
|
||||
BarberShop_UpdateCost();
|
||||
BarberShop_UpdateBanner(GetBarberShopStyleInfo(1));
|
||||
PlaySound("igCharacterInfoClose");
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
</Frames>
|
||||
<Scripts>
|
||||
<OnLoad function="BarberShop_OnLoad"/>
|
||||
<OnShow function="BarberShop_OnShow"/>
|
||||
<OnHide function="BarberShop_OnHide"/>
|
||||
<OnEvent function="BarberShop_OnEvent"/>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="BarberShopBannerFrame" toplevel="true" parent="UIParent">
|
||||
<Size>
|
||||
<AbsDimension x="381" y="210"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOP" relativeTo="UIParent" relativePoint="TOP">
|
||||
<Offset x="2" y="5"/>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Layers>
|
||||
<Layer level="BACKGROUND">
|
||||
<Texture name="$parentBGTexture" setAllPoints="true">
|
||||
<TexCoords left="0" right="0.744141" top="0" bottom="0.820313"/>
|
||||
</Texture>
|
||||
</Layer>
|
||||
<Layer level="OVERLAY">
|
||||
<FontString name="$parentCaption" inherits="GameFontNormalLarge" text="BARBERSHOP">
|
||||
<Size>
|
||||
<AbsDimension x="350" y="30"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOP" relativeTo="BarberShopBannerFrame" relativePoint="TOP">
|
||||
<Offset x="0" y="-94"/>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
</FontString>
|
||||
</Layer>
|
||||
</Layers>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
self.caption = _G[self:GetName() .. "Caption"];
|
||||
</OnLoad>
|
||||
<OnShow>
|
||||
UIErrorsFrame:SetPoint("TOP", self, "BOTTOM", 0, 0);
|
||||
BarberShopBannerFrameBGTexture:SetTexture("Interface\\Barbershop\\UI-Barbershop-Banner");
|
||||
</OnShow>
|
||||
<OnHide>
|
||||
UIErrorsFrame:SetPoint("TOP", UIParent, "TOP", 0, -122);
|
||||
BarberShopBannerFrameBGTexture:SetTexture(nil);
|
||||
</OnHide>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
</Ui>
|
||||
@@ -0,0 +1 @@
|
||||
-- This file is executed at the end of addon load
|
||||
Reference in New Issue
Block a user