using System;
using UnityEngine;

namespace pdinklag.CPW.Common
{
    [CreateAssetMenu(fileName = "CAWAttire", menuName = "Wrestle/CAW/Attire")]
    public class CAWAttireDescriptor : ScriptableObject
    {
        [Serializable]
        public struct BaseMeshOverlay
        {
            [Tooltip("The address of the overlay mask, an all-white texture where the alpha channel determines what is part of the attire.")]
            public AssetAddress Mask;

            // TODO: un-texturable diffuse map?
            // TODO: normal map?
        }

        [Header("Declaration")]
        [Tooltip("The base mesh that this piece of attire can be used on. If empty, this attire can be used on any base mesh.")]
        public AssetAddress BaseMesh;

        [Tooltip("The attire slot.")]
        public string Slot;

        [Tooltip("The localization key to use for display purposes. If empty, a key will be generated from the address.")]
        public string DisplayStringKey;

        [Header("Texturing")]
        [Tooltip("Only attire textures with this tag can be selected for this attire (all if empty).")]
        public string TextureTag;

        [Header("Base Mesh Overlay")]
        [Tooltip("The main overlay. If the attire is one-sided, this is used as the right side overlay.")]
        public BaseMeshOverlay[] Overlays;

        [Tooltip("The index of the right overlay - only used if the attire is one-sided.")]
        public int RightOverlay = 0;

        [Tooltip("The index of the right overlay - only used if the attire is one-sided.")]
        public int LeftOverlay = 1;

        [Header("Mesh")]
        [Tooltip("The address of the mesh prefab.")]
        public AssetAddress MeshPrefab;

        [Header("One-Sided Attire")]
        [Tooltip("Is this attire one-sided and the user can select a side?")]
        public CAWAttireOneSidedMode OneSidedMode = CAWAttireOneSidedMode.None;

        [Tooltip("The default side selection.")]
        public CAWAttireSide DefaultSide = CAWAttireSide.Both;
    }
}
