Esempio n. 1
0
        private void OnGameMessageRaised(object sender, GameMessageEventArgs e)
        {
            //Add a new block, which is a paragraph that contains a run (string of text)
            //with the message to the rich text box.
            GameMessages.Document.Blocks.Add(new Paragraph(new Run(e.Message)));

            //Scroll to end of rich text box as we want player to always see the last messages.
            GameMessages.ScrollToEnd();
        }
Esempio n. 2
0
        private void OnGameMessageRaised(object sender, GameMessageEventArgs e)
        {
            Brush foreground = Brushes.White; // Normal default

            if (e.Level == Emote.HAPPY)
            {
                foreground = Brushes.ForestGreen;
            }
            else if (e.Level == Emote.DANGEROUS)
            {
                foreground = Brushes.IndianRed;
            }
            else if (e.Level == Emote.FATAL)
            {
                foreground = Brushes.Red;
            }
            else if (e.Level == Emote.MOCKING)
            {
                foreground = Brushes.Gray;
            }
            else if (e.Level == Emote.STOIC)
            {
                foreground = Brushes.Gray;
            }
            else if (e.Level == Emote.FANTASTIC)
            {
                foreground = Brushes.Gold;
            }
            else if (e.Level == Emote.REQUIRED)
            {
                foreground = Brushes.DarkSlateGray;
            }
            else if (e.Level == Emote.REWARD)
            {
                foreground = Brushes.Goldenrod;
            }

            var a = new Paragraph(new Run(e.Message)
            {
                Foreground = foreground
            });

            GameMessages.Document.Blocks.Add(a);
            GameMessages.ScrollToEnd();
        }
Esempio n. 3
0
 private void OnGameMessageRaised(object sender, GameMessagesEventArgs e)
 {
     GameMessages.Document.Blocks.Add(new Paragraph(new Run(e.Message)));
     GameMessages.ScrollToEnd();
 }
 private void _gameSession_OnMessageRaised(object sender, Engine.EventArgs.GameMessageEventArgs e)
 {
     GameMessages.Document.Blocks.Add(new Paragraph(new Run(e.Message)));
     GameMessages.ScrollToEnd();
 }