From f812dc4dacaf5a50330b20ab02eef778074167b4 Mon Sep 17 00:00:00 2001 From: Saphire Lattice Date: Wed, 13 Nov 2024 05:31:39 +0700 Subject: [PATCH] Hopefully fix the dreaded VV refresh blink (#5517) --- .../Traits/ViewVariablesTraitMembers.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Robust.Client/ViewVariables/Traits/ViewVariablesTraitMembers.cs b/Robust.Client/ViewVariables/Traits/ViewVariablesTraitMembers.cs index e2407c578d7..2910d16c8d0 100644 --- a/Robust.Client/ViewVariables/Traits/ViewVariablesTraitMembers.cs +++ b/Robust.Client/ViewVariables/Traits/ViewVariablesTraitMembers.cs @@ -1,4 +1,5 @@ -using System.Numerics; +using System.Collections.Generic; +using System.Numerics; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Client.ViewVariables.Instances; @@ -36,7 +37,7 @@ public ViewVariablesTraitMembers(IClientViewVariablesManagerInternal vvm, IRobus public override async void Refresh() { - _memberList.DisposeAllChildren(); + List replacementControls = []; if (Instance.Object != null) { @@ -51,7 +52,7 @@ public override async void Refresh() foreach (var control in group) { - _memberList.AddChild(control); + replacementControls.Add(control); } } } @@ -82,10 +83,16 @@ public override async void Refresh() selectorChain, o, r); }; - _memberList.AddChild(propertyEdit); + replacementControls.Add(propertyEdit); } } } + + _memberList.DisposeAllChildren(); + foreach (var item in replacementControls) + { + _memberList.AddChild(item); + } } internal static void CreateMemberGroupHeader(ref bool first, string groupName, Control container)