function SliderClass.Get(p)local J=p._Spring.x if p.Inverted then J=1-J end return J end function SliderClass.Set(v,p,J)local A=v._Spring local d=math.clamp(p,0,1)if v.Interval>0 then d=math.floor(d/v.Interval+.5)*v.Interval end A.t=d A.instant=not J end function SliderClass.Destroy(p)p._Maid:Sweep()p.Changed=nil p.Clicked=nil p.StartDrag=nil p.StopDrag=nil p.Frame=nil end


function SliderClass:Get()
	local t = self._Spring.x
	if (self.Inverted) then t = 1 - t end
	return t
end

function SliderClass:Set(value, doTween)
	local spring = self._Spring
	local newT = math.clamp(value, 0, 1)
	
	if (self.Interval > 0) then
		newT = math.floor((newT / self.Interval) + 0.5) * self.Interval
	end
	
	spring.t = newT
	spring.instant = not doTween
end

function SliderClass:Destroy()
	self._Maid:Sweep()
	--self.Frame:Destroy()
	self.Changed = nil
	self.Clicked = nil
	self.StartDrag = nil
	self.StopDrag = nil
	self.Frame = nil
end
