okay got it working.
but I need some sort off check, to make sure the textures show when I log in.
since my backup function fails.
Code:
AI1 = CreateFrame("Frame", nil, UIParent)
AI1:SetFrameStrata(BACKGROUND)
AI1:SetHeight(80)
AI1:SetWidth(512)
AI1:SetPoint("BOTTOM",-0,-1)
AI1:SetFrameLevel(0)
AI2 = CreateFrame("Frame", nil, UIParent)
AI2:SetFrameStrata(BACKGROUND)
AI2:SetHeight(80)
AI2:SetWidth(128)
AI2:SetPoint("RIGHT", AI1, "LEFT", 0, 0)
AI2:SetFrameLevel(0)
AI3 = CreateFrame("Frame", nil, UIParent)
AI3:SetFrameStrata(BACKGROUND)
AI3:SetHeight(80)
AI3:SetWidth(128)
AI3:SetPoint("LEFT", AI1, "RIGHT", 0, 0)
AI3:SetFrameLevel(0)
AI1:SetScript("OnEvent", function(self, event, ...)
if event == "UNIT_ENTERED_VEHICLE" then
AI1:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\V1.tga"})
AI2:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\V1L.tga"})
AI3:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\V1R.tga"})
-- elseif event == "UNIT_EXITED_VEHICLE" then
-- AI1:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\A1.tga"})
-- AI2:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\A1L.tga"})
-- AI3:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\A1R.tga"})
else
AI1:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\A1.tga"})
AI2:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\A1L.tga"})
AI3:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\A1R.tga"})
end
end)
AI1:RegisterEvent('UNIT_ENTERED_VEHICLE')
AI1:RegisterEvent('UNIT_EXITED_VEHICLE')
Not sure If I should use
Code:
AI1:RegisterEvent("PLAYER_ENTERING_WORLD")
and use
Code:
AI1:SetScript("OnEvent", function(self, event, ...)
if event == "PLAYER_ENTERING_WORLD" then
AI1:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\A1.tga"})
AI2:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\A1L.tga"})
AI3:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\A1R.tga"})
elseif event == "UNIT_ENTERED_VEHICLE" then
AI1:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\V1.tga"})
AI2:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\V1L.tga"})
AI3:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\V1R.tga"})
else
AI1:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\A1.tga"})
AI2:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\A1L.tga"})
AI3:SetBackdrop({bgFile = "Interface\\AddOns\\AI-Suite\\Art\\A1R.tga"})
end
end)
AI1:RegisterEvent("PLAYER_ENTERING_WORLD")
AI1:RegisterEvent('UNIT_ENTERED_VEHICLE')
AI1:RegisterEvent('UNIT_EXITED_VEHICLE')
this works, but i'm not sure if i would run into problems on other ocations.
could somebody give me some advice to use it this way or how to do this the best way