Skip to content

Commit

Permalink
Fix UI not closing
Browse files Browse the repository at this point in the history
  • Loading branch information
vaketola committed Jan 19, 2024
1 parent 523e575 commit d34582d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Content.Server/CosmaticDrift/CryoSleep/CryoSleepComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ public sealed partial class CryoSleepComponent : Component
/// </summary>
[DataField("initialSleepDurationRange")]
public Vector2 InitialSleepDurationRange = new (5, 10);

public CryoSleepEui eui = default!;
}
5 changes: 4 additions & 1 deletion Content.Server/CosmaticDrift/CryoSleep/CryoSleepSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ public bool RespawnUser(EntityUid? toInsert, CryoSleepComponent component, bool

if (success && mindComp?.Session != null)
{
_euiManager.OpenEui(new CryoSleepEui(mind, this), mindComp.Session);
component.eui = new CryoSleepEui(mind, this);
_euiManager.OpenEui(component.eui, mindComp.Session);
}

return success;
Expand Down Expand Up @@ -192,6 +193,8 @@ private bool EjectBody(EntityUid pod, CryoSleepComponent component)
component.BodyContainer.Remove(toEject.Value);
_climb.ForciblySetClimbing(toEject.Value, pod);

_euiManager.CloseEui(component.eui);

return true;
}

Expand Down

0 comments on commit d34582d

Please sign in to comment.