Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new tooltip
        /// </summary>
        /// <param name="name">The title of the tooltip</param>
        /// <param name="desc">The text of the tooltip</param>
        /// <param name="reqs">The assets required for the described ContextButton</param>
        /// <param name="icons">The IconNumbers to slot</param>
        public Tooltip(string name, string desc, List <string> reqs, params IconNumber[] icons)
        {
            Name        = name;
            Description = desc;

            if (reqs != null)
            {
                foreach (string req in reqs)
                {
                    Requirements.Add(UnitType.GetUnitType(req).Name);
                }
            }

            if (icons.Length > 0)
            {
                Icon1 = icons[0];
            }
            else
            {
                Icon1 = null;
            }
            if (icons.Length > 1)
            {
                Icon2 = icons[1];
            }
            else
            {
                Icon2 = null;
            }
            if (icons.Length > 2)
            {
                Icon3 = icons[2];
            }
            else
            {
                Icon3 = null;
            }
            if (icons.Length > 3)
            {
                Icon4 = icons[3];
            }
            else
            {
                Icon4 = null;
            }
            if (icons.Length > 4)
            {
                Icon5 = icons[4];
            }
            else
            {
                Icon5 = null;
            }
            if (icons.Length > 5)
            {
                Icon6 = icons[5];
            }
            else
            {
                Icon6 = null;
            }
        }