Double Value
doubleValue()
Creates a double value.
DoubleValue distance = category.doubleValue("distance", 4.0);
min()
Sets the minimum.
distance.min(1.0);
If no minimum is provided, SSCL uses 0.0.
max()
Sets the maximum.
distance.max(32.0);
If no maximum is provided, there is no practical maximum limit.
min() / max()
Gets the effective minimum and maximum.
double min = distance.min();
double max = distance.max();
decimals()
Controls how many decimal places are shown in Mod Menu.
distance.decimals(1);
Examples:
.decimals(1)->4.0.decimals(2)->4.00.decimals(3)->4.000
For sliders, this also controls the UI step.
.decimals(1)->0.1.decimals(2)->0.01.decimals(3)->0.001
This is UI-only. SSCL does not round the actual stored double value because of this setting.
Slider Behavior
A double becomes a slider in Mod Menu only when both min() and max() are explicitly set.
category.doubleValue("distance", 4.0)
.min(1.0)
.max(32.0)
.decimals(1);
Without both bounds, Mod Menu uses an edit box.
rangeComment()
Controls the automatic range comment. Enabled by default.
With:
.min(1.0)
.max(32.0)
SSCL automatically adds the comment:
# Range: 1.0 - 32.0
To disable it, use:
.rangeComment(false)
get()
double value = distance.get();
set()
distance.set(8.5);
getDefault()
double defaultValue = distance.getDefault();
resetToDefault()
distance.resetToDefault();
comment()
distance.comment("Camera distance.");
tooltip()
distance.tooltip("How far the camera is placed behind the player.");