View Single Post
07-26-16, 07:13 PM   #24
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Originally Posted by j3rem1e View Post
If this can help you, I have fixed oUF_Mono by using the following function. Probably not the prettiest things to do as I am not an addon coder, but at least, it works and it's compatible with the Smooth plugin :-)

Code:
local ReverseBar
  do
	local ReverseSetValue = function(self, value)
		local minv, maxv = self:GetMinMaxValues();
		self.__value = value;
		self:__setValue(maxv - value);
	end
	local ReverseGetValue = function(self)
		return self.__value;
	end
	function ReverseBar(f)
		s = CreateFrame("StatusBar", nil, f) 
		s:SetReverseFill(true)
		s.__setValue = s.SetValue;
		s.SetValue = ReverseSetValue;
		s.__value = s:GetValue();
		s.GetValue = ReverseGetValue;
		return s;
	end
  end
Sweet!

I'll have a go with it

Thank you !!
  Reply With Quote