Search in sources :

Example 6 with GuiDropDownList

use of riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList in project Armourers-Workshop by RiskyKen.

the class GuiMannequinTabTexture method initGui.

@Override
public void initGui(int xPos, int yPos, int width, int height) {
    super.initGui(xPos, yPos, width, height);
    textureTypeList = new GuiDropDownList(0, width / 2 - 110, 25, 50, "", this);
    textureTypeList.addListItem(GuiHelper.getLocalizedControlName(tileEntity.getInventoryName(), "dropdown.user"), TextureType.USER.toString(), true);
    textureTypeList.addListItem(GuiHelper.getLocalizedControlName(tileEntity.getInventoryName(), "dropdown.url"), TextureType.URL.toString(), true);
    textureTypeList.setListSelectedIndex(tileEntity.getTextureType().ordinal());
    nameTextbox = new GuiTextField(fontRenderer, width / 2 - 110 + 55, 25, 165, 14);
    nameTextbox.setMaxStringLength(300);
    if (tileEntity.getTextureType() == TextureType.USER) {
        if (tileEntity.getGameProfile() != null) {
            nameTextbox.setText(tileEntity.getGameProfile().getName());
        }
    } else {
        if (tileEntity.getImageUrl() != null) {
            nameTextbox.setText(tileEntity.getImageUrl());
        }
    }
    setNameButton = new GuiButtonExt(0, width / 2 + 60, 45, 50, 14, GuiHelper.getLocalizedControlName(tileEntity.getInventoryName(), "set"));
    setNameButton.width = fontRenderer.getStringWidth(setNameButton.displayString + "  ");
    setNameButton.xPosition = width / 2 + TAB_WIDTH / 2 - setNameButton.width - 10;
    buttonList.add(textureTypeList);
    buttonList.add(setNameButton);
}
Also used : GuiDropDownList(riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList) GuiButtonExt(cpw.mods.fml.client.config.GuiButtonExt) GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 7 with GuiDropDownList

use of riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList in project Armourers-Workshop by RiskyKen.

the class GuiMiniArmourerBuilding method initGui.

@Override
public void initGui() {
    super.initGui();
    buttonList.clear();
    buttonList.add(new GuiButtonExt(0, this.width - 60, this.height - 18, 60, 18, "Exit"));
    buttonList.add(new GuiButtonExt(1, 0, this.height - 18, 60, 18, "Cookies"));
    dropDownParts = new GuiDropDownList(3, 84, 2, 80, "", this);
    dropDownSkins = new GuiDropDownList(2, 2, 2, 80, "", this);
    ArrayList<ISkinType> skinTypes = SkinTypeRegistry.INSTANCE.getRegisteredSkinTypes();
    int skinCount = 0;
    for (int i = 0; i < skinTypes.size(); i++) {
        ISkinType skinType = skinTypes.get(i);
        if (skinType != SkinTypeRegistry.skinSkirt) {
            String skinLocalizedName = SkinTypeRegistry.INSTANCE.getLocalizedSkinTypeName(skinType);
            String skinRegistryName = skinType.getRegistryName();
            dropDownSkins.addListItem(skinLocalizedName, skinRegistryName, skinType.enabled());
            if (skinType == tileEntity.getSkinType()) {
                dropDownSkins.setListSelectedIndex(skinCount);
                updatePartsDropDown(skinType);
            }
            skinCount++;
        }
    }
    buttonList.add(dropDownSkins);
    buttonList.add(dropDownParts);
}
Also used : GuiDropDownList(riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList) ISkinType(riskyken.armourersWorkshop.api.common.skin.type.ISkinType) GuiButtonExt(cpw.mods.fml.client.config.GuiButtonExt)

Example 8 with GuiDropDownList

use of riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList in project Armourers-Workshop by RiskyKen.

the class GuiSkinLibrary method initGui.

