From 9c27f8417b5d7519ff1480ad3fde3dc72f65f5a7 Mon Sep 17 00:00:00 2001 From: Mervill Date: Sat, 22 Oct 2022 14:51:51 -0700 Subject: [PATCH] Show the station name on spawn (#12128) --- .../GameTicking/GameTicker.Spawning.cs | 6 ++++++ Content.Server/Roles/Job.cs | 17 +++-------------- Resources/Locale/en-US/job/job.ftl | 5 ++--- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs index 0cb178d4a5..c168e43c69 100644 --- a/Content.Server/GameTicking/GameTicker.Spawning.cs +++ b/Content.Server/GameTicking/GameTicker.Spawning.cs @@ -209,6 +209,12 @@ namespace Content.Server.GameTicking _chatManager.DispatchServerMessage(player, Loc.GetString("job-greet-crew-shortages")); } + if (TryComp(station, out MetaDataComponent? metaData)) + { + _chatManager.DispatchServerMessage(player, + Loc.GetString("job-greet-station-name", ("stationName", metaData.EntityName))); + } + // We raise this event directed to the mob, but also broadcast it so game rules can do something now. PlayersJoinedRoundNormally++; var aev = new PlayerSpawnCompleteEvent(mob, player, jobId, lateJoin, PlayersJoinedRoundNormally, station, character); diff --git a/Content.Server/Roles/Job.cs b/Content.Server/Roles/Job.cs index 514cd1ad85..cd81dea484 100644 --- a/Content.Server/Roles/Job.cs +++ b/Content.Server/Roles/Job.cs @@ -1,7 +1,7 @@ using Content.Server.Chat.Managers; using Content.Server.Chat.Systems; using Content.Shared.Roles; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; +using System.Globalization; namespace Content.Server.Roles { @@ -39,24 +39,13 @@ namespace Content.Server.Roles if (Mind.TryGetSession(out var session)) { var chatMgr = IoCManager.Resolve(); - var chatSys = IoCManager.Resolve().GetEntitySystem(); - chatMgr.DispatchServerMessage(session, Loc.GetString("job-greet-introduce-job-name", ("jobName", Name))); + chatMgr.DispatchServerMessage(session, Loc.GetString("job-greet-introduce-job-name", + ("jobName", CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Name)))); if(Prototype.RequireAdminNotify) chatMgr.DispatchServerMessage(session, Loc.GetString("job-greet-important-disconnect-admin-notify")); chatMgr.DispatchServerMessage(session, Loc.GetString("job-greet-supervisors-warning", ("jobName", Name), ("supervisors", Loc.GetString(Prototype.Supervisors)))); - - if(Prototype.JoinNotifyCrew && Mind.CharacterName != null) - { - if (Mind.OwnedEntity != null) - { - chatSys.DispatchStationAnnouncement(Mind.OwnedEntity.Value, - Loc.GetString("job-greet-join-notify-crew", ("jobName", Name), - ("characterName", Mind.CharacterName)), - Loc.GetString("job-greet-join-notify-crew-announcer"), false); - } - } } } } diff --git a/Resources/Locale/en-US/job/job.ftl b/Resources/Locale/en-US/job/job.ftl index c85e6a468f..ebcc3a76ab 100644 --- a/Resources/Locale/en-US/job/job.ftl +++ b/Resources/Locale/en-US/job/job.ftl @@ -1,6 +1,5 @@ -job-greet-introduce-job-name = You are the {$jobName}. +job-greet-station-name = Welcome aboard {$stationName}. +job-greet-introduce-job-name = Your role is: {$jobName}. job-greet-important-disconnect-admin-notify = You are playing a job that is important for Game Progression. If you have to disconnect, please notify the admins via ahelp. job-greet-supervisors-warning = As the {$jobName} you answer directly to {$supervisors}. Special circumstances may change this. -job-greet-join-notify-crew = { CAPITALIZE($jobName)} {$characterName} on deck! -job-greet-join-notify-crew-announcer = Station job-greet-crew-shortages = As this station was initially staffed with a skeleton crew, additional access has been added to your ID card.