Search in sources :

Example 1 with GuiInventorySize

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

the class GuiTabArmourerSkinSettings method initGui.

@Override
public void initGui(int xPos, int yPos, int width, int height) {
    super.initGui(xPos, yPos, width, height);
    String guiName = tileEntity.getInventoryName();
    buttonList.clear();
    SkinProperties skinProps = tileEntity.getSkinProps();
    checkBlockGlowing = new GuiCheckBox(15, 10, 20, GuiHelper.getLocalizedControlName(guiName, "glowing"), SkinProperties.PROP_BLOCK_GLOWING.getValue(skinProps));
    checkBlockLadder = new GuiCheckBox(15, 10, 35, GuiHelper.getLocalizedControlName(guiName, "ladder"), SkinProperties.PROP_BLOCK_LADDER.getValue(skinProps));
    checkBlockNoCollision = new GuiCheckBox(15, 10, 50, GuiHelper.getLocalizedControlName(guiName, "noCollision"), SkinProperties.PROP_BLOCK_NO_COLLISION.getValue(skinProps));
    checkBlockSeat = new GuiCheckBox(15, 10, 65, GuiHelper.getLocalizedControlName(guiName, "seat"), SkinProperties.PROP_BLOCK_SEAT.getValue(skinProps));
    checkBlockMultiblock = new GuiCheckBox(15, 10, 80, GuiHelper.getLocalizedControlName(guiName, "multiblock"), SkinProperties.PROP_BLOCK_MULTIBLOCK.getValue(skinProps));
    checkBlockBed = new GuiCheckBox(15, 22, 95, GuiHelper.getLocalizedControlName(guiName, "bed"), SkinProperties.PROP_BLOCK_BED.getValue(skinProps));
    checkBlockEnderInventory = new GuiCheckBox(15, 10, 110, GuiHelper.getLocalizedControlName(guiName, "enderInventory"), SkinProperties.PROP_BLOCK_ENDER_INVENTORY.getValue(skinProps));
    checkBlockInventory = new GuiCheckBox(15, 10, 125, GuiHelper.getLocalizedControlName(guiName, "inventory"), SkinProperties.PROP_BLOCK_INVENTORY.getValue(skinProps));
    if (!checkBlockMultiblock.isChecked()) {
        checkBlockBed.enabled = false;
        checkBlockBed.setIsChecked(false);
    } else {
        checkBlockBed.enabled = true;
    }
    // TODO remove to re-enable beds
    checkBlockBed.enabled = false;
    checkBlockEnderInventory.enabled = !checkBlockInventory.isChecked();
    checkBlockInventory.enabled = !checkBlockEnderInventory.isChecked();
    if (checkBlockInventory.isChecked()) {
        checkBlockEnderInventory.setIsChecked(false);
    }
    if (checkBlockEnderInventory.isChecked()) {
        checkBlockInventory.setIsChecked(false);
    }
    inventorySize = new GuiInventorySize(10, 158, 9, 6);
    inventorySize.setSrc(TEXTURE, 176, 0);
    inventorySize.setSelection(SkinProperties.PROP_BLOCK_INVENTORY_WIDTH.getValue(skinProps), SkinProperties.PROP_BLOCK_INVENTORY_HEIGHT.getValue(skinProps));
    sliderWingIdleSpeed = new GuiCustomSlider(15, 10, 45, 154, 10, "", "ms", 200D, 10000D, SkinProperties.PROP_WINGS_IDLE_SPEED.getValue(skinProps), false, true, this);
    sliderWingFlyingSpeed = new GuiCustomSlider(15, 10, 65, 154, 10, "", "ms", 200D, 10000D, SkinProperties.PROP_WINGS_FLYING_SPEED.getValue(skinProps), false, true, this);
    sliderWingMinAngle = new GuiCustomSlider(15, 10, 85, 154, 10, "", DEGREE, -180D, 180D, SkinProperties.PROP_WINGS_MIN_ANGLE.getValue(skinProps), false, true, this);
    sliderWingMaxAngle = new GuiCustomSlider(15, 10, 105, 154, 10, "", DEGREE, -180D, 180D, SkinProperties.PROP_WINGS_MAX_ANGLE.getValue(skinProps), false, true, this);
    sliderWingIdleSpeed.setFineTuneButtons(true);
    sliderWingFlyingSpeed.setFineTuneButtons(true);
    sliderWingMinAngle.setFineTuneButtons(true);
    sliderWingMaxAngle.setFineTuneButtons(true);
    checkArmourOverrideBodyPart = new GuiCheckBox(15, 10, 20, GuiHelper.getLocalizedControlName(guiName, "overrideBodyPart"), SkinProperties.PROP_ARMOUR_OVERRIDE.getValue(skinProps));
    checkArmourHideOverlay = new GuiCheckBox(15, 10, 35, GuiHelper.getLocalizedControlName(guiName, "hideOverlay"), SkinProperties.PROP_ARMOUR_HIDE_OVERLAY.getValue(skinProps));
    MovementType skinMovmentType = MovementType.valueOf(SkinProperties.PROP_WINGS_MOVMENT_TYPE.getValue(skinProps));
    dropDownList = new GuiDropDownList(0, 10, 125, 50, "", this);
    for (int i = 0; i < MovementType.values().length; i++) {
        MovementType movementType = MovementType.values()[i];
        String unlocalizedName = "movmentType." + LibModInfo.ID.toLowerCase() + ":" + movementType.name().toLowerCase();
        String localizedName = StatCollector.translateToLocal(unlocalizedName);
        dropDownList.addListItem(localizedName, movementType.name(), true);
        if (movementType == skinMovmentType) {
            dropDownList.setListSelectedIndex(i);
        }
    }
    buttonList.add(checkBlockGlowing);
    buttonList.add(checkBlockLadder);
    buttonList.add(checkBlockNoCollision);
    buttonList.add(checkBlockSeat);
    buttonList.add(checkBlockMultiblock);
    buttonList.add(checkBlockBed);
    buttonList.add(checkBlockInventory);
    buttonList.add(checkBlockEnderInventory);
    buttonList.add(inventorySize);
    buttonList.add(sliderWingIdleSpeed);
    buttonList.add(sliderWingFlyingSpeed);
    buttonList.add(sliderWingMinAngle);
    buttonList.add(sliderWingMaxAngle);
    buttonList.add(checkArmourOverrideBodyPart);
    buttonList.add(checkArmourHideOverlay);
    buttonList.add(dropDownList);
}
Also used : GuiDropDownList(riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList) GuiInventorySize(riskyken.armourersWorkshop.client.gui.controls.GuiInventorySize) GuiCustomSlider(riskyken.armourersWorkshop.client.gui.controls.GuiCustomSlider) GuiCheckBox(riskyken.armourersWorkshop.client.gui.controls.GuiCheckBox) SkinProperties(riskyken.armourersWorkshop.common.skin.data.SkinProperties) MovementType(riskyken.armourersWorkshop.common.skin.type.wings.SkinWings.MovementType)

Aggregations

GuiCheckBox (riskyken.armourersWorkshop.client.gui.controls.GuiCheckBox)1 GuiCustomSlider (riskyken.armourersWorkshop.client.gui.controls.GuiCustomSlider)1 GuiDropDownList (riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList)1 GuiInventorySize (riskyken.armourersWorkshop.client.gui.controls.GuiInventorySize)1 SkinProperties (riskyken.armourersWorkshop.common.skin.data.SkinProperties)1 MovementType (riskyken.armourersWorkshop.common.skin.type.wings.SkinWings.MovementType)1