Hot revert (#403)
* Revert "add: notification upon head arrival (#402)" This reverts commita87b5295bc. * Revert "Constr. graph 2 recipes fix (#401)" This reverts commit5832144695.
This commit is contained in:
@@ -1,68 +0,0 @@
|
|||||||
using System.Globalization;
|
|
||||||
using Content.Server.Chat.Systems;
|
|
||||||
using Content.Server.GameTicking;
|
|
||||||
using Content.Server.Radio.EntitySystems;
|
|
||||||
using Content.Shared._White.Announcement;
|
|
||||||
using Content.Shared.Radio;
|
|
||||||
using Content.Shared.Roles;
|
|
||||||
using Robust.Shared.Prototypes;
|
|
||||||
|
|
||||||
namespace Content.Server._White.Announcement;
|
|
||||||
|
|
||||||
public sealed class ArrivalNotificationSystem : EntitySystem
|
|
||||||
{
|
|
||||||
[Dependency] private readonly ChatSystem _chatSystem = default!;
|
|
||||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
|
||||||
[Dependency] private readonly RadioSystem _radioSystem = default!;
|
|
||||||
|
|
||||||
public override void Initialize()
|
|
||||||
{
|
|
||||||
base.Initialize();
|
|
||||||
|
|
||||||
SubscribeAllEvent<PlayerSpawnCompleteEvent>(OnPlayerSpawn);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnPlayerSpawn(PlayerSpawnCompleteEvent args)
|
|
||||||
{
|
|
||||||
if (args.JobId == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!_prototypeManager.TryIndex<JobPrototype>(args.JobId, out var jobPrototype))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!_prototypeManager.TryIndex<ArrivalNotificationPrototype>(jobPrototype.AnnouncementPrototype, out var notification))
|
|
||||||
return;
|
|
||||||
|
|
||||||
var message = GetMessage(args.Mob,
|
|
||||||
jobPrototype,
|
|
||||||
notification.UseGlobalAnnouncement ? notification.GlobalMessage : notification.Message);
|
|
||||||
|
|
||||||
var senderName = Loc.GetString("head-arrived-sender");
|
|
||||||
var source = args.Station;
|
|
||||||
|
|
||||||
if (notification.UseGlobalAnnouncement)
|
|
||||||
_chatSystem.DispatchGlobalAnnouncement(message, senderName, colorOverride: Color.Gold);
|
|
||||||
else
|
|
||||||
_chatSystem.DispatchStationAnnouncement(source, message, senderName, false);
|
|
||||||
|
|
||||||
message = GetMessage(args.Mob, jobPrototype, notification.Message); // Changing message type for radio notification
|
|
||||||
|
|
||||||
foreach (var channel in notification.RadioChannelsPrototypes)
|
|
||||||
{
|
|
||||||
if (!_prototypeManager.TryIndex<RadioChannelPrototype>(channel, out _))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
_radioSystem.SendRadioMessage(source, message, channel, args.Mob);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private string GetMessage(EntityUid mob, JobPrototype jobPrototype, string type)
|
|
||||||
{
|
|
||||||
var message = Loc.GetString(type,
|
|
||||||
("character", MetaData(mob).EntityName),
|
|
||||||
("job", CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Loc.GetString(jobPrototype.Name))));
|
|
||||||
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -19,16 +19,16 @@ namespace Content.Shared.Roles
|
|||||||
[IdDataField]
|
[IdDataField]
|
||||||
public string ID { get; private set; } = default!;
|
public string ID { get; private set; } = default!;
|
||||||
|
|
||||||
[DataField(required: true, customTypeSerializer: typeof(PrototypeIdSerializer<PlayTimeTrackerPrototype>))]
|
[DataField("playTimeTracker", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<PlayTimeTrackerPrototype>))]
|
||||||
public string PlayTimeTracker { get; private set; } = string.Empty;
|
public string PlayTimeTracker { get; private set; } = string.Empty;
|
||||||
|
|
||||||
[DataField]
|
[DataField("supervisors")]
|
||||||
public string Supervisors { get; private set; } = "nobody";
|
public string Supervisors { get; private set; } = "nobody";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The name of this job as displayed to players.
|
/// The name of this job as displayed to players.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField]
|
[DataField("name")]
|
||||||
public string Name { get; private set; } = string.Empty;
|
public string Name { get; private set; } = string.Empty;
|
||||||
|
|
||||||
[ViewVariables(VVAccess.ReadOnly)]
|
[ViewVariables(VVAccess.ReadOnly)]
|
||||||
@@ -37,25 +37,22 @@ namespace Content.Shared.Roles
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The name of this job as displayed to players.
|
/// The name of this job as displayed to players.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField]
|
[DataField("description")]
|
||||||
public string? Description { get; private set; }
|
public string? Description { get; private set; }
|
||||||
|
|
||||||
[ViewVariables(VVAccess.ReadOnly)]
|
[ViewVariables(VVAccess.ReadOnly)]
|
||||||
public string? LocalizedDescription => Description is null ? null : Loc.GetString(Description);
|
public string? LocalizedDescription => Description is null ? null : Loc.GetString(Description);
|
||||||
|
|
||||||
[DataField]
|
[DataField("requirements")]
|
||||||
public HashSet<JobRequirement>? Requirements;
|
public HashSet<JobRequirement>? Requirements;
|
||||||
|
|
||||||
[DataField]
|
[DataField("joinNotifyCrew")]
|
||||||
public bool JoinNotifyCrew { get; private set; } = false;
|
public bool JoinNotifyCrew { get; private set; } = false;
|
||||||
|
|
||||||
[DataField]
|
[DataField("requireAdminNotify")]
|
||||||
public string AnnouncementPrototype = default!;
|
|
||||||
|
|
||||||
[DataField]
|
|
||||||
public bool RequireAdminNotify { get; private set; } = false;
|
public bool RequireAdminNotify { get; private set; } = false;
|
||||||
|
|
||||||
[DataField]
|
[DataField("setPreference")]
|
||||||
public bool SetPreference { get; private set; } = true;
|
public bool SetPreference { get; private set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -65,14 +62,14 @@ namespace Content.Shared.Roles
|
|||||||
[DataField]
|
[DataField]
|
||||||
public bool? OverrideConsoleVisibility { get; private set; } = null;
|
public bool? OverrideConsoleVisibility { get; private set; } = null;
|
||||||
|
|
||||||
[DataField]
|
[DataField("canBeAntag")]
|
||||||
public bool CanBeAntag { get; private set; } = true;
|
public bool CanBeAntag { get; private set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether this job is a head.
|
/// Whether this job is a head.
|
||||||
/// The job system will try to pick heads before other jobs on the same priority level.
|
/// The job system will try to pick heads before other jobs on the same priority level.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField]
|
[DataField("weight")]
|
||||||
public int Weight { get; private set; }
|
public int Weight { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -89,10 +86,10 @@ namespace Content.Shared.Roles
|
|||||||
/// A numerical score for how much easier this job is for antagonists.
|
/// A numerical score for how much easier this job is for antagonists.
|
||||||
/// For traitors, reduces starting TC by this amount. Other gamemodes can use it for whatever they find fitting.
|
/// For traitors, reduces starting TC by this amount. Other gamemodes can use it for whatever they find fitting.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField]
|
[DataField("antagAdvantage")]
|
||||||
public int AntagAdvantage = 0;
|
public int AntagAdvantage = 0;
|
||||||
|
|
||||||
[DataField(customTypeSerializer: typeof(PrototypeIdSerializer<StartingGearPrototype>))]
|
[DataField("startingGear", customTypeSerializer: typeof(PrototypeIdSerializer<StartingGearPrototype>))]
|
||||||
public string? StartingGear { get; private set; }
|
public string? StartingGear { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -100,28 +97,28 @@ namespace Content.Shared.Roles
|
|||||||
/// Starting gear will be ignored.
|
/// Starting gear will be ignored.
|
||||||
/// If you want to just add special attributes to a humanoid, use AddComponentSpecial instead.
|
/// If you want to just add special attributes to a humanoid, use AddComponentSpecial instead.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField(customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
[DataField("jobEntity", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||||
public string? JobEntity = null;
|
public string? JobEntity = null;
|
||||||
|
|
||||||
[DataField(customTypeSerializer: typeof(PrototypeIdSerializer<StatusIconPrototype>))]
|
[DataField("icon", customTypeSerializer: typeof(PrototypeIdSerializer<StatusIconPrototype>))]
|
||||||
public string Icon { get; private set; } = "JobIconUnknown";
|
public string Icon { get; private set; } = "JobIconUnknown";
|
||||||
|
|
||||||
[DataField(serverOnly: true)]
|
[DataField("special", serverOnly: true)]
|
||||||
public JobSpecial[] Special { get; private set; } = Array.Empty<JobSpecial>();
|
public JobSpecial[] Special { get; private set; } = Array.Empty<JobSpecial>();
|
||||||
|
|
||||||
[DataField]
|
[DataField("access")]
|
||||||
public IReadOnlyCollection<ProtoId<AccessLevelPrototype>> Access { get; private set; } = Array.Empty<ProtoId<AccessLevelPrototype>>();
|
public IReadOnlyCollection<ProtoId<AccessLevelPrototype>> Access { get; private set; } = Array.Empty<ProtoId<AccessLevelPrototype>>();
|
||||||
|
|
||||||
[DataField]
|
[DataField("accessGroups")]
|
||||||
public IReadOnlyCollection<ProtoId<AccessGroupPrototype>> AccessGroups { get; private set; } = Array.Empty<ProtoId<AccessGroupPrototype>>();
|
public IReadOnlyCollection<ProtoId<AccessGroupPrototype>> AccessGroups { get; private set; } = Array.Empty<ProtoId<AccessGroupPrototype>>();
|
||||||
|
|
||||||
[DataField]
|
[DataField("extendedAccess")]
|
||||||
public IReadOnlyCollection<ProtoId<AccessLevelPrototype>> ExtendedAccess { get; private set; } = Array.Empty<ProtoId<AccessLevelPrototype>>();
|
public IReadOnlyCollection<ProtoId<AccessLevelPrototype>> ExtendedAccess { get; private set; } = Array.Empty<ProtoId<AccessLevelPrototype>>();
|
||||||
|
|
||||||
[DataField]
|
[DataField("extendedAccessGroups")]
|
||||||
public IReadOnlyCollection<ProtoId<AccessGroupPrototype>> ExtendedAccessGroups { get; private set; } = Array.Empty<ProtoId<AccessGroupPrototype>>();
|
public IReadOnlyCollection<ProtoId<AccessGroupPrototype>> ExtendedAccessGroups { get; private set; } = Array.Empty<ProtoId<AccessGroupPrototype>>();
|
||||||
|
|
||||||
[DataField]
|
[DataField("whitelistedSpecies")]
|
||||||
public IReadOnlyCollection<ProtoId<SpeciesPrototype>> WhitelistedSpecies { get; private set; } = Array.Empty<ProtoId<SpeciesPrototype>>();
|
public IReadOnlyCollection<ProtoId<SpeciesPrototype>> WhitelistedSpecies { get; private set; } = Array.Empty<ProtoId<SpeciesPrototype>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
using Robust.Shared.Prototypes;
|
|
||||||
|
|
||||||
namespace Content.Shared._White.Announcement;
|
|
||||||
|
|
||||||
[Prototype("arrivalNotification")]
|
|
||||||
public sealed partial class ArrivalNotificationPrototype : IPrototype
|
|
||||||
{
|
|
||||||
[IdDataField] public string ID { get; } = default!;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The message that the department will receive upon the player arrival
|
|
||||||
/// </summary>
|
|
||||||
[DataField(required: true)]
|
|
||||||
public string Message = default!;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The message that the station will receive upon the player arrival
|
|
||||||
/// </summary>
|
|
||||||
[DataField]
|
|
||||||
public string GlobalMessage = default!;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ID of the channel where the player arrival will be announced.
|
|
||||||
/// </summary>
|
|
||||||
[DataField(required: true)]
|
|
||||||
public HashSet<string> RadioChannelsPrototypes = default!;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Determines whether the notification will be made to the entire station. If false, the notification will be on the department radio channel
|
|
||||||
/// </summary>
|
|
||||||
[DataField]
|
|
||||||
public bool UseGlobalAnnouncement;
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
head-arrived-message = { $character }, { $job }, Глава отдела
|
|
||||||
head-arrived-message-global = { $job } { $character } на станции
|
|
||||||
head-arrived-sender = Автоматическая Система Оповещений
|
|
||||||
@@ -32,5 +32,12 @@
|
|||||||
icon:
|
icon:
|
||||||
sprite: Objects/Misc/stock_parts.rsi
|
sprite: Objects/Misc/stock_parts.rsi
|
||||||
state: capacitor
|
state: capacitor
|
||||||
|
doAfter: 5
|
||||||
|
- tag: CapacitorStockPart
|
||||||
|
name: capacitor
|
||||||
|
icon:
|
||||||
|
sprite: Objects/Misc/stock_parts.rsi
|
||||||
|
state: capacitor
|
||||||
|
doAfter: 5
|
||||||
- node: medsecHud
|
- node: medsecHud
|
||||||
entity: ClothingEyesHudMedSec
|
entity: ClothingEyesHudMedSec
|
||||||
|
|||||||
@@ -65,5 +65,10 @@
|
|||||||
icon:
|
icon:
|
||||||
sprite: Objects/Misc/stock_parts.rsi
|
sprite: Objects/Misc/stock_parts.rsi
|
||||||
state: capacitor
|
state: capacitor
|
||||||
|
- tag: CapacitorStockPart
|
||||||
|
name: capacitor
|
||||||
|
icon:
|
||||||
|
sprite: Objects/Misc/stock_parts.rsi
|
||||||
|
state: capacitor
|
||||||
- node: potatoaichip
|
- node: potatoaichip
|
||||||
entity: PotatoAIChip
|
entity: PotatoAIChip
|
||||||
@@ -15,7 +15,6 @@
|
|||||||
weight: 10
|
weight: 10
|
||||||
startingGear: QuartermasterGear
|
startingGear: QuartermasterGear
|
||||||
icon: "JobIconQuarterMaster"
|
icon: "JobIconQuarterMaster"
|
||||||
announcementPrototype: QuartermasterArrivalNotification
|
|
||||||
supervisors: job-supervisors-captain
|
supervisors: job-supervisors-captain
|
||||||
whitelistedSpecies:
|
whitelistedSpecies:
|
||||||
- Human
|
- Human
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
icon: "JobIconCaptain"
|
icon: "JobIconCaptain"
|
||||||
requireAdminNotify: true
|
requireAdminNotify: true
|
||||||
joinNotifyCrew: true
|
joinNotifyCrew: true
|
||||||
announcementPrototype: CaptainArrivalNotification
|
|
||||||
supervisors: job-supervisors-centcom
|
supervisors: job-supervisors-centcom
|
||||||
whitelistedSpecies:
|
whitelistedSpecies:
|
||||||
- Human
|
- Human
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
startingGear: HoPGear
|
startingGear: HoPGear
|
||||||
icon: "JobIconHeadOfPersonnel"
|
icon: "JobIconHeadOfPersonnel"
|
||||||
requireAdminNotify: true
|
requireAdminNotify: true
|
||||||
announcementPrototype: HeadOfPersonnelArrivalNotification
|
|
||||||
supervisors: job-supervisors-captain
|
supervisors: job-supervisors-captain
|
||||||
whitelistedSpecies:
|
whitelistedSpecies:
|
||||||
- Human
|
- Human
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
startingGear: ChiefEngineerGear
|
startingGear: ChiefEngineerGear
|
||||||
icon: "JobIconChiefEngineer"
|
icon: "JobIconChiefEngineer"
|
||||||
requireAdminNotify: true
|
requireAdminNotify: true
|
||||||
announcementPrototype: ChiefEngineerArrivalNotification
|
|
||||||
supervisors: job-supervisors-captain
|
supervisors: job-supervisors-captain
|
||||||
whitelistedSpecies:
|
whitelistedSpecies:
|
||||||
- Human
|
- Human
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
time: 36000 #10 hrs
|
time: 36000 #10 hrs
|
||||||
startingGear: InspectorGear
|
startingGear: InspectorGear
|
||||||
icon: "JobIconInspector"
|
icon: "JobIconInspector"
|
||||||
announcementPrototype: InspectorArrivalNotification
|
|
||||||
supervisors: job-supervisors-captain
|
supervisors: job-supervisors-captain
|
||||||
access:
|
access:
|
||||||
- Service
|
- Service
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
weight: 10
|
weight: 10
|
||||||
startingGear: CMOGear
|
startingGear: CMOGear
|
||||||
icon: "JobIconChiefMedicalOfficer"
|
icon: "JobIconChiefMedicalOfficer"
|
||||||
announcementPrototype: ChiefMedicalOfficerArrivalNotification
|
|
||||||
requireAdminNotify: true
|
requireAdminNotify: true
|
||||||
supervisors: job-supervisors-captain
|
supervisors: job-supervisors-captain
|
||||||
whitelistedSpecies:
|
whitelistedSpecies:
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
startingGear: ResearchDirectorGear
|
startingGear: ResearchDirectorGear
|
||||||
icon: "JobIconResearchDirector"
|
icon: "JobIconResearchDirector"
|
||||||
requireAdminNotify: true
|
requireAdminNotify: true
|
||||||
announcementPrototype: ResearchDirectorArrivalNotification
|
|
||||||
supervisors: job-supervisors-captain
|
supervisors: job-supervisors-captain
|
||||||
whitelistedSpecies:
|
whitelistedSpecies:
|
||||||
- Human
|
- Human
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
startingGear: HoSGear
|
startingGear: HoSGear
|
||||||
icon: "JobIconHeadOfSecurity"
|
icon: "JobIconHeadOfSecurity"
|
||||||
requireAdminNotify: true
|
requireAdminNotify: true
|
||||||
announcementPrototype: HeadOfSecurityArrivalNotification
|
|
||||||
supervisors: job-supervisors-captain
|
supervisors: job-supervisors-captain
|
||||||
whitelistedSpecies:
|
whitelistedSpecies:
|
||||||
- Human
|
- Human
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
- type: arrivalNotification
|
|
||||||
id: CaptainArrivalNotification
|
|
||||||
message: head-arrived-message
|
|
||||||
globalMessage: head-arrived-message-global
|
|
||||||
radioChannelsPrototypes:
|
|
||||||
- Command
|
|
||||||
useGlobalAnnouncement: True
|
|
||||||
|
|
||||||
- type: arrivalNotification
|
|
||||||
id: HeadOfPersonnelArrivalNotification
|
|
||||||
message: head-arrived-message
|
|
||||||
radioChannelsPrototypes:
|
|
||||||
- Command
|
|
||||||
- Service
|
|
||||||
|
|
||||||
- type: arrivalNotification
|
|
||||||
id: HeadOfSecurityArrivalNotification
|
|
||||||
message: head-arrived-message
|
|
||||||
radioChannelsPrototypes:
|
|
||||||
- Command
|
|
||||||
- Security
|
|
||||||
|
|
||||||
- type: arrivalNotification
|
|
||||||
id: ChiefMedicalOfficerArrivalNotification
|
|
||||||
message: head-arrived-message
|
|
||||||
radioChannelsPrototypes:
|
|
||||||
- Command
|
|
||||||
- Medical
|
|
||||||
|
|
||||||
- type: arrivalNotification
|
|
||||||
id: ChiefEngineerArrivalNotification
|
|
||||||
message: head-arrived-message
|
|
||||||
radioChannelsPrototypes:
|
|
||||||
- Command
|
|
||||||
- Engineering
|
|
||||||
|
|
||||||
- type: arrivalNotification
|
|
||||||
id: ResearchDirectorArrivalNotification
|
|
||||||
message: head-arrived-message
|
|
||||||
radioChannelsPrototypes:
|
|
||||||
- Command
|
|
||||||
- Science
|
|
||||||
|
|
||||||
- type: arrivalNotification
|
|
||||||
id: QuartermasterArrivalNotification
|
|
||||||
message: head-arrived-message
|
|
||||||
radioChannelsPrototypes:
|
|
||||||
- Command
|
|
||||||
- Cargo
|
|
||||||
|
|
||||||
- type: arrivalNotification
|
|
||||||
id: InspectorArrivalNotification
|
|
||||||
message: head-arrived-message
|
|
||||||
radioChannelsPrototypes:
|
|
||||||
- Command
|
|
||||||
- Security
|
|
||||||
Reference in New Issue
Block a user