Class IntSliderOption
java.lang.Object
net.uku3lig.ukulib.config.option.IntSliderOption
- All Implemented Interfaces:
WidgetCreator
An int option, represented by a slider.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IntFunction<net.minecraft.network.chat.Component> Converts an int to Text using its String representation. -
Constructor Summary
ConstructorsConstructorDescriptionIntSliderOption(String key, int initialValue, IntConsumer setter, IntFunction<net.minecraft.network.chat.Component> valueToText, int min, int max) Creates a slider option, with no step or tooltip.IntSliderOption(String key, int initialValue, IntConsumer setter, IntFunction<net.minecraft.network.chat.Component> valueToText, int min, int max, int step) Creates a slider option, with no tooltip.IntSliderOption(String key, int initialValue, IntConsumer setter, IntFunction<net.minecraft.network.chat.Component> valueToText, int min, int max, int step, net.minecraft.client.OptionInstance.TooltipSupplier<@NotNull Integer> tooltipSupplier) Creates a slider option. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.client.gui.components.AbstractWidgetcreateWidget(int x, int y, int width, int height) Creates the widget.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface WidgetCreator
createWidget, wide
-
Field Details
-
DEFAULT_INT_TO_TEXT
Converts an int to Text using its String representation.
-
-
Constructor Details
-
IntSliderOption
public IntSliderOption(String key, int initialValue, IntConsumer setter, IntFunction<net.minecraft.network.chat.Component> valueToText, int min, int max, int step, net.minecraft.client.OptionInstance.TooltipSupplier<@NotNull Integer> tooltipSupplier) Creates a slider option.- Parameters:
key- The translation keyinitialValue- The initial valuesetter- The callback for the modified valuevalueToText- The function that converts the value to human-readable textmin- The minimum valuemax- The maximum valuestep- The step between each valuetooltipSupplier- The tooltip supplier
-
IntSliderOption
public IntSliderOption(String key, int initialValue, IntConsumer setter, IntFunction<net.minecraft.network.chat.Component> valueToText, int min, int max, int step) Creates a slider option, with no tooltip.- Parameters:
key- The translation keyinitialValue- The initial valuesetter- The callback for the modified valuevalueToText- The function that converts the value to human-readable textmin- The minimum valuemax- The maximum valuestep- The step between each value
-
IntSliderOption
public IntSliderOption(String key, int initialValue, IntConsumer setter, IntFunction<net.minecraft.network.chat.Component> valueToText, int min, int max) Creates a slider option, with no step or tooltip.- Parameters:
key- The translation keyinitialValue- The initial valuesetter- The callback for the modified valuevalueToText- The function that converts the value to human-readable textmin- The minimum valuemax- The maximum value
-
-
Method Details
-
createWidget
public net.minecraft.client.gui.components.AbstractWidget createWidget(int x, int y, int width, int height) Description copied from interface:WidgetCreatorCreates the widget.- Specified by:
createWidgetin interfaceWidgetCreator- Parameters:
x- The x positiony- The y positionwidth- The widget widthheight- The widget height- Returns:
- The created widget
-