Ejemplo n.º 1
0
        internal static void ListHandler(Player p, string[] args, bool all)
        {
            int offset = 0, index = 0, count = 0;

            if (args != null && args.Length > 1)
            {
                int.TryParse(args[1], out offset);
            }
            CustomColor[] cols = Colors.ExtColors;

            for (int i = 0; i < cols.Length; i++)
            {
                CustomColor col = cols[i];
                if (col.Undefined)
                {
                    continue;
                }

                if (index >= offset)
                {
                    count++;
                    const string format = "{4}{0} &{1}({2}){4} - %{1}, falls back to &{3}%{3}.";
                    Player.SendMessage(p, String.Format(format, col.Name, col.Code, col.Hex(), col.Fallback, Server.DefaultColor), false);

                    if (count >= 8 && !all)
                    {
                        const string helpFormat = "To see the next set of custom colors, type %T/ccols list {0}";
                        Player.Message(p, helpFormat, offset + 8);
                        return;
                    }
                }
                index++;
            }
        }