mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
Fix missing word from emitter alerts (#43225)
* fix emitter yapping * use actual locid objects
This commit is contained in:
parent
e105237e1e
commit
2cbc8575f7
3 changed files with 42 additions and 11 deletions
|
|
@ -174,7 +174,7 @@ namespace Content.Server.Singularity.EntitySystems
|
|||
return;
|
||||
}
|
||||
|
||||
AlertRadio((uid, component), "unpowered");
|
||||
AlertRadio((uid, component), component.LocUnpowered);
|
||||
|
||||
component.IsPowered = false;
|
||||
|
||||
|
|
@ -302,22 +302,23 @@ namespace Content.Server.Singularity.EntitySystems
|
|||
// warn engineering their containment engine needs IMMEDIATE repairs
|
||||
// this doesn't change much for natural loosing through emitter destruction given any meteor warning serves the same purpose
|
||||
// can also be used to scare engineering though given it broadcasts its location you need a renamed station beacon to really scare them
|
||||
AlertRadio(ent, "destroyed");
|
||||
AlertRadio(ent, ent.Comp.LocDestroyed);
|
||||
}
|
||||
|
||||
private void OnDeconstructed(Entity<EmitterComponent> ent, ref MachineDeconstructedEvent args)
|
||||
{
|
||||
// right now you don't even need to unlock the emitter to deconstruct it. that's almost certainly a bug but even without it it probably still needs an alert
|
||||
AlertRadio(ent, "deconstructed");
|
||||
AlertRadio(ent, ent.Comp.LocDeconstructed);
|
||||
}
|
||||
|
||||
private void AlertRadio(Entity<EmitterComponent> ent, string type)
|
||||
private void AlertRadio(Entity<EmitterComponent> ent, string locString)
|
||||
{
|
||||
if (!ent.Comp.AlertRadio || !ent.Comp.IsOn || !ent.Comp.IsPowered)
|
||||
return; // APEs do not need to scream over engineering radio, and an emitter that is off is probably not going to be alerting radios
|
||||
|
||||
var message = Loc.GetString("emitter-" + type + "-broadcast",
|
||||
("location", FormattedMessage.RemoveMarkupOrThrow(_navMap.GetNearestBeaconString(ent.Owner)))
|
||||
var message = Loc.GetString(
|
||||
locString,
|
||||
("location", FormattedMessage.RemoveMarkupOrThrow(_navMap.GetNearestBeaconString(ent.Owner)))
|
||||
);
|
||||
_radio.SendRadioMessage(ent.Owner, message, ent.Comp.RadioChannel, ent.Owner);
|
||||
}
|
||||
|
|
@ -327,7 +328,7 @@ namespace Content.Server.Singularity.EntitySystems
|
|||
if (args.Locked)
|
||||
return;
|
||||
|
||||
AlertRadio(ent, "unlocked");
|
||||
AlertRadio(ent, ent.Comp.LocUnlocked);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,11 +98,41 @@ public sealed partial class EmitterComponent : Component
|
|||
[DataField]
|
||||
public Dictionary<ProtoId<SinkPortPrototype>, EntProtoId> SetTypePorts = new();
|
||||
|
||||
/// <summary>
|
||||
/// The radio channel to broadcast on when something happens to this emitter
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public ProtoId<RadioChannelPrototype> RadioChannel = "Engineering";
|
||||
|
||||
/// <summary>
|
||||
/// Whether a radio channel should be alerted if anything happens to this emitter (i.e. emitters near singularity/tesla containment)
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public bool AlertRadio = false; // is this emitter critical to the station to the point a radio channel should be alerted if anything happens to it (i.e. emitters near singularity/tesla containment)
|
||||
public bool AlertRadio = false;
|
||||
|
||||
/// <summary>
|
||||
/// Localized string to use when this emitter is destroyed and AlertRadio is set to true
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public LocId LocDestroyed = "emitter-destroyed-broadcast";
|
||||
|
||||
/// <summary>
|
||||
/// Localized string to use when this emitter is deconstructed and AlertRadio is set to true
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public LocId LocDeconstructed = "emitter-deconstructed-broadcast";
|
||||
|
||||
/// <summary>
|
||||
/// Localized string to use when this emitter is unlocked and AlertRadio is set to true
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public LocId LocUnlocked = "emitter-unlocked-broadcast";
|
||||
|
||||
/// <summary>
|
||||
/// Localized string to use when this emitter is unpowered and AlertRadio is set to true
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public LocId LocUnpowered = "emitter-unpowered-broadcast";
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
|
|
|
|||
|
|
@ -15,6 +15,6 @@ emitter-component-current-type = The current selected type is: [color=yellow]{$t
|
|||
emitter-component-type-set = Type set to: {$type}
|
||||
|
||||
emitter-destroyed-broadcast = A powered emitter {$location} has been destroyed.
|
||||
emitter-deconstructed-broadcast = A powered {$location} has been deconstructed.
|
||||
emitter-unlocked-broadcast = A powered {$location} has been unlocked.
|
||||
emitter-unpowered-broadcast = A powered {$location} has lost power.
|
||||
emitter-deconstructed-broadcast = A powered emitter {$location} has been deconstructed.
|
||||
emitter-unlocked-broadcast = A powered emitter {$location} has been unlocked.
|
||||
emitter-unpowered-broadcast = A powered emitter {$location} has lost power.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue