You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.0 KiB
Java

package net.brokenmoon.afloydwiremod.gui;
import net.brokenmoon.afloydwiremod.WireMod;
import net.brokenmoon.afloydwiremod.item.ToolWiring;
import net.brokenmoon.afloydwiremod.tileentity.ChipTileEntity;
import net.minecraft.client.Minecraft;
import net.minecraft.src.*;
import net.minecraft.src.render.Shaders;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
public class GuiWireTool extends GuiScreen {
public ToolWiring tool;
public GuiSlider red;
public GuiSlider green;
public GuiSlider blue;
public GuiSlider alpha;
public GuiSlider widthslider;
public GuiWireTool(EntityPlayerSP entityPlayerSP) {
super.initGui();
this.tool = WireMod.ToolWiringClass;
}
@Override
public void initGui() {
red = new GuiSlider(1, this.width/2-100, this.height/2-40, 200, 20, "Red", tool.red);
green = new GuiSlider(2, this.width/2-100, this.height/2-20, 200, 20, "Green", tool.green);
blue = new GuiSlider(3, this.width/2-100, this.height/2-0, 200, 20, "Blue", tool.blue);
alpha = new GuiSlider(4, this.width/2-100, this.height/2+20, 200, 20, "Alpha", tool.alpha);
widthslider = new GuiSlider(5, this.width/2-100, this.height/2+40, 200, 20, "Width", tool.width);
this.controlList.add(red);
this.controlList.add(green);
this.controlList.add(blue);
this.controlList.add(alpha);
this.controlList.add(widthslider);
}
@Override
public void drawScreen(int x, int y, float renderPartialTicks) {
super.drawScreen(x, y, renderPartialTicks);
if (this.red.dragging) {
this.tool.red = red.sliderValue;
}
if (this.green.dragging) {
this.tool.green = green.sliderValue;
}
if (this.blue.dragging) {
this.tool.blue = blue.sliderValue;
}
if (this.alpha.dragging) {
this.tool.alpha = alpha.sliderValue;
}
if (this.widthslider.dragging) {
this.tool.width = widthslider.sliderValue;
}
}
}