Skip to content

Commit

Permalink
feat: adding group message to save data
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Frowen committed Sep 8, 2022
1 parent 89e651e commit 12c3313
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Assets/Mirage.Profiler/Editor/Messages/MessageViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ private VisualElement CreateViewInternal()
{
text = "Group Messages",
tooltip = "Groups Message by type",
value = true
value = _savedData.GroupMessages,
};
_groupMsgToggle.RegisterValueChangedCallback(_ => ReloadData());
_groupMsgToggle.RegisterValueChangedCallback(GroupToggled);
_toggleBox.Add(_groupMsgToggle);

// todo allow selection of multiple frames
Expand Down Expand Up @@ -127,6 +127,12 @@ private VisualElement CreateViewInternal()
return root;
}

private void GroupToggled(ChangeEvent<bool> evt)
{
_savedData.GroupMessages = evt.newValue;
ReloadData();
}

private void OnGroupExpanded(Group group, bool expanded)
{
if (expanded)
Expand Down
2 changes: 2 additions & 0 deletions Assets/Mirage.Profiler/Editor/SavedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ internal class SavedData
/// </summary>
public List<string> Expanded;

public bool GroupMessages = true;

public SavedData()
{
Frames = new Frames();
Expand Down

0 comments on commit 12c3313

Please sign in to comment.