@Override
public void initGui() {
    ScaledResolution reso = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
    this.xSize = reso.getScaledWidth();
    this.ySize = reso.getScaledHeight();
    super.initGui();
    String guiName = armourLibrary.getInventoryName();
    int slotSize = 18;
    if (ModAddonManager.addonNEI.isVisible()) {
        neiBump = 18;
    } else {
        neiBump = 0;
    }
    // Move player inventory slots.
    for (int x = 0; x < 9; x++) {
        Slot slot = (Slot) inventorySlots.inventorySlots.get(x);
        slot.yDisplayPosition = this.height + 1 - PADDING - slotSize - neiBump;
    }
    for (int y = 0; y < 3; y++) {
        for (int x = 0; x < 9; x++) {
            Slot slot = (Slot) inventorySlots.inventorySlots.get(x + y * 9 + 9);
            slot.yDisplayPosition = this.height + 1 - INVENTORY_HEIGHT - PADDING + y * slotSize - neiBump;
        }
    }
    // Move library inventory slots.
    Slot slot = (Slot) inventorySlots.inventorySlots.get(36);
    slot.yDisplayPosition = this.height + 2 - INVENTORY_HEIGHT - PADDING * 3 - slotSize - neiBump;
    slot.xDisplayPosition = PADDING + 1;
    slot = (Slot) inventorySlots.inventorySlots.get(37);
    slot.yDisplayPosition = this.height + 2 - INVENTORY_HEIGHT - PADDING * 3 - slotSize - neiBump;
    slot.xDisplayPosition = PADDING + INVENTORY_WIDTH - slotSize - 3;
    buttonList.clear();
    fileSwitchlocal = new GuiIconButton(this, -1, PADDING, TITLE_HEIGHT + PADDING, 50, 30, GuiHelper.getLocalizedControlName(guiName, "rollover.localFiles"), texture);
    fileSwitchRemotePublic = new GuiIconButton(this, -1, PADDING + 51 + PADDING, TITLE_HEIGHT + PADDING, 50, 30, GuiHelper.getLocalizedControlName(guiName, "rollover.remotePublicFiles"), texture);
    fileSwitchRemotePrivate = new GuiIconButton(this, -1, PADDING + 102 + PADDING * 2, TITLE_HEIGHT + PADDING, 50, 30, GuiHelper.getLocalizedControlName(guiName, "rollover.remotePrivateFiles"), texture);
    fileSwitchlocal.setIconLocation(0, 0, 50, 30);
    fileSwitchRemotePublic.setIconLocation(0, 31, 50, 30);
    fileSwitchRemotePrivate.setIconLocation(0, 62, 50, 30);
    openFolderButton = new GuiIconButton(this, 4, PADDING, guiTop + 80, 24, 24, GuiHelper.getLocalizedControlName(guiName, "rollover.openLibraryFolder"), texture);
    openFolderButton.setIconLocation(0, 93, 24, 24);
    buttonList.add(openFolderButton);
    reloadButton = new GuiIconButton(this, -1, PADDING * 2 + 20, guiTop + 80, 24, 24, GuiHelper.getLocalizedControlName(guiName, "rollover.refresh"), texture);
    reloadButton.setIconLocation(75, 93, 24, 24);
    buttonList.add(reloadButton);
    deleteButton = new GuiIconButton(this, -1, PADDING * 3 + 40, guiTop + 80, 24, 24, GuiHelper.getLocalizedControlName(guiName, "rollover.deleteSkin"), texture);
    deleteButton.setIconLocation(0, 118, 24, 24);
    buttonList.add(deleteButton);
    newFolderButton = new GuiIconButton(this, -1, PADDING * 4 + 60, guiTop + 80, 24, 24, GuiHelper.getLocalizedControlName(guiName, "rollover.newFolder"), texture);
    newFolderButton.setIconLocation(75, 118, 24, 24);
    buttonList.add(newFolderButton);
    int listWidth = this.width - INVENTORY_WIDTH - PADDING * 5;
    int listHeight = this.height - TITLE_HEIGHT - 14 - PADDING * 3;
    int typeSwitchWidth = 80;
    listWidth = MathHelper.clamp_int(listWidth, 0, 200);
    fileList = new GuiList(INVENTORY_WIDTH + PADDING * 2, TITLE_HEIGHT + 14 + PADDING * 2, listWidth, listHeight, 14);
    if (mc.isSingleplayer()) {
        fileSwitchRemotePublic.enabled = false;
        fileSwitchRemotePrivate.enabled = false;
        fileSwitchRemotePublic.setDisableText(GuiHelper.getLocalizedControlName(guiName, "rollover.notOnServer"));
        fileSwitchRemotePrivate.setDisableText(GuiHelper.getLocalizedControlName(guiName, "rollover.notOnServer"));
        setFileSwitchType(LibraryFileType.LOCAL);
    } else {
        setFileSwitchType(LibraryFileType.SERVER_PUBLIC);
    }
    buttonList.add(fileSwitchlocal);
    buttonList.add(fileSwitchRemotePublic);
    buttonList.add(fileSwitchRemotePrivate);
    loadSaveButton = new GuiButtonExt(BUTTON_ID_LOAD_SAVE, PADDING * 2 + 18, this.height - INVENTORY_HEIGHT - PADDING * 2 - 2 - 20 - neiBump, 108, 20, "----LS--->");
    buttonList.add(loadSaveButton);
    filenameTextbox = new GuiLabeledTextField(fontRendererObj, PADDING, TITLE_HEIGHT + 30 + PADDING * 2, INVENTORY_WIDTH, 12);
    filenameTextbox.setMaxStringLength(100);
    filenameTextbox.setEmptyLabel(GuiHelper.getLocalizedControlName(guiName, "label.enterFileName"));
    searchTextbox = new GuiLabeledTextField(fontRendererObj, INVENTORY_WIDTH + PADDING * 2, TITLE_HEIGHT + 1 + PADDING, listWidth - typeSwitchWidth - PADDING + 10, 12);
    searchTextbox.setMaxStringLength(100);
    searchTextbox.setEmptyLabel(GuiHelper.getLocalizedControlName(guiName, "label.typeToSearch"));
    searchTextbox.setText(lastSearchText);
    scrollbar = new GuiScrollbar(2, INVENTORY_WIDTH + 10 + listWidth, TITLE_HEIGHT + 14 + PADDING * 2, 10, listHeight, "", false);
    scrollbar.setValue(scrollAmount);
    buttonList.add(scrollbar);
    dropDownList = new GuiDropDownList(5, INVENTORY_WIDTH + PADDING * 5 + listWidth - typeSwitchWidth - PADDING, TITLE_HEIGHT + PADDING, typeSwitchWidth, "", null);
    ArrayList<ISkinType> skinTypes = SkinTypeRegistry.INSTANCE.getRegisteredSkinTypes();
    dropDownList.addListItem("*");
    dropDownList.setListSelectedIndex(0);
    int addCount = 0;
    for (int i = 0; i < skinTypes.size(); i++) {
        ISkinType skinType = skinTypes.get(i);
        if (!skinType.isHidden()) {
            dropDownList.addListItem(SkinTypeRegistry.INSTANCE.getLocalizedSkinTypeName(skinType), skinType.getRegistryName(), true);
            addCount++;
            if (skinType == lastSkinType) {
                dropDownList.setListSelectedIndex(addCount);
            }
        }
    }
    buttonList.add(dropDownList);
    checkBoxTrack = new GuiCheckBox(-1, PADDING, this.height - INVENTORY_HEIGHT - PADDING * 5 - 2 - 20 - neiBump, GuiHelper.getLocalizedControlName(guiName, "trackFile"), trackFile);
    checkBoxTrack.setTextColour(0xCCCCCC);
    buttonList.add(checkBoxTrack);
}
Also used : GuiLabeledTextField(riskyken.armourersWorkshop.client.gui.controls.GuiLabeledTextField) GuiDropDownList(riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList) ISkinType(riskyken.armourersWorkshop.api.common.skin.type.ISkinType) GuiScrollbar(riskyken.armourersWorkshop.client.gui.controls.GuiScrollbar) ScaledResolution(net.minecraft.client.gui.ScaledResolution) GuiList(riskyken.armourersWorkshop.client.gui.controls.GuiList) GuiIconButton(riskyken.armourersWorkshop.client.gui.controls.GuiIconButton) GuiButtonExt(cpw.mods.fml.client.config.GuiButtonExt) Slot(net.minecraft.inventory.Slot) GuiCheckBox(riskyken.armourersWorkshop.client.gui.controls.GuiCheckBox)

