net.minecraftforge.fml.client.config.GuiSlider Java Examples

The following examples show how to use net.minecraftforge.fml.client.config.GuiSlider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BlockOverlayColor.java    From Hyperium with GNU Lesser General Public License v3.0 6 votes vote down vote up
public void initGui() {
    super.buttonList.add(buttonChroma = new GuiButton(0, super.width / 2 - 50, super.height / 2 - 60, 100, 20,
        "Chroma: " + (mod.getSettings().isChroma() ? "On" : "Off")));
    super.buttonList.add(sliderChroma = new GuiSlider(1, super.width / 2 - 50, super.height / 2 - 35, 100, 20,
        "Speed: ", "", 1, 5, mod.getSettings().getChromaSpeed(), false, true));
    super.buttonList.add(sliderRed = new GuiSlider(2, super.width / 2 - 50, super.height / 2 - 35, 100, 20,
        "Red: ", "", 0, 255, mod.getSettings().getOverlayRed() * 255, false, true));
    super.buttonList.add(sliderGreen = new GuiSlider(3, super.width / 2 - 50, super.height / 2 - 10, 100, 20,
        "Green: ", "", 0, 255, mod.getSettings().getOverlayGreen() * 255, false, true));
    super.buttonList.add(sliderBlue = new GuiSlider(4, super.width / 2 - 50, super.height / 2 + 15, 100, 20,
        "Blue: ", "", 0, 255, mod.getSettings().getOverlayBlue() * 255, false, true));
    super.buttonList.add(sliderAlpha = new GuiSlider(5, super.width / 2 - 50, super.height / 2 + 40, 100, 20,
        "Alpha: ", "", 0, 255, mod.getSettings().getOverlayAlpha() * 255, false, true));
    super.buttonList.add(buttonBack = new GuiButton(6, super.width / 2 - 50, super.height / 2 + 65, 100, 20,
        "Back"));
}
 
Example #2
Source File: GuiPlayerPositioning.java    From MediaMod with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void initGui() {
    Settings.loadConfig();

    this.buttonList.add(new CustomButton(2, width / 2 - 100, height - 83, EnumChatFormatting.GREEN + I18n.format("menu.guiplayerpositioning.buttons.save.name")));
    this.buttonList.add(new CustomButton(1, width / 2 - 100, height - 60, EnumChatFormatting.RED + I18n.format("menu.guiplayerpositioning.buttons.reset.name")));
    this.buttonList.add(new CustomButton(0, width / 2 - 100, height - 37, I18n.format("menu.guiplayerpositioning.buttons.back.name")));
    this.buttonList.add(slider = new GuiSlider(3, width / 2 - 75, height - 105, 150, 20, I18n.format("menu.guiplayerpositioning.buttons.slider.prefix") + " ", "", 0.1, 2.0, Settings.PLAYER_ZOOM, true, false, it -> {
        // custom display string change stuff
        it.displayString = it.dispString + (Math.round(it.getValue() * 10) / 10.0) + it.suffix;
    }));
    slider.updateSlider(); // call custom display string changer

    super.initGui();
}
 
Example #3
Source File: MixinGuiDisconnected.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
private void drawReconnectDelaySlider() {
    buttonList.add(autoReconnectDelaySlider =
            new GuiSlider(2, this.width / 2 + 2, this.height / 2 + field_175353_i / 2
                    + this.fontRendererObj.FONT_HEIGHT + 22, 98, 20, "AutoReconnect: ",
                    "ms", AutoReconnect.MIN, AutoReconnect.MAX, AutoReconnect.INSTANCE.getDelay(), false, true,
                    guiSlider -> {
                        AutoReconnect.INSTANCE.setDelay(guiSlider.getValueInt());

                        this.reconnectTimer = 0;
                        this.updateReconnectButton();
                        this.updateSliderText();
                    }));
}
 
Example #4
Source File: GuiScreenBackgroundColor.java    From Hyperium with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void initGui() {
    buttonList.add(new GuiSlider(0, width / 2 - 80, calculateHeight(3), 150, 20, "Red: ", "",
        0, 255, red.getAmount(), false, true) {
        @Override
        public void updateSlider() {
            super.updateSlider();
            red.onScroll(getValue(), getValueInt());
            updated = true;
        }
    });

    buttonList.add(new GuiSlider(1, width / 2 - 80, calculateHeight(4), 150, 20, "Green: ", "",
        0, 255, green.getAmount(), false, true) {
        @Override
        public void updateSlider() {
            super.updateSlider();
            green.onScroll(getValue(), getValueInt());
            updated = true;
        }
    });

    buttonList.add(new GuiSlider(2, width / 2 - 80, calculateHeight(5), 150, 20, "Blue: ", "",
        0, 255, blue.getAmount(), false, true) {
        @Override
        public void updateSlider() {
            super.updateSlider();
            blue.onScroll(getValue(), getValueInt());
            updated = true;
        }
    });

    buttonList.add(new GuiButton(3, 5, height - 25, 100, 20, "Back"));
}
 
Example #5
Source File: BlockOverlayGui.java    From Hyperium with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void initGui() {
    super.buttonList.add(buttonMode = new GuiButton(0, super.width / 2 - 50, super.height / 2 - 35, 100, 20,
        "Mode: " + mod.getSettings().getOverlayMode().getName()));
    super.buttonList.add(buttonColor = new GuiButton(1, super.width / 2 - 50, super.height / 2 - 10, 100, 20,
        "Color"));
    super.buttonList.add(sliderWidth = new GuiSlider(2, super.width / 2 - 50, super.height / 2 + 15, 100, 20,
        "Width: ", "", 0.0f, 5.0f, mod.getSettings().getLineWidth(), false, true));
}
 
