예제 #1
0
        static string ParseColor(object value)
        {
            string col = value.ToString().Trim();

            if (col == "")
            {
                return(col);
            }

            // Try parse color name, then color code
            string parsed = Colors.Parse(col);

            if (parsed != "")
            {
                return(parsed);
            }
            return(Colors.Name(col) == "" ? "" : col);
        }
예제 #2
0
        /// <summary> Attempts to change the color of the target player </summary>
        public static bool SetColor(Player p, string target, string name)
        {
            string color = "";
            Player who   = PlayerInfo.FindExact(target);

            if (name.Length == 0)
            {
                color = Group.GroupIn(target).Color;

                PlayerDB.Update(target, PlayerData.ColumnColor, "");
                MessageAction(p, target, who, "λACTOR &Sremoved λTARGET color");
            }
            else
            {
                color = Matcher.FindColor(p, name);
                if (color == null)
                {
                    return(false);
                }

                PlayerDB.Update(target, PlayerData.ColumnColor, color);
                MessageAction(p, target, who, "λACTOR &Schanged λTARGET color to " + color + Colors.Name(color));
            }
            if (who != null)
            {
                who.UpdateColor(color);
            }
            return(true);
        }
예제 #3
0
        /// <summary> Attempts to change the title color of the target player </summary>
        public static bool SetTitleColor(Player p, string target, string name)
        {
            string color = "";
            Player who   = PlayerInfo.FindExact(target);

            if (name.Length == 0)
            {
                MessageAction(p, target, who, "λACTOR &Sremoved λTARGET title color");
            }
            else
            {
                color = Matcher.FindColor(p, name);
                if (color == null)
                {
                    return(false);
                }

                MessageAction(p, target, who, "λACTOR &Schanged λTARGET title color to " + color + Colors.Name(color));
            }

            if (who != null)
            {
                who.titlecolor = color;
            }
            if (who != null)
            {
                who.SetPrefix();
            }
            PlayerDB.Update(target, PlayerData.ColumnTColor, color);
            return(true);
        }