View Feature Request | ||||||||||||||
|
Notes | Sort Options |
By: Seerah - 04/06/14 03:33 PM |
LAM:AddSlider() returns a reference to the slider option. Code:
local sliderOptions = LAM:AddSlider(........) local slider = sliderOptions:GetNamedChild("Slider") slider:SetMinMax(min, max) Code:
LAM:AddSlider(ID, "Name1", .......) Name1Slider:SetMinMax(min, max) |
By: zgrssd - 05/24/14 07:46 PM |
How about doing this logic in the get/set functions instead of the Slider? Sliders are only a convenient way to assign numerical values. It is not that the sliders should not be outside a certain range. It is that the values they represent should not be out of a certain range. And if they should not be out of that range when beign set by the slider, they should never be out of that range. Note that a passive error model (accept all entries but give a warning message if they do not match the rules) is generally a better idea then trying to enforce certain values. |
By: ivanwfr - 05/30/14 06:50 AM |
I could find a solution to do exactly what you are looking for that works with the current version. I used it for the Alert+Warning items quantity of Greymind Quick Slot Bar Settings menu. |
By: ivanwfr - 05/30/14 11:51 AM |
Code:
-- slider 1 setFunc function(value) if(value <= QuantityAlert) then value = QuantityAlert+1 -- discard changes QuantitySlider:GetNamedChild("Slider" ):SetValue(value/(Q_MAX+1)) QuantitySlider:GetNamedChild("ValueLabel"):SetText (tostring(value)) end QuantityWarning = value Refresh() Show() end -- slider 2 etFunc function(value) if(value >= QuantityWarning) then value = QuantityWarning-1 -- discard changes QuantitySlider:GetNamedChild("Slider" ):SetValue(value/(Q_MAX+1)) QuantitySlider:GetNamedChild("ValueLabel"):SetText (tostring(value)) end QuantityAlert = value Refresh() Show() end |