using UnityEngine;
using UnityEngine.UI;

public class UIPopupPastePanel : UIPopupMessage
{
    public Toggle
        Root,
        Morphs,
        Body,
        Ears,
        //EarsAlt,
        Tail,
        //TailAlt,
        Other,
        Position,
        Rotation,
        Scale;

    public PoseLoadOptions GetResult()
    {
        return new PoseLoadOptions(false)
        {
            Root    = Root.isOn,
            Morphs  = Morphs.isOn,
            Body    = Body.isOn,
            Ears    = Ears.isOn,
            //EarsAlt = EarsAlt.isOn,
            Tail    = Tail.isOn,
            //TailAlt = TailAlt.isOn,
            Other   = Other.isOn,
            Position = Position.isOn,
            Rotation = Rotation.isOn,
            Scale   = Scale.isOn
        };
    }

    public static UIPopupPastePanel Create(System.Action<PoseLoadOptions> onConfirm, System.Action onDeny)
    {
        var popup = Instantiate(SharedResources.Instance.PopupPastePanel, ModelViewerInterface.GetInstance().MainCanvas.transform);
        popup.transform.SetAsLastSibling();
        //popup.SetMessage(message);
        popup.OnConfirm.AddListener(() => onConfirm.Invoke(popup.GetResult()));
        popup.OnDeny.AddListener(() => onDeny.Invoke());
        return popup;
    }
}
