ECSatize AlertsSystem (#5559)

This commit is contained in:
Acruid
2022-01-05 00:19:23 -08:00
committed by GitHub
parent 36d4de5e61
commit 5b1cd2dd96
59 changed files with 1069 additions and 1038 deletions

View File

@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using Content.Server.Administration.Logs;
using Content.Server.Alert;
using Content.Shared.Administration.Logs;
using Content.Shared.Alert;
using Content.Shared.Damage;
@@ -95,15 +94,13 @@ namespace Content.Server.Nutrition.Components
}
// Update UI
_entMan.TryGetComponent(Owner, out ServerAlertsComponent? alertsComponent);
if (HungerThresholdAlertTypes.TryGetValue(_currentHungerThreshold, out var alertId))
{
alertsComponent?.ShowAlert(alertId);
EntitySystem.Get<AlertsSystem>().ShowAlert(Owner, alertId);
}
else
{
alertsComponent?.ClearAlertCategory(AlertCategory.Hunger);
EntitySystem.Get<AlertsSystem>().ClearAlertCategory(Owner, AlertCategory.Hunger);
}
switch (_currentHungerThreshold)

View File

@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using Content.Server.Administration.Logs;
using Content.Server.Alert;
using Content.Shared.Administration.Logs;
using Content.Shared.Alert;
using Content.Shared.Damage;
@@ -94,15 +93,13 @@ namespace Content.Server.Nutrition.Components
}
// Update UI
_entMan.TryGetComponent(Owner, out ServerAlertsComponent? alertsComponent);
if (ThirstThresholdAlertTypes.TryGetValue(_currentThirstThreshold, out var alertId))
{
alertsComponent?.ShowAlert(alertId);
EntitySystem.Get<AlertsSystem>().ShowAlert(Owner, alertId);
}
else
{
alertsComponent?.ClearAlertCategory(AlertCategory.Thirst);
EntitySystem.Get<AlertsSystem>().ClearAlertCategory(Owner, AlertCategory.Thirst);
}
switch (_currentThirstThreshold)