Hey everyone!
I seem to having some strange issues with some models in my addon. The following picture shows the models being used. I should add that I don't have too much knowledge with models, seeing as there's little documentation online; at least that I've found.
The top three circular models appear when I use the Stormkeeper ability (Shaman spell with 3 charges). Also, when Maelstrom (Shaman resource type) reaches a certain threshold, the bar gets a lightning model applied it. Sometimes during combat, the models stop appearing until I reload the UI.
This is my code for the frames.
Maelstrom Bar
Lua Code:
SSA.MaelstromBarEnh = CreateFrame("StatusBar","MaelstromBarEnh",AuraGroup);
local MaelstromBar = SSA.MaelstromBarEnh;
MaelstromBar:SetStatusBarTexture("Interface\\addons\\ShamanAuras\\media\\statusbar\\fifths");
MaelstromBar:GetStatusBarTexture():SetHorizTile(false);
MaelstromBar:GetStatusBarTexture():SetVertTile(false);
MaelstromBar:SetPoint("CENTER",AuraGroup,"CENTER",0,-139);
MaelstromBar:SetWidth(260);
MaelstromBar:SetHeight(21);
MaelstromBar:SetFrameStrata("LOW");
MaelstromBar:SetStatusBarColor(0,0.5,1);
MaelstromBar:SetAlpha(0);
MaelstromBar.bg = MaelstromBar:CreateTexture(nil,"BACKGROUND");
MaelstromBar.bg:SetTexture("Interface\\TargetingFrame\\UI-StatusBar");
MaelstromBar.bg:SetAllPoints(true);
MaelstromBar.bg:SetVertexColor(0,0,0);
MaelstromBar.bg:SetAlpha(0.5);
MaelstromBar.text = MaelstromBar:CreateFontString(nil, "HIGH", "GameFontHighlightLarge");
MaelstromBar.text:SetPoint("CENTER",MaelstromBar,"CENTER",0,0);
MaelstromBar.text:SetFont("Fonts\\FRIZQT__.TTF", 12);
MaelstromBar.text:SetTextColor(1,1,1,1);
MaelstromBar.Lightning = CreateFrame("PlayerModel","MaelstromBarEnhLightning",MaelstromBar);
MaelstromBar.Lightning:SetModel("SPELLS/LIGHTNING_AREA_DISC_STATE.m2");
MaelstromBar.Lightning:SetFrameStrata("MEDIUM");
MaelstromBar.Lightning:SetPosition(0,0,-2);
MaelstromBar.Lightning:SetAllPoints(MaelstromBar);
MaelstromBar.Lightning:SetAlpha(0);
Stormkeeper Lightning Charges
Lua Code:
local StormkeeperCharges = CreateFrame("Frame","StormkeeperChargeGrp",AuraGroup);
StormkeeperCharges:SetFrameStrata(bg);
StormkeeperCharges:SetWidth(260);
StormkeeperCharges:SetHeight(50);
StormkeeperCharges:SetPoint("CENTER",AuraGroup,"CENTER",0,-110);
StormkeeperCharges:Show();
for i=1,3 do
StormkeeperCharges["Charge"..i] = CreateFrame("Frame","StormkeeperCharge"..i,StormkeeperCharges);
StormkeeperCharges["Charge"..i]:SetWidth(100);
StormkeeperCharges["Charge"..i]:SetHeight(100);
StormkeeperCharges["Charge"..i]:SetPoint("CENTER",StormkeeperCharges,"LEFT",30,-3);
StormkeeperCharges["Charge"..i]:SetAlpha(0);
StormkeeperCharges["Charge"..i]:Show();
StormkeeperCharges["Charge"..i].Lightning = CreateFrame("PlayerModel","StormkeeperCharge"..i.."_Lightning",StormkeeperCharges["Charge"..i]);
StormkeeperCharges["Charge"..i].Lightning:SetModel("spells/Monk_chiblast_precast.m2");
StormkeeperCharges["Charge"..i].Lightning:SetPosition(0,0,0);
StormkeeperCharges["Charge"..i].Lightning:SetAllPoints(StormkeeperCharges["Charge"..i]);
StormkeeperCharges["Charge"..i].Lightning:SetAlpha(1);
StormkeeperCharges["Charge"..i].Lightning:SetSequence(37);
end