MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Update

Method Update

Source/Editor/Windows/DebugLogWindow.cs:665–740  ·  view source on GitHub ↗

(float deltaTime)

Source from the content-addressed store, hash-verified

663
664 /// <inheritdoc />
665 public override void Update(float deltaTime)
666 {
667 lock (_locker)
668 {
669 if (_pendingEntries.Count > 0)
670 {
671 // Check if user want's to scroll view by var (or is viewing earlier entry)
672 var panelScroll = (Panel)_entriesPanel.Parent;
673 bool scrollView = (panelScroll.VScrollBar.Maximum - panelScroll.VScrollBar.TargetValue) < LogEntry.DefaultHeight * 1.5f;
674
675 // Add pending entries
676 LogEntry newEntry = null;
677 bool anyVisible = false;
678 _entriesPanel.IsLayoutLocked = true;
679 var spacing = _entriesPanel.Spacing;
680 var margin = _entriesPanel.Margin;
681 var offset = _entriesPanel.Offset;
682 var width = _entriesPanel.Width - margin.Width;
683 var top = _entriesPanel.Children.Count != 0 ? _entriesPanel.Children[_entriesPanel.Children.Count - 1].Bottom + spacing : margin.Top;
684 for (int i = 0; i < _pendingEntries.Count; i++)
685 {
686 if (_collapseLogsButton.Checked)
687 {
688 bool logExists = false;
689 foreach (var child in _entriesPanel.Children)
690 {
691 if (child is LogEntry entry)
692 {
693 var pendingEntry = _pendingEntries[i];
694 if (string.Equals(entry.Desc.Title, pendingEntry.Desc.Title, StringComparison.Ordinal) &&
695 string.Equals(entry.Desc.LocationFile, pendingEntry.Desc.LocationFile, StringComparison.Ordinal) &&
696 entry.Desc.Level == pendingEntry.Desc.Level &&
697 string.Equals(entry.Desc.Description, pendingEntry.Desc.Description, StringComparison.Ordinal) &&
698 entry.Desc.LocationLine == pendingEntry.Desc.LocationLine)
699 {
700 entry.LogCount += 1;
701 newEntry = entry;
702 logExists = true;
703 break;
704 }
705 }
706 }
707 if (logExists)
708 continue;
709 }
710 newEntry = _pendingEntries[i];
711 newEntry.Visible = _groupButtons[(int)newEntry.Group].Checked;
712 anyVisible |= newEntry.Visible;
713 newEntry.Parent = _entriesPanel;
714 newEntry.Bounds = new Rectangle(margin.Left + offset.X, top + offset.Y, width, newEntry.Height);
715 top = newEntry.Bottom + spacing;
716 _logCountPerGroup[(int)newEntry.Group]++;
717 }
718 _entriesPanel.Height = top + margin.Bottom;
719 _entriesPanel.IsLayoutLocked = false;
720 _pendingEntries.Clear();
721 UpdateCount();
722 Assert.IsNotNull(newEntry);

Callers

nothing calls this directly

Calls 4

IsNotNullMethod · 0.80
EqualsMethod · 0.45
ClearMethod · 0.45
ScrollViewToMethod · 0.45

Tested by

no test coverage detected