From 213574c93dcb31aa642bb2c5e3a1f26e957d6194 Mon Sep 17 00:00:00 2001 From: TheArturZh Date: Tue, 24 Oct 2023 04:24:59 +0300 Subject: [PATCH] Add markers for easier merges --- .../Players/PlayTimeTracking/JobRequirementsManager.cs | 4 +++- Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs | 4 ++-- Content.Server/GameTicking/GameTicker.Spawning.cs | 1 + Content.Shared/Humanoid/Prototypes/SpeciesPrototype.cs | 1 + Content.Shared/Roles/JobRequirements.cs | 3 +++ 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Content.Client/Players/PlayTimeTracking/JobRequirementsManager.cs b/Content.Client/Players/PlayTimeTracking/JobRequirementsManager.cs index ee098a129535..9e2ab9456af9 100644 --- a/Content.Client/Players/PlayTimeTracking/JobRequirementsManager.cs +++ b/Content.Client/Players/PlayTimeTracking/JobRequirementsManager.cs @@ -116,6 +116,7 @@ public bool IsAllowed(JobPrototype job, HumanoidCharacterProfile profile, [NotNu return CheckAllowed(job, profile, out reason); } + //SS220 Species-Job-Requirement begin public void BuildReason(ReasonList reasons, out FormattedMessage reason) { reason = FormattedMessage.FromMarkup(string.Join('\n', reasons)); @@ -167,6 +168,7 @@ public bool CheckRoleTime(HashSet? requirements, [NotNullWhen(fa } return true; } + //SS220 Species-Job-Requirement end public bool CheckRoleTime(HashSet? requirements, ReasonList reasons) { @@ -185,6 +187,6 @@ public bool CheckRoleTime(HashSet? requirements, ReasonList reas reasons.Add(jobReason.ToMarkup()); } - return reasons.Count == 0; + return reasons.Count == 0; //SS220 Species-Job-Requirement } } diff --git a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs index 4e0f2eef3a80..9f3ded155b5b 100644 --- a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs @@ -797,7 +797,7 @@ private void SetSpecies(string newSpecies) RebuildSpriteView(); // they might have different inv so we need a new dummy IsDirty = true; _needUpdatePreview = true; - UpdateRoleRequirements(); + UpdateRoleRequirements(); //SS220 Species-Job-Requirement } private void SetName(string newName) @@ -833,7 +833,7 @@ public void Save() _preferencesManager.UpdateCharacter(Profile, CharacterSlot); OnProfileChanged?.Invoke(Profile, CharacterSlot); _needUpdatePreview = true; - UpdateRoleRequirements(); + UpdateRoleRequirements(); //SS220 Species-Job-Requirement } } diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs index 65e0d370f3a0..b6fb684b7413 100644 --- a/Content.Server/GameTicking/GameTicker.Spawning.cs +++ b/Content.Server/GameTicking/GameTicker.Spawning.cs @@ -118,6 +118,7 @@ private void SpawnPlayer(IPlayerSession player, EntityUid station, string? jobId if (jobId != null && !_playTimeTrackings.IsAllowed(player, jobId)) return; + //SS220 Species-Job-Requirement if (jobId != null && !_roleSpeciesRestrictSystem.IsAllowed(player, jobId)) return; diff --git a/Content.Shared/Humanoid/Prototypes/SpeciesPrototype.cs b/Content.Shared/Humanoid/Prototypes/SpeciesPrototype.cs index 1bb5e1af9c46..22e66ba6f79d 100644 --- a/Content.Shared/Humanoid/Prototypes/SpeciesPrototype.cs +++ b/Content.Shared/Humanoid/Prototypes/SpeciesPrototype.cs @@ -134,6 +134,7 @@ public sealed class SpeciesPrototype : IPrototype [DataField("buttScanTexture")] public string ButtScanTexture = "/Textures/SS220/Interface/Butts/human.png"; + //SS220 Species-Job-Requirement [DataField("blockedJobs", required: false, customTypeSerializer: typeof(PrototypeIdListSerializer))] public List BlockedJobs { get; } = default!; } diff --git a/Content.Shared/Roles/JobRequirements.cs b/Content.Shared/Roles/JobRequirements.cs index 69a13b993d91..ed9949bdf757 100644 --- a/Content.Shared/Roles/JobRequirements.cs +++ b/Content.Shared/Roles/JobRequirements.cs @@ -72,6 +72,7 @@ public sealed partial class OverallPlaytimeRequirement : JobRequirement public static class JobRequirements { + //SS220 Species-Job-Requirement begin public static bool TryRequirementsSpeciesMet( JobPrototype job, SpeciesPrototype species, @@ -87,6 +88,8 @@ public static bool TryRequirementsSpeciesMet( } return true; } + //SS220 Species-Job-Requirement end + public static bool TryRequirementsMet( JobPrototype job, Dictionary playTimes,