Search in sources :

Example 6 with EquipmentWardrobeData

use of riskyken.armourersWorkshop.common.skin.EquipmentWardrobeData 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)

Example 7 with EquipmentWardrobeData

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

the class GuiTabWardrobeColourSettings method drawBackgroundLayer.

@Override
public void drawBackgroundLayer(float partialTickTime, int mouseX, int mouseY) {
    GL11.glColor4f(1, 1, 1, 1);
    // Top half of GUI. (active tab)
    this.drawTexturedModalRect(this.x, this.y, 0, 0, 236, 151);
    // Bottom half of GUI. (player inventory)
    this.drawTexturedModalRect(this.x + 29, this.y + 151, 29, 151, 178, 89);
    PlayerPointer playerPointer = new PlayerPointer(entityPlayer);
    EquipmentWardrobeData newEwd = equipmentWardrobeData = ClientProxy.equipmentWardrobeHandler.getEquipmentWardrobeData(playerPointer);
    if (newEwd != null) {
        equipmentWardrobeData = newEwd;
    }
    float skinR = (float) skinColour.getRed() / 255;
    float skinG = (float) skinColour.getGreen() / 255;
    float skinB = (float) skinColour.getBlue() / 255;
    // Skin colour display
    this.drawTexturedModalRect(this.x + 68, this.y + 30, 242, 180, 14, 14);
    GL11.glColor4f(skinR, skinG, skinB, 1F);
    this.drawTexturedModalRect(this.x + 69, this.y + 31, 243, 181, 12, 12);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    float hairR = (float) hairColour.getRed() / 255;
    float hairG = (float) hairColour.getGreen() / 255;
    float hairB = (float) hairColour.getBlue() / 255;
    // Hair colour display
    this.drawTexturedModalRect(this.x + 68, this.y + 82, 242, 180, 14, 14);
    GL11.glColor4f(hairR, hairG, hairB, 1F);
    this.drawTexturedModalRect(this.x + 69, this.y + 83, 243, 181, 12, 12);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
Also used : PlayerPointer(riskyken.armourersWorkshop.common.data.PlayerPointer) EquipmentWardrobeData(riskyken.armourersWorkshop.common.skin.EquipmentWardrobeData)

Example 8 with EquipmentWardrobeData

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

the class PaintingHelper method getLocalPlayersSkinColour.

@SideOnly(Side.CLIENT)
public static int getLocalPlayersSkinColour() {
    PlayerPointer playerPointer = new PlayerPointer(Minecraft.getMinecraft().thePlayer);
    EquipmentWardrobeData ewd = ClientProxy.equipmentWardrobeHandler.getEquipmentWardrobeData(playerPointer);
    if (ewd != null) {
        return ewd.skinColour;
    }
    return Color.decode("#F9DFD2").getRGB();
}
Also used : PlayerPointer(riskyken.armourersWorkshop.common.data.PlayerPointer) EquipmentWardrobeData(riskyken.armourersWorkshop.common.skin.EquipmentWardrobeData) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 9 with EquipmentWardrobeData

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

the class PaintingHelper method getLocalPlayersHairColour.

@SideOnly(Side.CLIENT)
public static int getLocalPlayersHairColour() {
    PlayerPointer playerPointer = new PlayerPointer(Minecraft.getMinecraft().thePlayer);
    EquipmentWardrobeData ewd = ClientProxy.equipmentWardrobeHandler.getEquipmentWardrobeData(playerPointer);
    if (ewd != null) {
        return ewd.hairColour;
    }
    return Color.decode("#804020").getRGB();
}
Also used : PlayerPointer(riskyken.armourersWorkshop.common.data.PlayerPointer) EquipmentWardrobeData(riskyken.armourersWorkshop.common.skin.EquipmentWardrobeData) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 10 with EquipmentWardrobeData

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

the class EquipmentRenderHandler method isArmourRenderOverridden.

@Override
public boolean isArmourRenderOverridden(EntityPlayer player, int slotId) {
    if (slotId < 4 & slotId >= 0) {
        return false;
    }
    if (player == null) {
        return false;
    }
    EquipmentWardrobeHandler ewh = ClientProxy.equipmentWardrobeHandler;
    EquipmentWardrobeData ewd = ewh.getEquipmentWardrobeData(new PlayerPointer(player));
    if (ewd != null) {
        return ewd.armourOverride.get(slotId);
    }
    return false;
}
Also used : PlayerPointer(riskyken.armourersWorkshop.common.data.PlayerPointer) EquipmentWardrobeData(riskyken.armourersWorkshop.common.skin.EquipmentWardrobeData)

Aggregations

EquipmentWardrobeData (riskyken.armourersWorkshop.common.skin.EquipmentWardrobeData)14 PlayerPointer (riskyken.armourersWorkshop.common.data.PlayerPointer)11 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)6 EntityPlayer (net.minecraft.entity.player.EntityPlayer)5 MannequinFakePlayer (riskyken.armourersWorkshop.client.render.MannequinFakePlayer)5 AbstractClientPlayer (net.minecraft.client.entity.AbstractClientPlayer)3 ISkinDye (riskyken.armourersWorkshop.api.common.skin.data.ISkinDye)3 Skin (riskyken.armourersWorkshop.common.skin.data.Skin)3 SideOnly (cpw.mods.fml.relauncher.SideOnly)2 Color (java.awt.Color)2 RenderPlayer (net.minecraft.client.renderer.entity.RenderPlayer)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 FakePlayer (net.minecraftforge.common.util.FakePlayer)2 EntityTextureInfo (riskyken.armourersWorkshop.client.render.EntityTextureInfo)2 MessageClientSkinWardrobeUpdate (riskyken.armourersWorkshop.common.network.messages.client.MessageClientSkinWardrobeUpdate)2 WrongUsageException (net.minecraft.command.WrongUsageException)1 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)1 ItemStack (net.minecraft.item.ItemStack)1 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)1 Point3D (riskyken.armourersWorkshop.api.common.skin.Point3D)1