예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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));
        }
예제 #3
0
        /// <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);
        }
예제 #4
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);
                }
            }
        }
예제 #5
0
 public void SetArmorPieceColor(ItemAppearanceArmorModel modelSlot, ItemAppearanceArmorColor colorSlot, byte value)
 {
     SetArmorPieceColor((CreaturePart)modelSlot, colorSlot, value);
 }
예제 #6
0
 public byte GetArmorPieceColor(ItemAppearanceArmorModel modelSlot, ItemAppearanceArmorColor colorSlot)
 {
     return(GetArmorPieceColor((CreaturePart)modelSlot, colorSlot));
 }
예제 #7
0
 public void ClearArmorPieceColor(ItemAppearanceArmorModel modelSlot, ItemAppearanceArmorColor colorSlot)
 {
     ClearArmorPieceColor((CreaturePart)modelSlot, colorSlot);
 }
예제 #8
0
 /// <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);
 }
예제 #9
0
 public byte this[ItemAppearanceArmorColor color]
 {
     get => ColorArray[(int)color];