Example 9 with GuiDropDownList

use of riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList in project Armourers-Workshop by RiskyKen.

the class GuiDialogClear method initGui.

@Override
public void initGui() {
    super.initGui();
    buttonList.clear();
    buttonClose = new GuiButtonExt(-1, x + width - 80 - 10, y + height - 30, 80, 20, GuiHelper.getLocalizedControlName(name, "close"));
    buttonClear = new GuiButtonExt(-1, x + width - 160 - 20, y + height - 30, 80, 20, GuiHelper.getLocalizedControlName(name, "clear"));
    dropDownParts = new GuiDropDownList(0, x + 10, y + 20, 60, "", null);
    dropDownParts.addListItem("*", "*", true);
    if (skinType != null) {
        if (skinType != SkinTypeRegistry.skinBlock) {
            for (int i = 0; i < skinType.getSkinParts().size(); i++) {
                ISkinPartType partType = skinType.getSkinParts().get(i);
                addPartToDropDown(dropDownParts, partType);
            }
        } else {
            boolean multiblock = SkinProperties.PROP_BLOCK_MULTIBLOCK.getValue(skinProperties);
            ISkinPartType partType;
            if (multiblock) {
                partType = ((SkinBlock) SkinTypeRegistry.skinBlock).partMultiblock;
            } else {
                partType = ((SkinBlock) SkinTypeRegistry.skinBlock).partBase;
            }
            addPartToDropDown(dropDownParts, partType);
        }
    }
    dropDownParts.setListSelectedIndex(0);
    checkClearBlocks = new GuiCheckBox(0, x + 10, y + height - 60, GuiHelper.getLocalizedControlName(name, "clearBlocks"), true);
    checkClearPaint = new GuiCheckBox(0, x + 10, y + height - 50, GuiHelper.getLocalizedControlName(name, "clearPaint"), true);
    checkClearMarkers = new GuiCheckBox(0, x + 10, y + height - 70, GuiHelper.getLocalizedControlName(name, "clearMarkers"), true);
    buttonList.add(buttonClose);
    buttonList.add(buttonClear);
    buttonList.add(dropDownParts);
    buttonList.add(checkClearBlocks);
    buttonList.add(checkClearPaint);
    buttonList.add(checkClearMarkers);
}
Also used : GuiDropDownList(riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList) ISkinPartType(riskyken.armourersWorkshop.api.common.skin.type.ISkinPartType) GuiButtonExt(cpw.mods.fml.client.config.GuiButtonExt) GuiCheckBox(riskyken.armourersWorkshop.client.gui.controls.GuiCheckBox)

