Disable Arrivals message for Cryosleep (#30888)
* Disable arrivals message for cryosleep late arrivals * Provide silent to PlayerSpawnCompleteEvent * Fix typo * Move message to event and into arrivals system
This commit is contained in:
@@ -104,6 +104,8 @@ public sealed class ArrivalsSystem : EntitySystem
|
||||
SubscribeLocalEvent<ArrivalsShuttleComponent, FTLStartedEvent>(OnArrivalsFTL);
|
||||
SubscribeLocalEvent<ArrivalsShuttleComponent, FTLCompletedEvent>(OnArrivalsDocked);
|
||||
|
||||
SubscribeLocalEvent<PlayerSpawnCompleteEvent>(SendDirections);
|
||||
|
||||
_pendingQuery = GetEntityQuery<PendingClockInComponent>();
|
||||
_blacklistQuery = GetEntityQuery<ArrivalsBlacklistComponent>();
|
||||
_mobQuery = GetEntityQuery<MobStateComponent>();
|
||||
@@ -378,6 +380,20 @@ public sealed class ArrivalsSystem : EntitySystem
|
||||
EnsureComp<GodmodeComponent>(ev.SpawnResult.Value);
|
||||
}
|
||||
|
||||
private void SendDirections(PlayerSpawnCompleteEvent ev)
|
||||
{
|
||||
if (!Enabled || !ev.LateJoin || ev.Silent || !_pendingQuery.HasComp(ev.Mob))
|
||||
return;
|
||||
|
||||
var arrival = NextShuttleArrival();
|
||||
|
||||
var message = arrival is not null
|
||||
? Loc.GetString("latejoin-arrivals-direction-time", ("time", $"{arrival:mm\\:ss}"))
|
||||
: Loc.GetString("latejoin-arrivals-direction");
|
||||
|
||||
_chat.DispatchServerMessage(ev.Player, message);
|
||||
}
|
||||
|
||||
private bool TryTeleportToMapSpawn(EntityUid player, EntityUid stationId, TransformComponent? transform = null)
|
||||
{
|
||||
if (!Resolve(player, ref transform))
|
||||
|
||||
Reference in New Issue
Block a user