Search in sources :

Example 1 with ValueDisplay

use of net.wurstclient.settings.SliderSetting.ValueDisplay in project Wurst7 by Wurst-Imperium.

the class EditSliderScreen method init.

@Override
public void init() {
    int x1 = width / 2 - 100;
    int y1 = 60;
    int y2 = height / 3 * 2;
    TextRenderer tr = client.textRenderer;
    ValueDisplay vd = ValueDisplay.DECIMAL;
    String valueString = vd.getValueString(slider.getValue());
    valueField = new TextFieldWidget(tr, x1, y1, 200, 20, new LiteralText(""));
    valueField.setText(valueString);
    valueField.setSelectionStart(0);
    addSelectableChild(valueField);
    setInitialFocus(valueField);
    valueField.setTextFieldFocused(true);
    doneButton = new ButtonWidget(x1, y2, 200, 20, new LiteralText("Done"), b -> done());
    addDrawableChild(doneButton);
}
Also used : SliderSetting(net.wurstclient.settings.SliderSetting) LiteralText(net.minecraft.text.LiteralText) Screen(net.minecraft.client.gui.screen.Screen) TextFieldWidget(net.minecraft.client.gui.widget.TextFieldWidget) MatrixStack(net.minecraft.client.util.math.MatrixStack) ButtonWidget(net.minecraft.client.gui.widget.ButtonWidget) MathUtils(net.wurstclient.util.MathUtils) TextRenderer(net.minecraft.client.font.TextRenderer) GLFW(org.lwjgl.glfw.GLFW) ValueDisplay(net.wurstclient.settings.SliderSetting.ValueDisplay) TextFieldWidget(net.minecraft.client.gui.widget.TextFieldWidget) ValueDisplay(net.wurstclient.settings.SliderSetting.ValueDisplay) ButtonWidget(net.minecraft.client.gui.widget.ButtonWidget) TextRenderer(net.minecraft.client.font.TextRenderer) LiteralText(net.minecraft.text.LiteralText)

Aggregations

TextRenderer (net.minecraft.client.font.TextRenderer)1 Screen (net.minecraft.client.gui.screen.Screen)1 ButtonWidget (net.minecraft.client.gui.widget.ButtonWidget)1 TextFieldWidget (net.minecraft.client.gui.widget.TextFieldWidget)1 MatrixStack (net.minecraft.client.util.math.MatrixStack)1 LiteralText (net.minecraft.text.LiteralText)1 SliderSetting (net.wurstclient.settings.SliderSetting)1 ValueDisplay (net.wurstclient.settings.SliderSetting.ValueDisplay)1 MathUtils (net.wurstclient.util.MathUtils)1 GLFW (org.lwjgl.glfw.GLFW)1