Originally Posted by Torhal
You'd do something like:
Code:
if UnitFactionGroup("player") == "Alliance" then
DoStuff()
else
DoOtherStuff()
end
|
Ok how would i put that in the config file for the backdrop?
Config.lua
Code:
Backdrop = {
bgFile = [=[Interface\AddOns\DreamTweaks\Media\Breaking Glass]=],
edgeFile = [=[Interface\DialogFrame\UI-DialogBox-Border]=],
tile = false, tileSize = 0, edgeSize = 16,
insets = {left = 4, right = 4, top = 4, bottom = 4},
},
Styler.lua
Code:
local function Backdrop()
if UnitFactionGroup("player") == "Horde" then
Backdrop ={
bgFile = [=[Interface\AddOns\DreamTweaks\Media\Breaking Glass]=],
edgeFile = [=[Interface\DialogFrame\UI-DialogBox-Border]=],
tile = false, tileSize = 0, edgeSize = 16,
insets = {left = 4, right = 4, top = 4, bottom = 4},
};
end
if UnitFactionGroup("player") == "Alliance" then
Backdrop ={
bgFile = [=[Interface\AddOns\DreamTweaks\Media\Fire]=],
edgeFile = [=[Interface\DialogFrame\UI-DialogBox-Border]=],
tile = false, tileSize = 0, edgeSize = 16,
insets = {left = 4, right = 4, top = 4, bottom = 4},
};
end
end
local function CreateFrames()
local f = CreateFrame("Frame", nil, UIParent)
f:SetWidth(128)
f:SetHeight(64)
f:SetFrameStrata("BACKGROUND")
f:SetBackdrop(Backdrop)
f:SetBackdropBorderColor(0,0,0)
f:SetPoint("CENTER",0,0)
f:Show()
end