Example #6
Source File: GuiScreenSettings.java    From Hyperium with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void initGui() {
    buttonList.add(new GuiButton(0, getCenter() - 75, getRowPos(1), 150, 20, "Sidebar: " + getSuffix(sidebar.enabled)));
    buttonList.add(new GuiButton(1, getCenter() - 75, getRowPos(2), 150, 20, "Red Numbers: " + getSuffix(sidebar.redNumbers)));
    buttonList.add(new GuiButton(2, getCenter() - 75, getRowPos(3), 150, 20, "Shadow: " + getSuffix(sidebar.shadow)));
    buttonList.add(new GuiButton(3, getCenter() - 75, getRowPos(4), 150, 20, "Change Background"));
    buttonList.add(sliderScale = new GuiSlider(4, getCenter() - 75, getRowPos(5), 150, 20, "Scale: ", "%", 50.0, 200.0, Math.round(sidebar.scale * 100.0f), false, true));
    buttonList.add(new GuiButton(5, getCenter() - 75, getRowPos(6), 150, 20, "Reset Sidebar"));
}
 
Example #7
Source File: GuiScreenBackground.java    From Hyperium with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void initGui() {
    buttonList.add(new GuiButton(0, getCenter() - 75, getRowPos(1), 150, 20, "Chroma: " + getSuffix(sidebar.chromaEnabled)));
    buttonList.add(buttonChromaType = new GuiButton(7, getCenter() - 75, getRowPos(2), 150, 20, "Chroma type: " + sidebar.chromaType.getName()));
    buttonList.add(sliderRed = new GuiSlider(1, getCenter() - 75, getRowPos(2), 150, 20, "Red: ", "", 0.0, 255.0, sidebar.color >> 16 & 0xFF, false, true));
    buttonList.add(sliderGreen = new GuiSlider(2, getCenter() - 75, getRowPos(3), 150, 20, "Green: ", "", 0.0, 255.0, sidebar.color >> 8 & 0xFF, false, true));
    buttonList.add(sliderBlue = new GuiSlider(3, getCenter() - 75, getRowPos(4), 150, 20, "Blue: ", "", 0.0, 255.0, sidebar.color & 0xFF, false, true));
    buttonList.add(sliderAlpha = new GuiSlider(4, getCenter() - 75, getRowPos(5), 150, 20, "Alpha: ", "", 0.0, 255.0, sidebar.alpha, false, true));
    buttonList.add(sliderChromaSpeed = new GuiSlider(3, getCenter() - 75, getRowPos(4), 150, 20, "Chroma Speed: ", "", 1.0, 10.0, sidebar.chromaSpeed, false, true));
    buttonList.add(buttonDone = new GuiButton(6, getCenter() - 75, getRowPos(6), 150, 20, "Done"));
    setSlidersVisibility();
}
 
Example #8
Source File: LevelheadGui.java    From Hyperium with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void regSlider(GuiSlider slider) {
    reg(slider, null);
}
 
Example #9
Source File: GuiScreenColor.java    From Hyperium with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void initGui() {
    buttonList.add(new GuiSlider(0, width / 2 - 150, calculateHeight(3), 150, 20, "Red: ", "",
        0, 255, red.getAmount(), false, true) {
        @Override
        public void updateSlider() {
            super.updateSlider();
            red.onScroll(getValue(), getValueInt());
            updated = true;
        }
    });
    buttonList.add(new GuiSlider(1, width / 2 - 150, calculateHeight(4), 150, 20, "Green: ", "",
        0, 255, green.getAmount(), false, true) {
        @Override
        public void updateSlider() {
            super.updateSlider();
            green.onScroll(getValue(), getValueInt());
            updated = true;
        }
    });
    buttonList.add(new GuiSlider(2, width / 2 - 150, calculateHeight(5), 150, 20, "Blue: ", "",
        0, 255, blue.getAmount(), false, true) {
        @Override
        public void updateSlider() {
            super.updateSlider();
            blue.onScroll(getValue(), getValueInt());
            updated = true;
        }
    });
    buttonList.add(new GuiSlider(3, width / 2 + 5, calculateHeight(3), 150, 20, "Pressed Red: ", "",
        0, 255, pressedRed.getAmount(), false, true) {
        @Override
        public void updateSlider() {
            super.updateSlider();
            pressedRed.onScroll(getValue(), getValueInt());
            updated = true;
        }
    });
    buttonList.add(new GuiSlider(4, width / 2 + 5, calculateHeight(4), 150, 20, "Pressed Green: ", "",
        0, 255, pressedGreen.getAmount(), false, true) {
        @Override
        public void updateSlider() {
            super.updateSlider();
            pressedGreen.onScroll(getValue(), getValueInt());
            updated = true;
        }
    });
    buttonList.add(new GuiSlider(5, width / 2 + 5, calculateHeight(5), 150, 20, "Pressed Blue: ", "",
        0, 255, pressedBlue.getAmount(), false, true) {
        @Override
        public void updateSlider() {
            super.updateSlider();
            pressedBlue.onScroll(getValue(), getValueInt());
            updated = true;
        }
    });
    buttonList.add(new GuiButton(6, 5, height - 25, 100, 20, "Back"));
}