Example 10 with GuiDropDownList

use of riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList 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

GuiDropDownList (riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList)10 GuiButtonExt (cpw.mods.fml.client.config.GuiButtonExt)7 GuiCheckBox (riskyken.armourersWorkshop.client.gui.controls.GuiCheckBox)6 GuiTextField (net.minecraft.client.gui.GuiTextField)4 ISkinType (riskyken.armourersWorkshop.api.common.skin.type.ISkinType)3 ISkinPartType (riskyken.armourersWorkshop.api.common.skin.type.ISkinPartType)2 Color (java.awt.Color)1 ScaledResolution (net.minecraft.client.gui.ScaledResolution)1 Slot (net.minecraft.inventory.Slot)1 GuiColourSelector (riskyken.armourersWorkshop.client.gui.controls.GuiColourSelector)1 GuiCustomSlider (riskyken.armourersWorkshop.client.gui.controls.GuiCustomSlider)1 GuiHSBSlider (riskyken.armourersWorkshop.client.gui.controls.GuiHSBSlider)1 GuiIconButton (riskyken.armourersWorkshop.client.gui.controls.GuiIconButton)1 GuiInventorySize (riskyken.armourersWorkshop.client.gui.controls.GuiInventorySize)1 GuiLabeledTextField (riskyken.armourersWorkshop.client.gui.controls.GuiLabeledTextField)1 GuiList (riskyken.armourersWorkshop.client.gui.controls.GuiList)1 GuiScrollbar (riskyken.armourersWorkshop.client.gui.controls.GuiScrollbar)1 SkinProperties (riskyken.armourersWorkshop.common.skin.data.SkinProperties)1 SkinTypeRegistry (riskyken.armourersWorkshop.common.skin.type.SkinTypeRegistry)1 MovementType (riskyken.armourersWorkshop.common.skin.type.wings.SkinWings.MovementType)1