From a308cbe8fc5c9ff2afa0bdb2d1d127f0f51ff018 Mon Sep 17 00:00:00 2001 From: sleepyyapril Date: Tue, 17 Dec 2024 13:04:58 -0400 Subject: [PATCH 1/4] missed a semi colon. --- Content.Shared/Roles/JobPrototype.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Content.Shared/Roles/JobPrototype.cs b/Content.Shared/Roles/JobPrototype.cs index 2a814f21a1..ed7db54081 100644 --- a/Content.Shared/Roles/JobPrototype.cs +++ b/Content.Shared/Roles/JobPrototype.cs @@ -126,6 +126,9 @@ public sealed partial class JobPrototype : IPrototype [DataField] public EntProtoId? JobPreviewEntity = null; + [DataField] + public bool RoleVisibleInPreferences { get; private set; } + [DataField] public ProtoId Icon { get; private set; } = "JobIconUnknown"; From be02966c070c57a6fb381485375706233e216b02 Mon Sep 17 00:00:00 2001 From: sleepyyapril Date: Tue, 17 Dec 2024 13:15:33 -0400 Subject: [PATCH 2/4] Hide all unnecessary jobs and departments. --- Content.Shared/Roles/DepartmentPrototype.cs | 2 +- Content.Shared/Roles/JobPrototype.cs | 5 +---- Resources/Prototypes/Roles/Jobs/Civilian/assistant.yml | 1 + Resources/Prototypes/Roles/Jobs/departments.yml | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Content.Shared/Roles/DepartmentPrototype.cs b/Content.Shared/Roles/DepartmentPrototype.cs index 5c94c90f8b..cac3c17322 100644 --- a/Content.Shared/Roles/DepartmentPrototype.cs +++ b/Content.Shared/Roles/DepartmentPrototype.cs @@ -46,7 +46,7 @@ public sealed partial class DepartmentPrototype : IPrototype /// Toggles the display of the department in the priority setting menu in the character editor. /// [DataField] - public bool EditorHidden; + public bool EditorHidden { get; private set; } = true; } /// diff --git a/Content.Shared/Roles/JobPrototype.cs b/Content.Shared/Roles/JobPrototype.cs index ed7db54081..fd9e3940f2 100644 --- a/Content.Shared/Roles/JobPrototype.cs +++ b/Content.Shared/Roles/JobPrototype.cs @@ -66,7 +66,7 @@ public sealed partial class JobPrototype : IPrototype /// Should this job appear in preferences menu? /// [DataField("setPreference")] - public bool SetPreference { get; private set; } = true; + public bool SetPreference { get; private set; } /// /// Should the selected traits be applied for this job? @@ -126,9 +126,6 @@ public sealed partial class JobPrototype : IPrototype [DataField] public EntProtoId? JobPreviewEntity = null; - [DataField] - public bool RoleVisibleInPreferences { get; private set; } - [DataField] public ProtoId Icon { get; private set; } = "JobIconUnknown"; diff --git a/Resources/Prototypes/Roles/Jobs/Civilian/assistant.yml b/Resources/Prototypes/Roles/Jobs/Civilian/assistant.yml index 5155c8ca00..3a06074caf 100644 --- a/Resources/Prototypes/Roles/Jobs/Civilian/assistant.yml +++ b/Resources/Prototypes/Roles/Jobs/Civilian/assistant.yml @@ -6,6 +6,7 @@ startingGear: PassengerGear icon: "JobIconPassenger" supervisors: job-supervisors-everyone + setPreference: true access: - Maintenance diff --git a/Resources/Prototypes/Roles/Jobs/departments.yml b/Resources/Prototypes/Roles/Jobs/departments.yml index 15737a273b..b842f557e9 100644 --- a/Resources/Prototypes/Roles/Jobs/departments.yml +++ b/Resources/Prototypes/Roles/Jobs/departments.yml @@ -12,6 +12,7 @@ id: Civilian name: department-Civilian description: department-Civilian-description + editorHidden: false color: "#9FED58" weight: -10 roles: From 4cb0c570656568021912268dad3ae7c7c95a0c0e Mon Sep 17 00:00:00 2001 From: sleepyyapril Date: Tue, 17 Dec 2024 13:44:19 -0400 Subject: [PATCH 3/4] Fix integration test. --- Content.IntegrationTests/Tests/Round/JobTest.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Content.IntegrationTests/Tests/Round/JobTest.cs b/Content.IntegrationTests/Tests/Round/JobTest.cs index 215890791d..9f374ebdb5 100644 --- a/Content.IntegrationTests/Tests/Round/JobTest.cs +++ b/Content.IntegrationTests/Tests/Round/JobTest.cs @@ -50,9 +50,14 @@ private void AssertJob(TestPair pair, ProtoId job, NetUserId? user var mindSys = pair.Server.System(); var roleSys = pair.Server.System(); var ticker = pair.Server.System(); + var prototypeManager = pair.Server.ProtoMan; user ??= pair.Client.User!.Value; + // If it shouldn't exist in preferences, it shouldn't be tested. + if (prototypeManager.TryIndex(job, out var jobPrototype) && !jobPrototype.SetPreference) + return; + Assert.That(ticker.RunLevel, Is.EqualTo(GameRunLevel.InRound)); Assert.That(ticker.PlayerGameStatuses[user.Value], Is.EqualTo(PlayerGameStatus.JoinedGame)); From e59dafc24556648688203b67fc49e11818587b7c Mon Sep 17 00:00:00 2001 From: sleepyyapril Date: Tue, 17 Dec 2024 14:07:02 -0400 Subject: [PATCH 4/4] This test is unnecessary. Kill. --- .../Tests/Station/StationJobsTest.cs | 44 ------------------- 1 file changed, 44 deletions(-) diff --git a/Content.IntegrationTests/Tests/Station/StationJobsTest.cs b/Content.IntegrationTests/Tests/Station/StationJobsTest.cs index d68fdafb76..b15c869e86 100644 --- a/Content.IntegrationTests/Tests/Station/StationJobsTest.cs +++ b/Content.IntegrationTests/Tests/Station/StationJobsTest.cs @@ -203,50 +203,6 @@ await server.WaitAssertion(() => }); await pair.CleanReturnAsync(); } - - [Test] - public async Task InvalidRoundstartJobsTest() - { - await using var pair = await PoolManager.GetServerClient(); - var server = pair.Server; - - var prototypeManager = server.ResolveDependency(); - var compFact = server.ResolveDependency(); - var name = compFact.GetComponentName(); - - await server.WaitAssertion(() => - { - // invalidJobs contains all the jobs which can't be set for preference: - // i.e. all the jobs that shouldn't be available round-start. - var invalidJobs = new HashSet(); - foreach (var job in prototypeManager.EnumeratePrototypes()) - { - if (!job.SetPreference) - invalidJobs.Add(job.ID); - } - - Assert.Multiple(() => - { - foreach (var gameMap in prototypeManager.EnumeratePrototypes()) - { - foreach (var (stationId, station) in gameMap.Stations) - { - if (!station.StationComponentOverrides.TryGetComponent(name, out var comp)) - continue; - - foreach (var (job, array) in ((StationJobsComponent) comp).SetupAvailableJobs) - { - Assert.That(array.Length, Is.EqualTo(2)); - Assert.That(array[0] is -1 or >= 0); - Assert.That(array[1] is -1 or >= 0); - Assert.That(invalidJobs, Does.Not.Contain(job), $"Station {stationId} contains job prototype {job} which cannot be present roundstart."); - } - } - } - }); - }); - await pair.CleanReturnAsync(); - } } internal static class JobExtensions