Removed Control.Update, moved all update code to Control.FrameUpdate. UI controls have no business running code inside simulation Ticks. Because of how the update loop is ordered, this will actually make the UI elements more responsive to simulation changes.

Fixed multiple bugs in the action UI where the Control.Update method was calling the base Control.FrameUpdate.
This commit is contained in:
Acruid
2021-03-26 17:10:31 -07:00
parent f17ead47c1
commit 3e7e44df29
13 changed files with 41 additions and 38 deletions

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using Content.Client.Utility;
using Content.Shared.GameObjects.Components.Damage;
using Content.Shared.GameObjects.Components.Mobs.State;
@@ -69,10 +69,8 @@ namespace Content.Client.GameObjects.EntitySystems.HealthOverlay
Panel.Visible = val;
}
protected override void Update(FrameEventArgs args)
private void MoreFrameUpdate(FrameEventArgs args)
{
base.Update(args);
if (Entity.Deleted)
{
return;
@@ -137,6 +135,8 @@ namespace Content.Client.GameObjects.EntitySystems.HealthOverlay
{
base.FrameUpdate(args);
MoreFrameUpdate(args);
if (Entity.Deleted ||
_eyeManager.CurrentMap != Entity.Transform.MapID)
{