-
Posted by Philburt on Fri, 13 Sep 2013 15:59:47
Hi, I use sliders in my addon, and are usually created using xml such as :
<Frames> <Slider name="abiDeletingSlider1" inherits="OptionsSliderTemplate" minValue="30" maxValue="120" defaultValue="30" valueStep="30" orientation="HORIZONTAL"> <Size x="220" y="15" /> <Anchors> <Anchor point="TOPLEFT"> <Offset x="550" y="-32" /> </Anchor> </Anchors> <Scripts> <OnLoad>abiDeletingSlider1_OnLoad(self:GetName())</OnLoad> <OnValueChanged>abiDeletingSlider1Text:SetText(abiDeletingSlider1:GetValue().." days")</OnValueChanged> </Scripts> </Slider> </Frames>
and the lua code (setting default starting values) for the OnLoad is :
function abiDeletingSlider1_OnLoad(slider) _G[slider.."Low"]:SetText("30"); _G[slider.."High"]:SetText("120"); _G[slider.."Text"]:SetText("30 days"); end
The slider used to move through the values 30,60,90 and 120, but since the 5.40 patch the slider is stepping by a small number (under 1) and is being displayed as 14.5613245523 for example.
How can i get the slider back to working with just the correct integer values, and stepping at the correct interval of 30?