vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | -- HAXNINJA |
2 | BINDING_NAME_UndressButtonName = "Open the DressUp Frame"; |
||
3 | BINDING_HEADER_UndressButtonHeader = "Undress Button"; |
||
4 | |||
5 | |||
6 | function UBLoad() |
||
7 | if (not AuctionDressUpFrame) then |
||
8 | this:RegisterEvent("ADDON_LOADED"); |
||
9 | end |
||
10 | end |
||
11 | |||
12 | function UBEvent() |
||
13 | if (event == "ADDON_LOADED") then |
||
14 | if (arg1 == "Blizzard_AuctionUI") then |
||
15 | this:UnregisterEvent("ADDON_LOADED"); |
||
16 | AuctionDressUpFrameUndressButton:SetPoint("BOTTOM", "AuctionDressUpFrameResetButton", "TOP", 0, 2); |
||
17 | AuctionDressUpFrameUndressButton:SetParent("AuctionDressUpModel"); |
||
18 | AuctionDressUpFrameUndressButton:SetFrameLevel(AuctionDressUpFrameResetButton:GetFrameLevel()); |
||
19 | end |
||
20 | end |
||
21 | end |
||
22 | |||
23 | function UBReset() |
||
24 | SetPortraitTexture(DressUpFramePortrait, "player"); |
||
25 | SetDressUpBackground(); |
||
26 | DressUpModel:SetUnit("player"); |
||
27 | end |
||
28 | |||
29 | function UBDressUpTarget() |
||
30 | if (not DressUpFrame:IsVisible()) then |
||
31 | ShowUIPanel(DressUpFrame); |
||
32 | else |
||
33 | PlaySound("gsTitleOptionOK"); |
||
34 | end |
||
35 | if(UnitIsVisible("target")) then |
||
36 | SetPortraitTexture(DressUpFramePortrait, "target"); |
||
37 | SetDressUpTargetBackground(); |
||
38 | DressUpModel:SetUnit("target"); |
||
39 | else |
||
40 | UBReset(); |
||
41 | end |
||
42 | end |
||
43 | |||
44 | function DressUpTargetTexturePath() |
||
45 | local race, fileName = UnitRace("target"); |
||
46 | if ( fileName == "Gnome" or fileName == "GNOME" ) then |
||
47 | fileName = "Dwarf"; |
||
48 | elseif ( fileName == "Troll" or fileName == "TROLL" ) then |
||
49 | fileName = "Orc"; |
||
50 | end |
||
51 | if ( not fileName ) then |
||
52 | fileName = "Orc"; |
||
53 | end |
||
54 | |||
55 | return "Interface\\DressUpFrame\\DressUpBackground-"..fileName; |
||
56 | end |
||
57 | |||
58 | function SetDressUpTargetBackground() |
||
59 | local texture = DressUpTargetTexturePath(); |
||
60 | DressUpBackgroundTopLeft:SetTexture(texture..1); |
||
61 | DressUpBackgroundTopRight:SetTexture(texture..2); |
||
62 | DressUpBackgroundBotLeft:SetTexture(texture..3); |
||
63 | DressUpBackgroundBotRight:SetTexture(texture..4); |
||
64 | end |