Search in sources :

Example 6 with GuiCheckBox

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

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

the class GuiTabWardrobeDisplaySettings method actionPerformed.

@Override
protected void actionPerformed(GuiButton button) {
    if (button instanceof GuiCheckBox) {
        headOverlay = !overlayOverrideCheck[0].isChecked();
        for (int i = 0; i < 4; i++) {
            armourOverride.set(i, !armourOverrideCheck[i].isChecked());
        }
    }
    if (button.id >= 1) {
        equipmentWardrobeData.headOverlay = headOverlay;
        equipmentWardrobeData.armourOverride = armourOverride;
        equipmentWardrobeData.limitLimbs = limitLimbsCheck.isChecked();
        PacketHandler.networkWrapper.sendToServer(new MessageClientSkinWardrobeUpdate(equipmentWardrobeData));
    }
}
Also used : MessageClientSkinWardrobeUpdate(riskyken.armourersWorkshop.common.network.messages.client.MessageClientSkinWardrobeUpdate) GuiCheckBox(riskyken.armourersWorkshop.client.gui.controls.GuiCheckBox)

Example 8 with GuiCheckBox

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

the class GuiTabWardrobeDisplaySettings method initGui.

@Override
public void initGui(int xPos, int yPos, int width, int height) {
    super.initGui(xPos, yPos, width, height);
    armourOverrideCheck = new GuiCheckBox[4];
    armourOverrideCheck[0] = new GuiCheckBox(2, 68, 17, GuiHelper.getLocalizedControlName(guiName, "renderHeadArmour"), !armourOverride.get(0));
    armourOverrideCheck[1] = new GuiCheckBox(3, 68, 37, GuiHelper.getLocalizedControlName(guiName, "renderChestArmour"), !armourOverride.get(1));
    armourOverrideCheck[2] = new GuiCheckBox(4, 68, 75, GuiHelper.getLocalizedControlName(guiName, "renderLegArmour"), !armourOverride.get(2));
    armourOverrideCheck[3] = new GuiCheckBox(5, 68, 94, GuiHelper.getLocalizedControlName(guiName, "renderFootArmour"), !armourOverride.get(3));
    overlayOverrideCheck = new GuiCheckBox[1];
    overlayOverrideCheck[0] = new GuiCheckBox(6, 68, 26, GuiHelper.getLocalizedControlName(guiName, "renderHeadOverlay"), !headOverlay);
    limitLimbsCheck = new GuiCheckBox(7, 68, 56, GuiHelper.getLocalizedControlName(guiName, "limitLimbMovement"), limitLimbs);
    buttonList.add(overlayOverrideCheck[0]);
    buttonList.add(armourOverrideCheck[0]);
    buttonList.add(armourOverrideCheck[1]);
    buttonList.add(armourOverrideCheck[2]);
    buttonList.add(armourOverrideCheck[3]);
    buttonList.add(limitLimbsCheck);
}
Also used : GuiCheckBox(riskyken.armourersWorkshop.client.gui.controls.GuiCheckBox)

Example 9 with GuiCheckBox

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

the class ToolOptionCheck method writeToNBT.

@Override
public void writeToNBT(NBTTagCompound compound, GuiButton control) {
    GuiCheckBox checkControl = (GuiCheckBox) control;
    writeToNBT(compound, checkControl.isChecked());
}
Also used : GuiCheckBox(riskyken.armourersWorkshop.client.gui.controls.GuiCheckBox)

Example 10 with GuiCheckBox

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

the class GuiHologramProjectorTabRotationOffset method initGui.

@Override
public void initGui(int xPos, int yPos, int width, int height) {
    super.initGui(xPos, yPos, width, height);
    guiLoaded = false;
    sliderOffsetX = new GuiCustomSlider(-1, (int) ((width / 2F) - (200 / 2F)) + 10, 30, 178, 10, "X: ", "", -64D, 64D, tileEntity.getRotationOffsetX(), false, true, this);
    sliderOffsetY = new GuiCustomSlider(-1, (int) ((width / 2F) - (200 / 2F)) + 10, 45, 178, 10, "Y: ", "", -64D, 64D, tileEntity.getRotationOffsetY(), false, true, this);
    sliderOffsetZ = new GuiCustomSlider(-1, (int) ((width / 2F) - (200 / 2F)) + 10, 60, 178, 10, "Z: ", "", -64D, 64D, tileEntity.getRotationOffsetZ(), false, true, this);
    checkShowRotationPoint = new GuiCheckBox(-1, (int) ((width / 2F) - (200 / 2F)) + 10, 75, GuiHelper.getLocalizedControlName(inventoryName, "showRotationPoint"), tileEntity.isShowRotationPoint());
    sliderOffsetX.setFineTuneButtons(true);
    sliderOffsetY.setFineTuneButtons(true);
    sliderOffsetZ.setFineTuneButtons(true);
    buttonList.add(sliderOffsetX);
    buttonList.add(sliderOffsetY);
    buttonList.add(sliderOffsetZ);
    buttonList.add(checkShowRotationPoint);
    guiLoaded = true;
}
Also used : GuiCustomSlider(riskyken.armourersWorkshop.client.gui.controls.GuiCustomSlider) GuiCheckBox(riskyken.armourersWorkshop.client.gui.controls.GuiCheckBox)

Aggregations

GuiCheckBox (riskyken.armourersWorkshop.client.gui.controls.GuiCheckBox)12 GuiDropDownList (riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList)6 GuiButtonExt (cpw.mods.fml.client.config.GuiButtonExt)4 ISkinPartType (riskyken.armourersWorkshop.api.common.skin.type.ISkinPartType)2 GuiCustomSlider (riskyken.armourersWorkshop.client.gui.controls.GuiCustomSlider)2 GuiTextField (net.minecraft.client.gui.GuiTextField)1 ScaledResolution (net.minecraft.client.gui.ScaledResolution)1 Slot (net.minecraft.inventory.Slot)1 ISkinType (riskyken.armourersWorkshop.api.common.skin.type.ISkinType)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 MessageClientSkinWardrobeUpdate (riskyken.armourersWorkshop.common.network.messages.client.MessageClientSkinWardrobeUpdate)1 SkinProperties (riskyken.armourersWorkshop.common.skin.data.SkinProperties)1 MovementType (riskyken.armourersWorkshop.common.skin.type.wings.SkinWings.MovementType)1 PowerMode (riskyken.armourersWorkshop.common.tileentities.TileEntityHologramProjector.PowerMode)1