Quantcast
WoWInterface - View Single Post - Nameplate creation with oUF
View Single Post
09-29-17, 12:23 AM   #2
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 356
I think I found a bug.

Before we go further, please have a look at the following video.
(Seems like I can't embed a video on post )

https://youtu.be/nyx3-vpUidA

So what is happening here is that I have cast "Brutal Slash", an AOE skill of feral druid that deals a certain amount of damage to nearby enemies.

However, as you can see, the health bar is only updated for an enemy that is currently selected as a target.

My code currently doesn't do that much and pretty sure I didn't touch anything from nameplate element in oUF.

Lua Code:
  1. function UM:CreateNameplate(frame)
  2.     local LSM = LibStub("LibSharedMedia-3.0");
  3.     local flatsmooth = LSM:Fetch("statusbar", "flatsmooth");
  4.     local fer28 = LSM:Fetch("statusbar", "fer28");
  5.     local MeatEdition = LSM:Fetch("font", "MeatEdition");
  6.     local fer8 = LSM:Fetch("border", "fer8");
  7.  
  8.     frame:SetSize(128, 16);
  9.     frame:SetPoint("CENTER");
  10.  
  11.     -- Health
  12.     local health = CreateFrame("StatusBar", "$parentHealth", frame);
  13.     health:SetStatusBarTexture(flatsmooth);
  14.     health:SetAllPoints();
  15.     health:SetBackground(0.15, 0.15, 0.15);
  16.  
  17.     local border = CreateFrame("Frame", "$parentBorder", health);
  18.     border:SetPoint("CENTER");
  19.     border:SetSize(health:GetWidth() + 2, health:GetHeight() + 2);
  20.     border:SetBackdrop({
  21.         edgeFile = fer8,
  22.         edgeSize = 8,
  23.     });
  24.  
  25.     local healthText = health:CreateFontString("$parentText", "OVERLAY");
  26.     healthText:SetFont(MeatEdition, 8, "OUTLINE");
  27.     healthText:SetPoint("RIGHT", -2, 0);
  28.  
  29.     frame:Tag(healthText, "[perhp]%");
  30.  
  31.     frame.Health = health;
  32.  
  33.     frame.border = border;
  34.     frame.healthText = healthText;
  35.  
  36.     -- NameText
  37.     local nameText = frame:CreateFontString("$parentNameText", "OVERLAY");
  38.     nameText:SetParent(frame.border);
  39.     nameText:SetFont(MeatEdition, 10, "OUTLINE");
  40.     nameText:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", 0, 2);
  41.  
  42.     frame:Tag(nameText, "[smartlevel] [raidcolor][name]|r");
  43.  
  44.     frame.NameText = nameText;
  45. end

Last edited by Layback_ : 09-29-17 at 12:32 AM.
  Reply With Quote