forked from wowgaming/3.3.5-interface-files
-
Notifications
You must be signed in to change notification settings - Fork 1
/
DressUpFrame.lua
35 lines (31 loc) · 870 Bytes
/
DressUpFrame.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function DressUpItemLink(link)
if ( not link or not IsDressableItem(link) ) then
return;
end
if ( not DressUpFrame:IsShown() ) then
ShowUIPanel(DressUpFrame);
DressUpModel:SetUnit("player");
end
DressUpModel:TryOn(link);
end
function DressUpTexturePath()
-- HACK
local race, fileName = UnitRace("player");
if ( strupper(fileName) == "GNOME" ) then
fileName = "Dwarf";
elseif ( strupper(fileName) == "TROLL" ) then
fileName = "Orc";
end
if ( not fileName ) then
fileName = "Orc";
end
-- END HACK
return "Interface\\DressUpFrame\\DressUpBackground-"..fileName;
end
function SetDressUpBackground()
local texture = DressUpTexturePath();
DressUpBackgroundTopLeft:SetTexture(texture..1);
DressUpBackgroundTopRight:SetTexture(texture..2);
DressUpBackgroundBotLeft:SetTexture(texture..3);
DressUpBackgroundBotRight:SetTexture(texture..4);
end