When using a slider for custom part modifiers, the numberOfSteps argument does not affect the actual number of steps. Therefore, all sliders are to 4 decimal places.
I think I misunderstood... The number of steps controls the increments for the slider. for example a slider from 1 to 5 with 5 steps will allow you to set it to 1, 2, 3, 4, or 5. The same slider with 50 steps will increment in small decimals, allowing 50 different positions for the slider. The formatting of the number is somewhat unrelated.
If you need to format the number/label (such as limit it to two decimal places), you can override the 'GetDesignerPropertySliderValueLabel' method on the modifier. For example...
[DesignerPropertySlider(1, 5, 50)]
public int SliderTestProperty;
public override string GetDesignerPropertySliderValueLabel(string propertyName, float sliderValue)
{
if (propertyName == "SliderTestProperty")
{
return sliderValue.ToString("F2");
}
return base.GetDesignerPropertySliderValueLabel(propertyName, sliderValue);
}
my code:
[DesignerPropertySlider(0f,1000,1000,Label = "Fixed Distance",Order = 102)]
public int fixedDist;
it goes up in 1000s?
@NathanMikesa
I think I misunderstood... The number of steps controls the increments for the slider. for example a slider from 1 to 5 with 5 steps will allow you to set it to 1, 2, 3, 4, or 5. The same slider with 50 steps will increment in small decimals, allowing 50 different positions for the slider. The formatting of the number is somewhat unrelated.
If you need to format the number/label (such as limit it to two decimal places), you can override the 'GetDesignerPropertySliderValueLabel' method on the modifier. For example...
I was not aware of this issue. I've logged it and will hopefully investigate it in the near future. Thanks for letting me know.
@nathanmikesa ?
this has existed for a while