View Single Post
07-21-16, 12:20 PM   #21
j3rem1e
A Defias Bandit
Join Date: Oct 2014
Posts: 2
I reopen a really old thread, but with the 7.0 patch, the "ReverseBar" function doesn't work, and I don't have any idea why. Calling "tex:SetPoint" with any parameters doesn't seem to have any effect.

I am using a custom fork of oUF_Mono witch use this function :

lua Code:
  1. local ReverseBar
  2. do
  3.     local UpdaterOnUpdate = function(Updater)
  4.         Updater:Hide()
  5.         local b = Updater:GetParent()
  6.         local tex = b:GetStatusBarTexture()
  7.         tex:ClearAllPoints()
  8.         tex:SetPoint("BOTTOMRIGHT")
  9.         tex:SetPoint("TOPLEFT", b, "TOPRIGHT", (b:GetValue()/select(2,b:GetMinMaxValues())-1)*b:GetWidth(), 0)
  10.     end
  11.     local OnChanged = function(bar)
  12.         bar.Updater:Show()
  13.     end
  14.     function ReverseBar(f)
  15.         local bar = CreateFrame("StatusBar", nil, f)
  16.         bar.Updater = CreateFrame("Frame", nil, bar)
  17.         bar.Updater:Hide()
  18.         bar.Updater:SetScript("OnUpdate", UpdaterOnUpdate)
  19.         bar:SetScript("OnSizeChanged", OnChanged)
  20.         bar:SetScript("OnValueChanged", OnChanged)
  21.         bar:SetScript("OnMinMaxChanged", OnChanged)
  22.         return bar;
  23.     end
  24. end

Using ReverseFill doesn't work either, because of the Smooth plugin : calling SetValue in a PostUpdate callback make the bar going from right to left continually. I'll try to hack this plugin, but this solution doesn't look very good to me.

Any help appreciated, and I apologize for my bad english :-)
  Reply With Quote