Search in sources :

Example 16 with SkinProperties

use of riskyken.armourersWorkshop.common.skin.data.SkinProperties in project Armourers-Workshop by RiskyKen.

the class GuiTabArmourerSkinSettings method actionPerformed.

@Override
protected void actionPerformed(GuiButton button) {
    SkinProperties skinProps = tileEntity.getSkinProps();
    if (!checkBlockMultiblock.isChecked()) {
        checkBlockBed.enabled = false;
        checkBlockBed.setIsChecked(false);
    } else {
        checkBlockBed.enabled = true;
    }
    checkBlockEnderInventory.enabled = !checkBlockInventory.isChecked();
    checkBlockInventory.enabled = !checkBlockEnderInventory.isChecked();
    if (checkBlockInventory.isChecked()) {
        checkBlockEnderInventory.setIsChecked(false);
    }
    if (checkBlockEnderInventory.isChecked()) {
        checkBlockInventory.setIsChecked(false);
    }
    // TODO remove to re-enable beds
    checkBlockBed.enabled = false;
    if (button == checkBlockGlowing | button == checkBlockLadder | button == checkBlockNoCollision | button == checkBlockSeat | button == checkBlockMultiblock | button == checkBlockBed | button == checkBlockInventory | button == inventorySize | button == checkBlockEnderInventory) {
        SkinProperties.PROP_BLOCK_GLOWING.setValue(skinProps, checkBlockGlowing.isChecked());
        SkinProperties.PROP_BLOCK_LADDER.setValue(skinProps, checkBlockLadder.isChecked());
        SkinProperties.PROP_BLOCK_NO_COLLISION.setValue(skinProps, checkBlockNoCollision.isChecked());
        SkinProperties.PROP_BLOCK_SEAT.setValue(skinProps, checkBlockSeat.isChecked());
        SkinProperties.PROP_BLOCK_MULTIBLOCK.setValue(skinProps, checkBlockMultiblock.isChecked());
        SkinProperties.PROP_BLOCK_BED.setValue(skinProps, checkBlockBed.isChecked());
        SkinProperties.PROP_BLOCK_INVENTORY.setValue(skinProps, checkBlockInventory.isChecked());
        SkinProperties.PROP_BLOCK_ENDER_INVENTORY.setValue(skinProps, checkBlockEnderInventory.isChecked());
        SkinProperties.PROP_BLOCK_INVENTORY_WIDTH.setValue(skinProps, inventorySize.getSelectionWidth());
        SkinProperties.PROP_BLOCK_INVENTORY_HEIGHT.setValue(skinProps, inventorySize.getSelectionHeight());
        PacketHandler.networkWrapper.sendToServer(new MessageClientGuiSetArmourerSkinProps(skinProps));
    }
    if (button == checkArmourOverrideBodyPart | button == checkArmourHideOverlay) {
        SkinProperties.PROP_ARMOUR_OVERRIDE.setValue(skinProps, checkArmourOverrideBodyPart.isChecked());
        SkinProperties.PROP_ARMOUR_HIDE_OVERLAY.setValue(skinProps, checkArmourHideOverlay.isChecked());
        PacketHandler.networkWrapper.sendToServer(new MessageClientGuiSetArmourerSkinProps(skinProps));
    }
    inventorySize.visible = checkBlockInventory.isChecked();
}
Also used : MessageClientGuiSetArmourerSkinProps(riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiSetArmourerSkinProps) SkinProperties(riskyken.armourersWorkshop.common.skin.data.SkinProperties)

Aggregations

SkinProperties (riskyken.armourersWorkshop.common.skin.data.SkinProperties)16 MessageClientGuiSetArmourerSkinProps (riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiSetArmourerSkinProps)4 Skin (riskyken.armourersWorkshop.common.skin.data.Skin)3 IOException (java.io.IOException)2 ItemStack (net.minecraft.item.ItemStack)2 ISkinType (riskyken.armourersWorkshop.api.common.skin.type.ISkinType)2 NewerFileVersionException (riskyken.armourersWorkshop.common.exception.NewerFileVersionException)2 ItemSkin (riskyken.armourersWorkshop.common.items.ItemSkin)2 GameProfile (com.mojang.authlib.GameProfile)1 ArrayList (java.util.ArrayList)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 ChatComponentText (net.minecraft.util.ChatComponentText)1 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 PlayerTexture (riskyken.armourersWorkshop.client.texture.PlayerTexture)1 InvalidCubeTypeException (riskyken.armourersWorkshop.common.exception.InvalidCubeTypeException)1 SkinSaveException (riskyken.armourersWorkshop.common.exception.SkinSaveException)1 ModInventory (riskyken.armourersWorkshop.common.inventory.ModInventory)1