Quantcast
WoWInterface - View Single Post - [WIP] Adjusting bunitframes to my taste and needs, help required!
View Single Post
02-15-13, 11:34 AM   #10
Syliha
A Flamescale Wyrmkin
 
Syliha's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 104
Originally Posted by Wildbreath View Post
about last error - seems you modify code and it tryes to edit raid debuffs, but raid debuffs not have a color border.

about show/hide -
Lua Code:
  1. self.uf = CreateFrame('frame', nil, self)
  2. self.uf:SetScript('OnUpdate', function(ss, elapsed)
  3.     ss = ss:GetParent()
  4.     if not ss:IsShown() then return end
  5.     ss.st = elapsed + (ss.st or 0)
  6.     if ss.st > .2 then
  7.         local h, mh = UnitHealth(ss.unit) or 1, UnitMaxHealth(ss.unit) or 100
  8.         local perc = h/(mh/100)
  9.         print(perc)
  10.         if perc < 100 or InCombatLockdown() or UnitAffectingCombat('player') then
  11.             ss:SetAlpha(1)
  12.         else
  13.             ss:SetAlpha(0)
  14.         end
  15.         ss.st = 0
  16.     end
  17. end)
paste it after
Lua Code:
  1. if self.unit == 'player' and not self.raidbutton then
Yeah that was true, I had edited them and will report back once i get into AV again.

Your code produces this error:
Code:
Message: Interface\AddOns\bUnitFrames\bUnitFrames.lua:1214: attempt to call global 'UnitMaxHealth' (a nil value)
Time: 02/15/13 18:33:42
Count: 5785
Stack: Interface\AddOns\bUnitFrames\bUnitFrames.lua:1214: in function <Interface\AddOns\bUnitFrames\bUnitFrames.lua:1209>

Locals: ss = bplayerUnitFrame {
 0 = <userdata>
 shadow = bplayerUnitFrameshadow {
 }
 combat = bplayerUnitFrameiconcombat {
 }
 SmoothBar = <function> defined @Interface\AddOns\bUnitFrames\bUnitFrames.lua:1027
 elapsed = 49.708002308384
 pvptimer = playerPVPTimer {
 }
 unit = "player"
 resize = bplayerUnitFrameResizeButton {
 }
 panel = bplayerUnitFramepanel {
 }
 threat = bplayerUnitFramethreat {
 }
 power = bplayerUnitFramepowerbar {
 }
 st = 49.708002308384
 uf = <unnamed> {
 }
 smooted = true
 castbar = <unnamed> {
 }
 menu = <function> defined @Interface\AddOns\bUnitFrames\bUnitFrames.lua:2430
 portrait = bplayerUnitFrameportrait {
 }
 name = bplayerUnitFrameunitnamestring {
 }
 isCastbar = <unnamed> {
 }
 title = <unnamed> {
 }
 health = bplayerUnitFramehealthbar {
 }
}
elapsed = 0.0080000003799796
(*temporary) = 4350
(*temporary) = nil
(*temporary) = "player"
(*temporary) = "attempt to call global 'UnitMaxHealth' (a nil value)"
UnitHealth = <function> defined =[C]:-1
UnitAffectingCombat = <function> defined =[C]:-1
Edit:
No errors anymore in alterac valley, sorry for my mistake.
__________________
Balance is, when everyone is unhappy.

Last edited by Syliha : 02-15-13 at 03:09 PM.
  Reply With Quote