Hud refactor (#7202)
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> Co-authored-by: Jezithyr <jmaster9999@gmail.com> Co-authored-by: Jezithyr <Jezithyr@gmail.com> Co-authored-by: Visne <39844191+Visne@users.noreply.github.com> Co-authored-by: wrexbe <wrexbe@protonmail.com> Co-authored-by: wrexbe <81056464+wrexbe@users.noreply.github.com>
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Client.Alerts.UI;
|
||||
using Content.Client.UserInterface.Systems.Alerts.Controls;
|
||||
using Content.Client.UserInterface.Systems.Alerts.Widgets;
|
||||
using Content.Shared.Alert;
|
||||
using NUnit.Framework;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.IntegrationTests.Tests.GameObjects.Components.Mobs
|
||||
@@ -58,10 +59,24 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.Mobs
|
||||
_ = IoCManager.Resolve<IEntityManager>().GetComponent<AlertsComponent>(controlled.Value);
|
||||
|
||||
// find the alertsui
|
||||
clientAlertsUI =
|
||||
clientUIMgr.StateRoot.Children.FirstOrDefault(c => c is AlertsUI) as AlertsUI;
|
||||
|
||||
clientAlertsUI = FindAlertsUI(clientUIMgr.ActiveScreen);
|
||||
Assert.NotNull(clientAlertsUI);
|
||||
|
||||
AlertsUI FindAlertsUI(Control control)
|
||||
{
|
||||
if (control is AlertsUI alertUI)
|
||||
return alertUI;
|
||||
foreach (var child in control.Children)
|
||||
{
|
||||
var found = FindAlertsUI(child);
|
||||
if (found != null)
|
||||
return found;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// we should be seeing 3 alerts - our health, and the 2 debug alerts, in a specific order.
|
||||
Assert.That(clientAlertsUI.AlertContainer.ChildCount, Is.GreaterThanOrEqualTo(3));
|
||||
var alertControls = clientAlertsUI.AlertContainer.Children.Select(c => (AlertControl) c);
|
||||
|
||||
Reference in New Issue
Block a user