WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Legion Beta archived threads (https://www.wowinterface.com/forums/forumdisplay.php?f=177)
-   -   AnimatedStatusBarTemplate Lua errors and client crash (https://www.wowinterface.com/forums/showthread.php?t=53657)

zork 06-11-16 06:35 AM

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")
Quote:

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")
Quote:

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.


All times are GMT -6. The time now is 12:18 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI