Пример #1
0
 public void Print(string msg, MsgColor color, bool bold = false)
 {
     try
     {
         LogBox.BeginInvoke(new InvokeDebugDelegate(BeginPrint), new object[] { msg, color, bold });
     }
     catch { }
 }
Пример #2
0
        public static void SetTimeFor(Player player)
        {
            if (TimeNow.Hours != DateTime.UtcNow.Hour)
            {
                return;
            }

            var color = System.Drawing.Color.FromArgb(255, LastColor, LastColor, LastColor);

            player.Send(MsgColor.Create(player, color));
            player.Send(MsgText.Create("Server", player.Name, $"Color: {LastColor}| SenderUniqueId: {DateTime.UtcNow.ToShortTimeString()} | TimeNow.Seconds / 192 = ({TimeNow.TotalSeconds / 192})", MsgTextType.Talk));
        }
Пример #3
0
            private void BeginPrint(string txt, MsgColor color, bool bold)
            {
                int lastSymbol = LogBox.Text.Length;

                LogBox.AppendText(txt);
                LogBox.Select(lastSymbol, LogBox.Text.Length - lastSymbol);
                switch (color)
                {
                case MsgColor.Black:
                    LogBox.SelectionColor = Color.Black;
                    break;

                case MsgColor.Red:
                    LogBox.SelectionColor = Color.Red;
                    break;

                case MsgColor.Green:
                    LogBox.SelectionColor = Color.Green;
                    break;

                case MsgColor.Purple:
                    LogBox.SelectionColor = Color.Purple;
                    break;

                case MsgColor.Orange:
                    LogBox.SelectionColor = Color.Orange;
                    break;

                case MsgColor.Blue:
                    LogBox.SelectionColor = Color.Navy;
                    break;

                default:
                    LogBox.SelectionColor = Color.Black;
                    break;
                }
                LogBox.SelectionFont = new Font(LogBox.SelectionFont, FontStyle.Bold);

                LogBox.Select(LogBox.Text.Length, 0);

                LogBox.SelectionFont = new Font(LogBox.SelectionFont, FontStyle.Regular);
                LogBox.ScrollToCaret();
            }