Thread Tools Display Modes
01-06-17, 02:55 AM   #1
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
oUF Nameplate bug

Hi, i recently made a discover that oUF doesn't update correctly on nameplates health, you'll have to target them to update correctly.
  Reply With Quote
01-06-17, 04:53 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Have you enabled frequent updates for your nameplate health element?

https://github.com/zorker/rothui/blo...eplate.lua#L56
https://github.com/zorker/rothui/blo...tions.lua#L241
https://github.com/zorker/rothui/blo...ealth.lua#L159
__________________
| 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 : 01-06-17 at 04:57 AM.
  Reply With Quote
01-06-17, 08:49 AM   #3
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
yes i have frequent updates for my nameplate

Lua Code:
  1. local function SetupNameplates(self, unit)
  2.     local Scale = UIParent:GetEffectiveScale()
  3.     local Nameplates = C_NamePlate.GetNamePlateForUnit(unit)
  4.    
  5.     local NameplatesPanel = CreateFrame("Frame", "ANameplatesPanel", self)
  6.     NameplatesPanel:SetWidth(unpack(C.UnitFrames.NameplateWidth))
  7.     NameplatesPanel:SetHeight(24)
  8.     NameplatesPanel:SetPoint("CENTER", self, 0, -2)
  9.     NameplatesPanel:SetFrameLevel(self:GetFrameLevel() + 2)
  10.     A.CreateBorder(NameplatesPanel)
  11.  
  12.     self:SetScale(Scale)
  13.     self:SetWidth(unpack(C.UnitFrames.NameplateWidth))
  14.     self:SetHeight(unpack(C.UnitFrames.NameplateHeight))
  15.     self:SetPoint("CENTER", Nameplates, 0, -6)
  16.  
  17.     local Health = CreateFrame("StatusBar", nil, self)
  18.     Health:SetStatusBarTexture("Interface\\Buttons\\WHITE8x8")
  19.     Health:SetAllPoints(self)
  20.    
  21.     if C.UnitFrames.CustomHealtBarColor == true then
  22.         Health:SetStatusBarColor(unpack(C.UnitFrames.HealthBarColor))
  23.         Health.colorClass = false
  24.         Health.colorReaction = false
  25.     else
  26.         Health.colorClass = true
  27.         Health.colorReaction = true
  28.     end
  29.  
  30.     Health.frequentUpdates = true
  31.    
  32.     if C.UnitFrames.Smooth then
  33.         Health.Smooth = true
  34.     end
  35.    
  36.     Health.PostUpdate = UpdateHealth
  37.  
  38.     local HealthBG = Health:CreateTexture(nil, "BORDER")
  39.     HealthBG:SetTexture("Interface\\Buttons\\WHITE8x8")
  40.     HealthBG:SetAllPoints(Health)
  41.     HealthBG:SetVertexColor(unpack(C.UnitFrames.HealthBackdropColor))
  42.  
  43.     local Power = CreateFrame("StatusBar", nil, self)
  44.     Power:SetStatusBarTexture("Interface\\Buttons\\WHITE8x8")
  45.     Power:SetHeight(4)
  46.     Power:SetPoint("TOPLEFT", Health, "BOTTOMLEFT")
  47.     Power:SetPoint("TOPRIGHT", Health, "BOTTOMRIGHT")
  48.  
  49.     Power.frequentUpdates = true
  50.    
  51.     if C.UnitFrames.Smooth then
  52.         Power.Smooth = true
  53.     end
  54.    
  55.     local PowerBG = Power:CreateTexture(nil, "BORDER")
  56.     PowerBG:SetAllPoints(Power)
  57.     PowerBG:SetTexture("Interface\\Buttons\\WHITE8x8")
  58.  
  59.     if C.UnitFrames.CustomPowerColor == true then
  60.         Power:SetStatusBarColor(unpack(C.UnitFrames.PowerBarColor))
  61.         Power.colorClass = false
  62.         Power.colorReaction = false
  63.         PowerBG:SetVertexColor(unpack(C.UnitFrames.PowerBarColorBG))
  64.     else
  65.         Power.colorClass = true
  66.         Power.colorReaction = true
  67.         PowerBG.multiplier = .5
  68.     end
  69.  
  70.     local Debuffs = CreateFrame("Frame", nil, self)
  71.     Debuffs:SetSize(270, 270)
  72.     Debuffs.size = 28, 24
  73.     Debuffs.spacing = 4
  74.     Debuffs["growth-x"] = "RIGHT"
  75.     Debuffs.initialAnchor = "LEFT"
  76.     Debuffs.PostCreateIcon = CreateAura
  77.     Debuffs.PostUpdateIcon = UpdateAura
  78.     Debuffs:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 0, -98)
  79.     Debuffs.num = 5
  80.     Debuffs.onlyShowPlayer = true
  81.    
  82.     if C.UnitFrames.CastBarMod then
  83.         local Castbar = CreateFrame("StatusBar", nil, self)
  84.         Castbar:SetStatusBarTexture(C.Media.Texture)
  85.         Castbar:SetStatusBarColor(unpack(C.UnitFrames.CastBarColor))
  86.         Castbar:SetPoint("TOPLEFT", Health, "BOTTOMLEFT", 0, -8)
  87.         Castbar:SetPoint("BOTTOMRIGHT", Health, "BOTTOMRIGHT", 0, -28)
  88.         A.Skin(Castbar)
  89.  
  90.         local CastbarIcon = Castbar:CreateTexture(nil, "ARTWORK")
  91.         CastbarIcon:SetSize(28, 28)
  92.         CastbarIcon:SetTexCoord(unpack(A.TexCoords))
  93.         CastbarIcon:SetPoint("LEFT", -34, 12)
  94.    
  95.         local ACastBarIconOverlayNamePlate = CreateFrame("Frame", nil, Castbar)
  96.         ACastBarIconOverlayNamePlate:SetAllPoints(CastbarIcon)
  97.         A.CreateBorder(ACastBarIconOverlayNamePlate, true, 28, 28)
  98.  
  99.         local CastbarTime = Castbar:CreateFontString(nil, "OVERLAY")
  100.         CastbarTime:SetFont(C.Media.Font, 12, "THINOUTLINE")
  101.         CastbarTime:SetShadowOffset(1, -1)
  102.         CastbarTime:SetShadowColor(0,0,0)  
  103.         CastbarTime:SetPoint("RIGHT", Castbar, -4, 0)
  104.         CastbarTime:SetJustifyH("RIGHT")
  105.  
  106.         local CastbarText = Castbar:CreateFontString(nil, "OVERLAY")
  107.         CastbarText:SetFont(C.Media.Font, 12, "THINOUTLINE")
  108.         CastbarText:SetShadowOffset(1, -1)
  109.         CastbarText:SetShadowColor(0,0,0)
  110.         CastbarText:SetPoint("LEFT", Castbar, 4, 0)
  111.         CastbarText:SetPoint("RIGHT", CastbarTime, "LEFT")
  112.         CastbarText:SetJustifyH("LEFT")
  113.  
  114.         self.Castbar = Castbar
  115.         self.Castbar.Icon = CastbarIcon
  116.         self.Castbar.Time = CastbarTime
  117.         self.Castbar.Text = CastbarText
  118.  
  119.         Castbar.CustomDelayText = UpdateCustomDelayText
  120.         Castbar.CustomTimeText = UpdateCustomTimeText
  121.         Castbar.PostChannelStart = UpdateInterruptColor
  122.         Castbar.PostCastStart = UpdateInterruptColor
  123.     end
  124.    
  125.     local InvisFrame = CreateFrame("Frame", nil, self)
  126.     InvisFrame:SetFrameLevel(Health:GetFrameLevel() + 10)
  127.     InvisFrame:SetAllPoints()
  128.    
  129.     local Name = self:CreateFontString(nil, "OVERLAY")
  130.     Name:SetPoint("TOP", 0, 18)
  131.     Name:SetFont(C.Media.Font, 13, "THINOUTLINE")
  132.     Name:SetShadowOffset(1, -1)
  133.     Name:SetShadowColor(0,0,0)
  134.    
  135.     local HealthText = InvisFrame:CreateFontString(nil, "OVERLAY")
  136.     HealthText:SetPoint("LEFT", Health, 4.5, 0.5)
  137.     HealthText:SetFont(C.Media.Font2, 12, "THINOUTLINE")
  138.     HealthText:SetShadowOffset(1, -1)
  139.     HealthText:SetShadowColor(0,0,0)
  140.    
  141.     local HealthPerText = InvisFrame:CreateFontString(nil, "OVERLAY")
  142.     HealthPerText:SetPoint("RIGHT", Health, -2, 0.5)
  143.     HealthPerText:SetFont(C.Media.Font2, 12, "THINOUTLINE")
  144.     HealthPerText:SetShadowOffset(1, -1)
  145.     HealthPerText:SetShadowColor(0,0,0)
  146.  
  147.     local RaidIcon = InvisFrame:CreateTexture(nil, "OVERLAY", 7)
  148.     RaidIcon:SetSize(28, 28)
  149.     RaidIcon:SetPoint("CENTER", Health, "TOP")
  150.    
  151.     --table.insert(self.__elements, UpdateThreatNameplate)
  152.     --self:RegisterEvent("PLAYER_TARGET_CHANGED", UpdateThreatNameplate)
  153.     --self:RegisterEvent("UNIT_THREAT_LIST_UPDATE", UpdateThreatNameplate)
  154.     --self:RegisterEvent("UNIT_THREAT_SITUATION_UPDATE", UpdateThreatNameplate)
  155.  
  156.     -- Register with oUF   
  157.     self:Tag(Name, "[raidcolor][Aftermathh:Name]")
  158.     self:Tag(HealthText, "|cff559655[Aftermathh:Health]")
  159.     self:Tag(HealthPerText, "|cff559655[perhp]%")
  160.  
  161.     self.Health = Health
  162.     self.Health.bg = HealthBG
  163.     self.Power = Power
  164.     self.Power.bg = PowerBG
  165.     self.Debuffs = Debuffs
  166.     self.RaidIcon = RaidIcon
  167. end
  168.  
  169. oUF:RegisterStyle("AftermathhNameplate", SetupNameplates)
  170. oUF:SpawnNamePlates("AftermathhNameplate", "AftermathhNameplate")
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF Nameplate bug

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