Search in sources :

Example 1 with MessageClientSkinWardrobeUpdate

use of riskyken.armourersWorkshop.common.network.messages.client.MessageClientSkinWardrobeUpdate in project Armourers-Workshop by RiskyKen.

the class GuiTabWardrobeColourSettings method actionPerformed.

@Override
protected void actionPerformed(GuiButton button) {
    if (button == selectSkinButton) {
        selectingSkinColour = true;
    }
    if (button == selectHairButton) {
        selectingHairColour = true;
    }
    if (button == autoSkinButton) {
        int newSkinColour = equipmentWardrobeData.autoColourSkin((AbstractClientPlayer) this.entityPlayer);
        EquipmentWardrobeData ewd = new EquipmentWardrobeData(this.equipmentWardrobeData);
        ewd.skinColour = newSkinColour;
        PacketHandler.networkWrapper.sendToServer(new MessageClientSkinWardrobeUpdate(ewd));
    }
    if (button == autoHairButton) {
        int newHairColour = equipmentWardrobeData.autoColourHair((AbstractClientPlayer) this.entityPlayer);
        EquipmentWardrobeData ewd = new EquipmentWardrobeData(this.equipmentWardrobeData);
        ewd.hairColour = newHairColour;
        PacketHandler.networkWrapper.sendToServer(new MessageClientSkinWardrobeUpdate(ewd));
    }
}
Also used : MessageClientSkinWardrobeUpdate(riskyken.armourersWorkshop.common.network.messages.client.MessageClientSkinWardrobeUpdate) EquipmentWardrobeData(riskyken.armourersWorkshop.common.skin.EquipmentWardrobeData)

Example 2 with MessageClientSkinWardrobeUpdate

use of riskyken.armourersWorkshop.common.network.messages.client.MessageClientSkinWardrobeUpdate 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 3 with MessageClientSkinWardrobeUpdate

use of riskyken.armourersWorkshop.common.network.messages.client.MessageClientSkinWardrobeUpdate in project Armourers-Workshop by RiskyKen.

the class GuiTabWardrobeColourSettings method mouseClicked.

@Override
public void mouseClicked(int mouseX, int mouseY, int button) {
    if (button == 0 & selectingSkinColour) {
        EquipmentWardrobeData ewd = new EquipmentWardrobeData(this.equipmentWardrobeData);
        ewd.skinColour = skinColour.getRGB();
        PacketHandler.networkWrapper.sendToServer(new MessageClientSkinWardrobeUpdate(ewd));
        selectingSkinColour = false;
    }
    if (button == 0 & selectingHairColour) {
        EquipmentWardrobeData ewd = new EquipmentWardrobeData(this.equipmentWardrobeData);
        ewd.hairColour = hairColour.getRGB();
        PacketHandler.networkWrapper.sendToServer(new MessageClientSkinWardrobeUpdate(ewd));
        selectingHairColour = false;
    }
    super.mouseClicked(mouseX, mouseY, button);
}
Also used : MessageClientSkinWardrobeUpdate(riskyken.armourersWorkshop.common.network.messages.client.MessageClientSkinWardrobeUpdate) EquipmentWardrobeData(riskyken.armourersWorkshop.common.skin.EquipmentWardrobeData)

Aggregations

MessageClientSkinWardrobeUpdate (riskyken.armourersWorkshop.common.network.messages.client.MessageClientSkinWardrobeUpdate)3 EquipmentWardrobeData (riskyken.armourersWorkshop.common.skin.EquipmentWardrobeData)2 GuiCheckBox (riskyken.armourersWorkshop.client.gui.controls.GuiCheckBox)1