Exemplo n.º 1
0
 public override bool IsTheSameAs(ConsoleMessage message)
 {
     if (message is ConsoleLogMessage logMessage)
     {
         return(conditionText.text == logMessage.conditionText.text && stackTraceText.text == logMessage.stackTraceText.text && messageType == logMessage.messageType);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 2
0
 public override bool IsFromTheSameSourceAs(ConsoleMessage message)
 {
     if (message is ConsoleLogMessage logMessage)
     {
         return(stackTraceText.text == logMessage.stackTraceText.text);
     }
     else
     {
         return(false);
     }
 }
 public override bool IsTheSameAs(ConsoleMessage message)
 {
     if (message is ConsoleCommandMessage commandMessage)
     {
         return(commandText.text == commandMessage.commandText.text && messageType == commandMessage.messageType);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 4
0
        public void FilterMessages()
        {
            for (int i = 0; i < messages.Count; i++)
            {
                messages[i].ResetCollapseCount();
                messages[i].gameObject.SetActive(FilterMessage(messages[i]));
                //TryCollapseMessage(messages[i]);
            }

            if (config.GetCollapseState())
            {
                for (int i = 0; i < messages.Count; i++)
                {
                    if (!messages[i].gameObject.activeInHierarchy)
                    {
                        continue;
                    }

                    ConsoleMessage collapsedParent = null;
                    for (int ii = 0; ii < messages.Count; ii++)
                    {
                        if (!messages[ii].gameObject.activeInHierarchy)
                        {
                            continue;
                        }

                        // Check if message is the same and from the same source.
                        if (messages[i].IsTheSameAs(messages[ii]) && messages[i].IsFromTheSameSourceAs(messages[ii]))
                        {
                            // We need to leave one message active and collapse all other messages into it.
                            // Check if we already have a 'god message'.
                            if (!collapsedParent)
                            {
                                collapsedParent = messages[ii];
                            }
                            else
                            {
                                collapsedParent.IncrementCollapseCount();
                                messages[ii].gameObject.SetActive(false);
                            }
                        }
                    }
                }
            }

            StartCoroutine(UpdateWindowScrollPositions());
        }
Exemplo n.º 5
0
        private void TryCollapseMessage(ConsoleMessage message)
        {
            if (!message.gameObject.activeInHierarchy || !config.GetCollapseState())
            {
                return;
            }

            for (int i = 0; i < messages.Count; i++)
            {
                if (messages[i] == message)
                {
                    continue;
                }

                if (messages[i].IsTheSameAs(message) && messages[i].IsFromTheSameSourceAs(message))
                {
                    messages[i].IncrementCollapseCount();
                    message.gameObject.SetActive(false);
                    return;
                }
            }
        }
 public override bool IsFromTheSameSourceAs(ConsoleMessage message)
 {
     return(false);
 }
Exemplo n.º 7
0
 public abstract bool IsFromTheSameSourceAs(ConsoleMessage message);
Exemplo n.º 8
0
 public abstract bool IsTheSameAs(ConsoleMessage message);
Exemplo n.º 9
0
 public bool IsWithinTimeRange(ConsoleMessage message, float seconds)
 {
     return(Mathf.Abs(logTime.Seconds - message.logTime.Seconds) < seconds);
 }