uplink ringtone code + minor cleanup (#15277)

* uplink ringtone code + minor cleanup

* show uplink code in character menu

* no log

* rgbee

* no red

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-04-23 21:00:42 +00:00
committed by GitHub
parent 8adff42250
commit 597c398545
7 changed files with 85 additions and 87 deletions

View File

@@ -1,5 +1,6 @@
using Content.Server.Chat.Managers;
using Content.Server.Roles;
using Content.Shared.PDA;
using Content.Shared.Roles;
namespace Content.Server.Traitor
@@ -18,13 +19,15 @@ namespace Content.Server.Traitor
public override string Name { get; }
public override bool Antagonist { get; }
public void GreetTraitor(string[] codewords)
public void GreetTraitor(string[] codewords, Note[] code)
{
if (Mind.TryGetSession(out var session))
{
var chatMgr = IoCManager.Resolve<IChatManager>();
var entMgr = IoCManager.Resolve<IEntityManager>();
chatMgr.DispatchServerMessage(session, Loc.GetString("traitor-role-greeting"));
chatMgr.DispatchServerMessage(session, Loc.GetString("traitor-role-codewords", ("codewords", string.Join(", ",codewords))));
chatMgr.DispatchServerMessage(session, Loc.GetString("traitor-role-codewords", ("codewords", string.Join(", ", codewords))));
chatMgr.DispatchServerMessage(session, Loc.GetString("traitor-role-uplink-code", ("code", string.Join("", code))));
}
}
}

View File

@@ -61,7 +61,11 @@ namespace Content.Server.Traitor.Uplink
return true;
}
private EntityUid? FindUplinkTarget(EntityUid user)
/// <summary>
/// Finds the entity that can hold an uplink for a user.
/// Usually this is a pda in their pda slot, but can also be in their hands. (but not pockets or inside bag, etc.)
/// </summary>
public EntityUid? FindUplinkTarget(EntityUid user)
{
// Try to find PDA in inventory
if (_inventorySystem.TryGetContainerSlotEnumerator(user, out var containerSlotEnumerator))