AnimatedStatusBarTemplate Lua errors and client crash
Code results in Lua error
Lua Code:
local bar = CreateFrame("Statusbar",nil,UIParent,"AnimatedStatusBarTemplate") bar:SetPoint("BOTTOM",UIParent,"CENTER") bar:SetSize(256, 16) bar:SetMinMaxValues(0,1) bar:SetValue(0.5) bar:SetStatusBarTexture("Interface/TargetingFrame/UI-TargetingFrame-BarFill")
Quote:
Message: Interface\FrameXML\AnimatedStatusBar.lua:6: attempt to index a nil value
|
This code crashes the client every time:
Lua Code:
local bar = CreateFrame("Statusbar",nil,UIParent,"AnimatedStatusBarTemplate") bar:SetPoint("BOTTOM",UIParent,"CENTER") bar:SetSize(256, 16) bar:SetMinMaxValues(0,1) bar:SetValue(0.5) bar:SetStatusBarAtlas("_honorsystem-bar-fill")
Quote:
Using SetStatusBarAtlas()
|
Interesting enough this does not crash the client (calling SetStatusBarTexture before applying the atlas.)
Lua Code:
local bar = CreateFrame("Statusbar",nil,UIParent,"AnimatedStatusBarTemplate") bar:SetPoint("BOTTOM",UIParent,"CENTER") bar:SetSize(256, 16) bar:SetMinMaxValues(0,1) bar:SetValue(0.5) bar:SetStatusBarTexture("Interface/TargetingFrame/UI-TargetingFrame-BarFill") bar:SetStatusBarAtlas("_honorsystem-bar-fill")
I may have missing understanding on how to work with the AnimatedStatusBarMixin though. Not sure why I get the statusbar error when there is a statusbar texture set. Removing the template shows the statusbar just fine.
|