Feel free to use mine
Lua Code:
if UnitLevel("player") ~= MAX_PLAYER_LEVEL then return end
local HonorBar = CreateFrame("StatusBar", nil, UIParent)
HonorBar:SetOrientation("VERTICAL")
HonorBar:SetSize(WIDTH, HEIGHT)
HonorBar:SetPoint("LEFT", UIParent, -12, 0)
HonorBar:SetStatusBarTexture(TEXTURE)
HonorBar:SetStatusBarColor(BARCOLOR)
local function UpdateHonorBar()
local Current, Max = UnitHonor("player"), UnitHonorMax("player")
HonorBar:SetMinMaxValues(0, Max)
HonorBar:SetValue(Current)
end
HonorBar:SetScript("OnEnter", function(self)
local Current, Max = UnitHonor("player"), UnitHonorMax("player")
local Level = UnitHonorLevel("player")
local LevelMax = GetMaxPlayerHonorLevel()
local Prestige = UnitPrestige("player")
GameTooltip:ClearLines()
GameTooltip:SetOwner(self, "ANCHOR_CURSOR", 0, -4)
if Max == 0 then
GameTooltip:AddLine(PVP_HONOR_PRESTIGE_AVAILABLE)
GameTooltip:AddLine(PVP_HONOR_XP_BAR_CANNOT_PRESTIGE_HERE)
else
GameTooltip:AddLine("|cffffd200Honor Exp|r")
GameTooltip:AddDoubleLine("Current Honor:", Current .. "/" .. Max .. " - " .. math.floor(Current/Max*100) .. "%", 1, 1, 1, 1, 1, 1)
GameTooltip:AddDoubleLine("Current Honor Rank:", Level .. "/" .. LevelMax, 1, 1, 1, 1, 1, 1)
GameTooltip:AddDoubleLine("Prestige Level:", Prestige, 1, 1, 1, 1, 1, 1)
end
GameTooltip:Show()
end)
HonorBar:SetScript("OnLeave", function() GameTooltip:Hide() end)
HonorBar:RegisterEvent("PLAYER_ENTERING_WORLD")
HonorBar:RegisterEvent("HONOR_XP_UPDATE")
HonorBar:RegisterEvent("HONOR_LEVEL_UPDATE")
HonorBar:RegisterEvent("HONOR_PRESTIGE_UPDATE")
HonorBar:SetScript("OnEvent", UpdateHonorBar)