Files
tbd-station-14/Content.Shared/Telephone/SharedTelephoneSystem.cs
chromiumboy 6c465153ab UI improvements for holopads (#34055)
* Initial commit

* Minor update
2024-12-29 00:33:15 +01:00

57 lines
1.8 KiB
C#

using System.Linq;
namespace Content.Shared.Telephone;
public abstract class SharedTelephoneSystem : EntitySystem
{
public bool IsTelephoneEngaged(Entity<TelephoneComponent> entity)
{
return entity.Comp.LinkedTelephones.Any();
}
public string GetFormattedCallerIdForEntity(string? presumedName, string? presumedJob, Color fontColor, string fontType = "Default", int fontSize = 12)
{
var callerId = Loc.GetString("chat-telephone-unknown-caller",
("color", fontColor),
("fontType", fontType),
("fontSize", fontSize));
if (presumedName == null)
return callerId;
if (presumedJob != null)
callerId = Loc.GetString("chat-telephone-caller-id-with-job",
("callerName", presumedName),
("callerJob", presumedJob),
("color", fontColor),
("fontType", fontType),
("fontSize", fontSize));
else
callerId = Loc.GetString("chat-telephone-caller-id-without-job",
("callerName", presumedName),
("color", fontColor),
("fontType", fontType),
("fontSize", fontSize));
return callerId;
}
public string GetFormattedDeviceIdForEntity(string? deviceName, Color fontColor, string fontType = "Default", int fontSize = 12)
{
if (deviceName == null)
{
return Loc.GetString("chat-telephone-unknown-device",
("color", fontColor),
("fontType", fontType),
("fontSize", fontSize));
}
return Loc.GetString("chat-telephone-device-id",
("deviceName", deviceName),
("color", fontColor),
("fontType", fontType),
("fontSize", fontSize));
}
}