View Single Post
09-29-16, 05:11 AM   #1
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
SetOrientation("VERTICAL") Not working

Hi, i have problem with setting SetOrientation("VERTICAL") on my statusbars it simply just doens't work and i dont understand i've tried to mess with SetPoint too doesn't change anything!

With "Vertical On"

http://imgur.com/a/kkil2

Without "Vertical"

http://imgur.com/a/U3qnm

Lua Code:
  1. local HonorBar = CreateFrame("StatusBar",  nil, UIParent)
  2. HonorBar:SetOrientation("VERTICAL")
  3. HonorBar:SetSize(235, 22)
  4. HonorBar:SetPoint("CENTER", UIParent, 5, -3)
  5. HonorBar:SetStatusBarTexture("Interface\\Buttons\\WHITE8x8")
  6. HonorBar:SetStatusBarColor(222/255, 22/255, 22/255)
  7.  
  8. local HonorFont = HonorBar:CreateFontString(nil, "OVERLAY")  
  9. HonorFont:SetPoint("CENTER", HonorBar)
  10. HonorFont:SetFont("Fonts\\ARIALN.TTF", 12, "THINOUTLINE")    
  11. HonorFont:SetShadowOffset(1, -1)
  12. HonorFont:SetShadowColor(0,0,0)
  13.  
  14. local function UpdateHonorBar()
  15.     local Current, Max = UnitHonor("player"), UnitHonorMax("player")
  16.    
  17.     HonorBar:SetMinMaxValues(0, Max)
  18.     HonorBar:SetValue(Current)
  19.    
  20.     HonorFont:SetText(""..Current.." / "..Max.."")
  21. end
  22.  
  23. HonorBar:SetScript("OnEnter", function(self)
  24.     local Level = UnitHonorLevel("player")
  25.     local LevelMax = GetMaxPlayerHonorLevel()
  26.     local Prestige = UnitPrestige("player")
  27.     local Current, Max = UnitHonor("player"), UnitHonorMax("player")
  28.    
  29.     GameTooltip:SetOwner(self, "ANCHOR_CURSOR")  
  30.    
  31.     if Max == 0 then
  32.         GameTooltip:AddLine(PVP_HONOR_PRESTIGE_AVAILABLE)
  33.         GameTooltip:AddLine(PVP_HONOR_XP_BAR_CANNOT_PRESTIGE_HERE)
  34.     else
  35.         GameTooltip:AddLine(string.format("|cffee2222"..HONOR..": %d / %d (%d%% - %d/%d)|r", Current, Max, Current / Max * 100, (Max - Current) / Max))
  36.         GameTooltip:AddLine(string.format("|cffcccccc"..RANK..": %d / %d|r", Level, LevelMax))
  37.         GameTooltip:AddLine(string.format("|cffcccccc"..PVP_PRESTIGE_RANK_UP_TITLE..": %d|r", Prestige))
  38.     end
  39.  
  40.     GameTooltip:Show()
  41. end)
  42.    
  43. HonorBar:SetScript("OnLeave", function() GameTooltip:Hide() end)
  44.  
  45. HonorBar:RegisterEvent("PLAYER_ENTERING_WORLD")
  46. HonorBar:RegisterEvent("HONOR_XP_UPDATE")
  47. HonorBar:RegisterEvent("HONOR_LEVEL_UPDATE")
  48. HonorBar:RegisterEvent("HONOR_PRESTIGE_UPDATE")
  49.  
  50. HonorBar:SetScript("OnEvent", UpdateHonorBar)
  Reply With Quote