WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   oUF_Smooth problems (https://www.wowinterface.com/forums/showthread.php?t=48948)

Fumler 02-17-14 02:36 PM

oUF_Smooth problems
 
Hello.

Been trying to do a layout based on oUF_P3lim.

I make a frame for Power in my shared function, and I set
Lua Code:
  1. self.Power = Power
everything works fine at this point, no issues.

But if I then set
Lua Code:
  1. self.Power.Smooth = true
after previous line, the powerbar no longer updates the value. So even if I have 50% power, the bar is completely filled.

Any ideas?

Lua Code:
  1. local function Shared(self, unit)
  2.  
  3. ...
  4.  
  5.  
  6.         local Power = CreateFrame('StatusBar', nil, self)
  7.         Power:SetHeight(20)
  8.         Power:SetWidth(200)
  9.         Power:SetStatusBarTexture(TEXTURE)
  10.  
  11.         Power:SetPoint('BOTTOMRIGHT')
  12.         Power:SetPoint('CENTER')
  13.  
  14.         Power.frequentUpdates = true
  15.         Power.colorClass = false
  16.         Power.colorPower = true
  17.  
  18.         local PowerBG = Power:CreateTexture(nil, 'BORDER')
  19.         PowerBG:SetAllPoints(Power)
  20.         PowerBG:SetTexture(TEXTURE)
  21.         PowerBG:SetAlpha(1)
  22.         PowerBG.multiplier = .3
  23.  
  24.         local PowerValue = Power:CreateFontString(nil, 'OVERLAY')
  25.         PowerValue:SetPoint('LEFT', 5, 0)
  26.         PowerValue:SetJustifyH('LEFT')
  27.         PowerValue:SetFont(FONT, 12)
  28.         PowerValue:SetShadowOffset(1, -1)
  29.         PowerValue.frequentUpdates = 0.1
  30.  
  31.         local PowerPercent = Power:CreateFontString(nil, "OVERLAY")
  32.         PowerPercent:SetPoint("RIGHT", -5, 0)
  33.         PowerPercent:SetFont(FONT, 12)
  34.         PowerPercent:SetShadowOffset(1, -1)
  35.         PowerPercent:SetJustifyH("RIGHT")
  36.         PowerPercent.frequentUpdates = 0.1
  37.         Power.PowerPercent = PowerPercent
  38.  
  39.         Power.bg = PowerBG
  40.         Power.PowerValue = PowerValue
  41.         self.Power = Power
  42.         self.Power.Smooth = true
  43. end

Rainrider 02-17-14 03:25 PM

Is oUF_Smooth listed under OptionalDeps in your layout's .toc?

Phanx 02-17-14 04:18 PM

Even if it's not, adding a "Smooth = true" key on your power bar shouldn't stop it from updating.

Most likely you are getting a Lua error. Install BugSack.

Fumler 02-17-14 07:56 PM

Already have BugSack, it does not give me any error except for when I target a unit without power, but that is natural since I am not checking for it atm.

But yea, no lua errors in BugSack for player frame.

Rainrider 02-18-14 01:07 PM

oUF should display an empty power bar when the unit has no power. Post that error.

Fumler 02-18-14 02:23 PM

Problem was that it was calling function from both embedded version and standalone version of oUF_Smooth. Found that out when I looked again at the LUA error that the directories were different for each call.

Thanks for the help, silly of me to not check this ^^

Phanx 02-18-14 02:23 PM

Also post your entire code, not some random snippet that itself references other parts of your code that you didn't post. :rolleyes:


All times are GMT -6. The time now is 06:46 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI