mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-04 12:40:02 +00:00
tooltip: always initialize status text
This commit is contained in:
+6
-8
@@ -130,6 +130,12 @@ pfUI:RegisterModule("tooltip", "vanilla:tbc", function ()
|
||||
this.level = UnitLevel("mouseover")
|
||||
end)
|
||||
|
||||
pfUI.tooltipStatusBar.HP = GameTooltipStatusBar:CreateFontString("Status", "DIALOG", "GameFontNormal")
|
||||
pfUI.tooltipStatusBar.HP:SetPoint("TOP", 0,8)
|
||||
pfUI.tooltipStatusBar.HP:SetNonSpaceWrap(false)
|
||||
pfUI.tooltipStatusBar.HP:SetFontObject(GameFontWhite)
|
||||
pfUI.tooltipStatusBar.HP:SetFont(pfUI.font_default, C.global.font_size + 2, "OUTLINE")
|
||||
|
||||
pfUI.tooltipStatusBar:SetScript("OnUpdate", function()
|
||||
local hp = GameTooltipStatusBar:GetValue()
|
||||
local _, hpmax = GameTooltipStatusBar:GetMinMaxValues()
|
||||
@@ -236,14 +242,6 @@ pfUI:RegisterModule("tooltip", "vanilla:tbc", function ()
|
||||
end
|
||||
end
|
||||
|
||||
if pfUI.tooltipStatusBar.HP == nil then
|
||||
pfUI.tooltipStatusBar.HP = GameTooltipStatusBar:CreateFontString("Status", "DIALOG", "GameFontNormal")
|
||||
pfUI.tooltipStatusBar.HP:SetPoint("TOP", 0,8)
|
||||
pfUI.tooltipStatusBar.HP:SetNonSpaceWrap(false)
|
||||
pfUI.tooltipStatusBar.HP:SetFontObject(GameFontWhite)
|
||||
pfUI.tooltipStatusBar.HP:SetFont(pfUI.font_default, C.global.font_size + 2, "OUTLINE")
|
||||
end
|
||||
|
||||
if hp and hpm then
|
||||
if hp >= 1000 then hp = round(hp / 1000, 1) .. "k" end
|
||||
if hpm >= 1000 then hpm = round(hpm / 1000, 1) .. "k" end
|
||||
|
||||
Reference in New Issue
Block a user