Thread Tools Display Modes
06-11-16, 06:35 AM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
AnimatedStatusBarTemplate Lua errors and client crash

Code results in Lua error
Lua Code:
  1. local bar = CreateFrame("Statusbar",nil,UIParent,"AnimatedStatusBarTemplate")
  2. bar:SetPoint("BOTTOM",UIParent,"CENTER")
  3. bar:SetSize(256, 16)
  4. bar:SetMinMaxValues(0,1)
  5. bar:SetValue(0.5)
  6. bar:SetStatusBarTexture("Interface/TargetingFrame/UI-TargetingFrame-BarFill")
Message: Interface\FrameXML\AnimatedStatusBar.lua:6: attempt to index a nil value
This code crashes the client every time:
Lua Code:
  1. local bar = CreateFrame("Statusbar",nil,UIParent,"AnimatedStatusBarTemplate")
  2. bar:SetPoint("BOTTOM",UIParent,"CENTER")
  3. bar:SetSize(256, 16)
  4. bar:SetMinMaxValues(0,1)
  5. bar:SetValue(0.5)
  6. bar:SetStatusBarAtlas("_honorsystem-bar-fill")
Using SetStatusBarAtlas()
Interesting enough this does not crash the client (calling SetStatusBarTexture before applying the atlas.)
Lua Code:
  1. local bar = CreateFrame("Statusbar",nil,UIParent,"AnimatedStatusBarTemplate")
  2. bar:SetPoint("BOTTOM",UIParent,"CENTER")
  3. bar:SetSize(256, 16)
  4. bar:SetMinMaxValues(0,1)
  5. bar:SetValue(0.5)
  6. bar:SetStatusBarTexture("Interface/TargetingFrame/UI-TargetingFrame-BarFill")
  7. 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.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 06-11-16 at 06:53 AM.
 
 

WoWInterface » Site Forums » Archived Beta Forums » Legion Beta archived threads » AnimatedStatusBarTemplate Lua errors and client crash

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off