Search in sources :

Example 1 with ColourFamily

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();
    }
}
Also used : MessageClientGuiButton(riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiButton) ColourFamily(riskyken.armourersWorkshop.utils.UtilColour.ColourFamily)

Example 2 with ColourFamily

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);
}
Also used : GuiColourSelector(riskyken.armourersWorkshop.client.gui.controls.GuiColourSelector) GuiDropDownList(riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList) GuiHSBSlider(riskyken.armourersWorkshop.client.gui.controls.GuiHSBSlider) Color(java.awt.Color) GuiTextField(net.minecraft.client.gui.GuiTextField) ColourFamily(riskyken.armourersWorkshop.utils.UtilColour.ColourFamily)

Aggregations

ColourFamily (riskyken.armourersWorkshop.utils.UtilColour.ColourFamily)2 Color (java.awt.Color)1 GuiTextField (net.minecraft.client.gui.GuiTextField)1 GuiColourSelector (riskyken.armourersWorkshop.client.gui.controls.GuiColourSelector)1 GuiDropDownList (riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList)1 GuiHSBSlider (riskyken.armourersWorkshop.client.gui.controls.GuiHSBSlider)1 MessageClientGuiButton (riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiButton)1