aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl3/config/v2/api/autogen/DoubleSlider.java
blob: 268f6a4f676be738a78bc0470c9224301b13fd4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package dev.isxander.yacl3.config.v2.api.autogen;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * A regular option factory.
 * <p>
 * This creates a regular option with a
 * {@link dev.isxander.yacl3.api.controller.DoubleSliderControllerBuilder} controller.
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface DoubleSlider {
    /**
     * The minimum value of the slider.
     * <p>
     * If the current value is at this minimum, if available,
     * the translation key {@code yacl3.config.$configId.$fieldName.fmt.min}
     * will be used.
     */
    double min();

    /**
     * The maximum value of the slider.
     * <p>
     * If the current value is at this maximum, if available,
     * the translation key {@code yacl3.config.$configId.$fieldName.fmt.max}
     * will be used.
     */
    double max();

    /**
     * The step size of this slider.
     * For example, if this is set to 0.1, the slider will
     * increment/decrement by 0.1 when dragging, no less, no more and
     * will always be a multiple of 0.1.
     */
    double step();

    /**
     * The format used to display the double.
     * This is the syntax used in {@link String#format(String, Object...)}.
     */
    String format() default "%.2f";
}