use of riskyken.armourersWorkshop.utils.UtilColour.ColourFamily in project Armourers-Workshop by RiskyKen.
the class GuiColourMixer method onDropDownListChanged.
@Override
public void onDropDownListChanged(GuiDropDownList dropDownList) {
if (dropDownList == colourFamilyList) {
ColourFamily cf = ColourFamily.values()[dropDownList.getListSelectedIndex()];
colourSelector.setColourFamily(cf);
MessageClientGuiButton message = new MessageClientGuiButton((byte) cf.ordinal());
PacketHandler.networkWrapper.sendToServer(message);
}
if (dropDownList == paintTypeDropDown) {
updateColour();
}
}
use of riskyken.armourersWorkshop.utils.UtilColour.ColourFamily in project Armourers-Workshop by RiskyKen.
the class GuiColourMixer method initGui.
@Override
public void initGui() {
super.initGui();
colour = new Color(tileEntityColourMixer.getColour(0));
float[] hsbvals = Color.RGBtoHSB(colour.getRed(), colour.getGreen(), colour.getBlue(), null);
slidersHSB = new GuiHSBSlider[3];
slidersHSB[0] = new GuiHSBSlider(0, this.guiLeft + 5, this.guiTop + 30, 128, 10, this, HSBSliderType.HUE, hsbvals[0], hsbvals[0], hsbvals[2]);
slidersHSB[1] = new GuiHSBSlider(1, this.guiLeft + 5, this.guiTop + 50, 128, 10, this, HSBSliderType.SATURATION, hsbvals[1], hsbvals[0], hsbvals[2]);
slidersHSB[2] = new GuiHSBSlider(2, this.guiLeft + 5, this.guiTop + 70, 128, 10, this, HSBSliderType.BRIGHTNESS, hsbvals[2], hsbvals[0], hsbvals[2]);
buttonList.add(slidersHSB[0]);
buttonList.add(slidersHSB[1]);
buttonList.add(slidersHSB[2]);
colourHex = new GuiTextField(fontRendererObj, this.guiLeft + 5, this.guiTop + 90, 50, 10);
colourHex.setMaxStringLength(7);
updateHexTextbox();
colourSelector = new GuiColourSelector(3, this.guiLeft + 5, this.guiTop + 110, 82, 22, 10, 10, 8, guiTexture);
buttonList.add(colourSelector);
colourFamilyList = new GuiDropDownList(4, this.guiLeft + 89, this.guiTop + 110, 82, "", this);
for (int i = 0; i < ColourFamily.values().length; i++) {
ColourFamily cf = ColourFamily.values()[i];
colourFamilyList.addListItem(cf.getLocalizedName());
}
ColourFamily cf = tileEntityColourMixer.getColourFamily();
colourFamilyList.setListSelectedIndex(cf.ordinal());
colourSelector.setColourFamily(cf);
buttonList.add(colourFamilyList);
paintTypeDropDown = new GuiDropDownList(5, this.guiLeft + 170, this.guiTop + 30, 78, "", this);
updatePaintTypeDropDown();
buttonList.add(paintTypeDropDown);
}
Aggregations