예제 #1
0
        public static string BuildMessage(string message, ChatColor color = ChatColor.white, ChatStyle style = ChatStyle.normal)
        {
            string colorPrefix = "<color=" + color.ToString() + ">";
            string colorSuffix = "</color>";
            string stylePrefix, styleSuffix;

            switch (style)
            {
            case ChatStyle.bold:
                stylePrefix = "<b>";
                styleSuffix = "</b>";
                break;

            case ChatStyle.bolditalic:
                stylePrefix = "<b><i>";
                styleSuffix = "</i></b>";
                break;

            case ChatStyle.italic:
                stylePrefix = "<i>";
                styleSuffix = "</i>";
                break;

            default:
                stylePrefix = "";
                styleSuffix = "";
                break;
            }

            return(stylePrefix + colorPrefix + message + colorSuffix + styleSuffix);
        }
예제 #2
0
 private void ChangeChatColor()
 {
     if (chatProgramIsStart)
     {
         if (mainController == MainController.ServerController)
         {
             serverController.ChangeChatColor();
             MessageBox.Show("채팅 색상이 변경되었습니다.");
         }
         else
         {
             clientController.ChangeChatColor(ChatColor.ToString());
         }
     }
     else
     {
         MessageBox.Show("먼저 접속하여 주세요.", "오류", MessageBoxButtons.OK);
     }
 }