/// <summary> /// Sets the armor color for a piece of this item. /// </summary> /// <param name="modelSlot">The model portion of the slot to assign.</param> /// <param name="colorSlot">The color portion of the slot to assign.</param> /// <param name="value">The new color to assign.</param> public void SetArmorPieceColor(CreaturePart modelSlot, ItemAppearanceArmorColor colorSlot, byte value) { const int numColors = NWScript.ITEM_APPR_ARMOR_NUM_COLORS; int index = numColors + (int)modelSlot * numColors + (int)colorSlot; SetArmorColor((ItemAppearanceArmorColor)index, value); }
/// <summary> /// Gets the armor color for a piece of this item. /// </summary> /// <param name="modelSlot">The model portion of the slot to query.</param> /// <param name="colorSlot">The color portion of the slot to query.</param> public byte GetArmorPieceColor(CreaturePart modelSlot, ItemAppearanceArmorColor colorSlot) { const int numColors = NWScript.ITEM_APPR_ARMOR_NUM_COLORS; int index = numColors + (int)modelSlot * numColors + (int)colorSlot; return(GetArmorColor((ItemAppearanceArmorColor)index)); }
/// <summary> /// Gets the armor color of this item. /// </summary> /// <param name="slot">The armor color slot index to query.</param> public byte GetArmorColor(ItemAppearanceArmorColor slot) { int index = (int)slot; if (index >= 0 && index <= 119) { //1.69 colors if (index <= 5) { return(item.Item.m_nLayeredTextureColors[index]); } //per-part coloring byte part = (byte)((index - 6) / 6); byte texture = (byte)(index - 6 - part * 6); return(item.Item.GetLayeredTextureColorPerPart(texture, part)); } return(0); }
/// <summary> /// Sets the armor color of this item. /// </summary> /// <param name="slot">The armor color slot index to be assigned.</param> /// <param name="value">The new color to assign.</param> public void SetArmorColor(ItemAppearanceArmorColor slot, byte value) { int index = (int)slot; if (index >= 0 && index <= 119) { //1.69 colors if (index <= 5) { item.Item.m_nLayeredTextureColors[index] = value; } //per-part coloring else { byte part = (byte)((index - 6) / 6); byte texture = (byte)(index - 6 - part * 6); item.Item.SetLayeredTextureColorPerPart(texture, part, value); } } }
public void SetArmorPieceColor(ItemAppearanceArmorModel modelSlot, ItemAppearanceArmorColor colorSlot, byte value) { SetArmorPieceColor((CreaturePart)modelSlot, colorSlot, value); }
public byte GetArmorPieceColor(ItemAppearanceArmorModel modelSlot, ItemAppearanceArmorColor colorSlot) { return(GetArmorPieceColor((CreaturePart)modelSlot, colorSlot)); }
public void ClearArmorPieceColor(ItemAppearanceArmorModel modelSlot, ItemAppearanceArmorColor colorSlot) { ClearArmorPieceColor((CreaturePart)modelSlot, colorSlot); }
/// <summary> /// Clears any per-part color overrides set for the specified part slot. /// </summary> /// <param name="modelSlot">The model portion of the slot to clear.</param> /// <param name="colorSlot">The color portion of the slot to clear.</param> public void ClearArmorPieceColor(CreaturePart modelSlot, ItemAppearanceArmorColor colorSlot) { SetArmorPieceColor(modelSlot, colorSlot, 255); }
public byte this[ItemAppearanceArmorColor color] { get => ColorArray[(int)color];