Remove AlertType and AlertCategory (#27933)
This commit is contained in:
@@ -84,7 +84,7 @@ public sealed partial class BorgSystem : SharedBorgSystem
|
||||
|
||||
private void OnMapInit(EntityUid uid, BorgChassisComponent component, MapInitEvent args)
|
||||
{
|
||||
UpdateBatteryAlert(uid);
|
||||
UpdateBatteryAlert((uid, component));
|
||||
_movementSpeedModifier.RefreshMovementSpeedModifiers(uid);
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ public sealed partial class BorgSystem : SharedBorgSystem
|
||||
|
||||
private void OnPowerCellChanged(EntityUid uid, BorgChassisComponent component, PowerCellChangedEvent args)
|
||||
{
|
||||
UpdateBatteryAlert(uid);
|
||||
UpdateBatteryAlert((uid, component));
|
||||
|
||||
if (!TryComp<PowerCellDrawComponent>(uid, out var draw))
|
||||
return;
|
||||
@@ -256,12 +256,12 @@ public sealed partial class BorgSystem : SharedBorgSystem
|
||||
args.Cancel();
|
||||
}
|
||||
|
||||
private void UpdateBatteryAlert(EntityUid uid, PowerCellSlotComponent? slotComponent = null)
|
||||
private void UpdateBatteryAlert(Entity<BorgChassisComponent> ent, PowerCellSlotComponent? slotComponent = null)
|
||||
{
|
||||
if (!_powerCell.TryGetBatteryFromSlot(uid, out var battery, slotComponent))
|
||||
if (!_powerCell.TryGetBatteryFromSlot(ent, out var battery, slotComponent))
|
||||
{
|
||||
_alerts.ClearAlert(uid, AlertType.BorgBattery);
|
||||
_alerts.ShowAlert(uid, AlertType.BorgBatteryNone);
|
||||
_alerts.ClearAlert(ent, ent.Comp.BatteryAlert);
|
||||
_alerts.ShowAlert(ent, ent.Comp.NoBatteryAlert);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -269,13 +269,13 @@ public sealed partial class BorgSystem : SharedBorgSystem
|
||||
|
||||
// we make sure 0 only shows if they have absolutely no battery.
|
||||
// also account for floating point imprecision
|
||||
if (chargePercent == 0 && _powerCell.HasDrawCharge(uid, cell: slotComponent))
|
||||
if (chargePercent == 0 && _powerCell.HasDrawCharge(ent, cell: slotComponent))
|
||||
{
|
||||
chargePercent = 1;
|
||||
}
|
||||
|
||||
_alerts.ClearAlert(uid, AlertType.BorgBatteryNone);
|
||||
_alerts.ShowAlert(uid, AlertType.BorgBattery, chargePercent);
|
||||
_alerts.ClearAlert(ent, ent.Comp.NoBatteryAlert);
|
||||
_alerts.ShowAlert(ent, ent.Comp.BatteryAlert, chargePercent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user