Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jobs #3

Merged
merged 15 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Content.Benchmarks/MapLoadBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public async Task Cleanup()
PoolManager.Shutdown();
}

public static readonly string[] MapsSource = { "Empty", "Box", "Bagel", "Dev", "CentComm", "Atlas", "Core", "TestTeg", "Saltern", "Packed", "Omega", "Cluster", "Reach", "Origin", "Meta", "Marathon", "Europa", "MeteorArena", "Fland", "Barratry", "Oasis" };
public static readonly string[] MapsSource = { "Empty", "Box", "Bagel", "Dev", "CentComm", "Atlas", "Core", "Saltern", "Packed", "Omega", "Cluster", "Reach", "Origin", "Meta", "Marathon", "Europa", "MeteorArena", "Fland", "Barratry", "Oasis" };

[ParamsSource(nameof(MapsSource))]
public string Map;
Expand Down
16 changes: 16 additions & 0 deletions Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,22 @@ public void RefreshJobs()
}
}

var i = 0;
foreach (var (department, control) in _jobCategories)
{
var firstCategoryInThisLoop = i == 0;
if (firstCategoryInThisLoop && control.ChildCount <= 1)
{
control.Dispose();
}
else if (control.ChildCount <= 2)
{
control.Dispose();
}

i++;
}

UpdateJobPriorities();
}

Expand Down
1 change: 0 additions & 1 deletion Content.IntegrationTests/Tests/PostMapInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public sealed class PostMapInitTest
private static readonly string[] GameMaps =
{
"Dev",
"TestTeg",
"Fland",
"Meta",
"Packed",
Expand Down
76 changes: 38 additions & 38 deletions Content.IntegrationTests/Tests/Station/StationJobsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,44 +208,44 @@ 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<IPrototypeManager>();

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<string>();
foreach (var job in prototypeManager.EnumeratePrototypes<JobPrototype>())
{
if (!job.SetPreference)
invalidJobs.Add(job.ID);
}

Assert.Multiple(() =>
{
foreach (var gameMap in prototypeManager.EnumeratePrototypes<GameMapPrototype>())
{
foreach (var (stationId, station) in gameMap.Stations)
{
if (!station.StationComponentOverrides.TryGetComponent("StationJobs", out var comp))
continue;

foreach (var (job, _) in ((StationJobsComponent) comp).SetupAvailableJobs)
{
Assert.That(invalidJobs, Does.Not.Contain(job), $"Station {stationId} contains job prototype {job} which cannot be present roundstart.");
}
}
}
});
});
await pair.CleanReturnAsync();
}
// [Test]
// public async Task InvalidRoundstartJobsTest()
// {
// await using var pair = await PoolManager.GetServerClient();
// var server = pair.Server;
//
// var prototypeManager = server.ResolveDependency<IPrototypeManager>();
//
// 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<string>();
// foreach (var job in prototypeManager.EnumeratePrototypes<JobPrototype>())
// {
// if (!job.SetPreference)
// invalidJobs.Add(job.ID);
// }
//
// Assert.Multiple(() =>
// {
// foreach (var gameMap in prototypeManager.EnumeratePrototypes<GameMapPrototype>())
// {
// foreach (var (stationId, station) in gameMap.Stations)
// {
// if (!station.StationComponentOverrides.TryGetComponent("StationJobs", out var comp))
// continue;
//
// foreach (var (job, _) in ((StationJobsComponent) comp).SetupAvailableJobs)
// {
// 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
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Roles/JobPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public sealed partial class JobPrototype : IPrototype
public bool RequireAdminNotify { get; private set; } = false;

[DataField("setPreference")]
public bool SetPreference { get; private set; } = true;
public bool SetPreference { get; private set; } = false;

/// <summary>
/// Whether this job should show in the ID Card Console.
Expand Down
18 changes: 18 additions & 0 deletions Resources/IgnoredPrototypes/gsobb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# IgnoredPrototypes is the biggest bullshit ever. It's only real use is for ignoring Guidebook prototypes,
# and even THEN it sucks at that. Actual fucking bullshit.
#
# It's a "soft-ignore" prototype file. I wish it was a "hard-ignore" where you could just ignore a whole file
# and then create a prototype replacing that file to prevent merge conflicts. It would've been the best tool
# for forks if it weren't ass.

# NOPE. YOU CANT EVEN TAKE AWAY THE GUIDEBOOK. YOU WILL GET A THOUSAND YAML ERRORS. WHAT THE FUCK IS THE
# POINT OF THIS THING??? IT "REGISTERS" THE PROTOTYPE UNDER AN ID AND PREVENTS OTHER PROTOTYPES FROM
# TAKING THAT ID, AND WHILST YES IT DOES "IGNORE PROTOTYPES" IT'S A MASSIVE PAIN IN THE ASS THAT
# JUST HANDLING THE FUCKING MERGE CONFLICTS YOURSELF IS AN EASIER SOLUTION.

# GET ME OUT OF HERE.

#- /Prototypes/Roles/Jobs
#- /Prototypes/Maps/Playable
#- /Prototypes/Roles/Jobs/departments.yml
#- /Prototypes/Guidebook/
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/_gsobb/job/department.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
department-Survivors-description = Survive on Shrine.
department-Survivors = shrine
1 change: 1 addition & 0 deletions Resources/Locale/en-US/_gsobb/job/job-desc.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
job-description-merc = Work for your parent company.
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/_gsobb/job/job-names.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
job-name-nt-merc = nanotrasen footsoldier
job-name-syndicate-merc = syndicate infantryman
4 changes: 2 additions & 2 deletions Resources/Locale/en-US/job/job-names.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ job-name-janitor = Janitor
job-name-chaplain = Chaplain
job-name-botanist = Botanist
job-name-bartender = Bartender
job-name-passenger = Passenger
job-name-passenger = scavenger
job-name-salvagespec = Salvage specialist
job-name-qm = Quartermaster
job-name-cargotech = Cargo Technician
Expand Down Expand Up @@ -80,7 +80,7 @@ JobMedicalIntern = Medical intern
JobMime = Mime
JobMusician = Musician
JobParamedic = Paramedic
JobPassenger = Passenger
JobPassenger = scavenger
JobPsychologist = Psychologist
JobQuartermaster = Quartermaster
JobReporter = Reporter
Expand Down
12 changes: 6 additions & 6 deletions Resources/Locale/en-US/preferences/loadout-groups.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ loadout-group-hop-backpack = Head of Personnel backpack
loadout-group-hop-outerclothing = Head of Personnel outer clothing

# Civilian
loadout-group-passenger-jumpsuit = Passenger jumpsuit
loadout-group-passenger-mask = Passenger mask
loadout-group-passenger-gloves = Passenger gloves
loadout-group-passenger-backpack = Passenger backpack
loadout-group-passenger-outerclothing = Passenger outer clothing
loadout-group-passenger-shoes = Passenger shoes
loadout-group-passenger-jumpsuit = scavenger jumpsuit
loadout-group-passenger-mask = scavenger mask
loadout-group-passenger-gloves = scavenger gloves
loadout-group-passenger-backpack = scavenger backpack
loadout-group-passenger-outerclothing = scavenger outer clothing
loadout-group-passenger-shoes = scavenger shoes

loadout-group-bartender-head = Bartender head
loadout-group-bartender-jumpsuit = Bartender jumpsuit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ humanoid-profile-editor-preference-spawn-priority-arrivals = Arrivals
humanoid-profile-editor-preference-spawn-priority-cryosleep = Cryosleep

humanoid-profile-editor-jobs-amount-in-department-tooltip = Jobs in the {$departmentName} department
humanoid-profile-editor-department-jobs-label = {$departmentName} jobs
humanoid-profile-editor-department-jobs-label = {$departmentName}
humanoid-profile-editor-antags-tab = Antags
humanoid-profile-editor-antag-preference-yes-button = Yes
humanoid-profile-editor-antag-preference-no-button = No
Expand Down
2 changes: 1 addition & 1 deletion Resources/Maps/Test/dev_map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5144,7 +5144,7 @@ entities:
- type: Transform
pos: 3.5,8.5
parent: 179
- proto: SpawnPointCaptain
- proto: SpawnPointPassenger
entities:
- uid: 954
components:
Expand Down
18 changes: 18 additions & 0 deletions Resources/Prototypes/2G2C2/Catalog/Fills/Items/webbing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- type: entity
id: 2G2CClothingBeltMilitaryWebbingMagazine
parent: ClothingBeltMilitaryWebbing
name: magazine chest rig
suffix: Filled
components:
- type: Item
size: Ginormous
- type: Storage
maxItemSize: Normal
grid:
- 0,0,7,1
- type: StorageFill
contents:
- id: MagazinePistolSubMachineGun # TODO: Replace with M16
amount: 1
- id: MagazinePistol
amount: 2
6 changes: 6 additions & 0 deletions Resources/Prototypes/2G2C2/Entities/Clothing/Back/satchel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- type: entity
parent: ClothingBackpackSatchelEngineering
id: 2G2CClothingBackpackSatchelRugged
name: rugged satchel
description: A tough and rugged satchel.
components: []
5 changes: 5 additions & 0 deletions Resources/Prototypes/2G2C2/Entities/Clothing/Head/helmets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- type: entity
parent: ClothingHeadHelmetSwatSyndicate
id: ClothingHeadHelmetSyndicateInfantry
name: syndicate infantry helmet
description: A standard helmet for those working under the Syndicate conglomerate.
6 changes: 6 additions & 0 deletions Resources/Prototypes/2G2C2/Entities/Clothing/Mask/masks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- type: entity
parent: ClothingMaskGasERT
id: 2G2CClothingMaskGasSurplus
name: surplus gas mask
description: A surplus gas mask used in NT's corps.
components: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- type: entity
parent: ClothingUniformJumpsuitERTLeader
id: 2G2CClothingUniformJumpsuitNanotrasenFootsoldier
name: surplus nt infantry uniform
description: A surplus uniform for infantry in the NT corps. It looks used.
components:
- type: Sprite
sprite: Clothing/Uniforms/Jumpsuit/ert_leader.rsi
- type: Clothing
sprite: Clothing/Uniforms/Jumpsuit/ert_leader.rsi
87 changes: 87 additions & 0 deletions Resources/Prototypes/2G2C2/Loadouts/Scavenger/passenger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Face
- type: loadout
id: GasMask
equipment: GasMask

- type: startingGear
id: GasMask
equipment:
mask: ClothingMaskGas

- type: loadout
id: ExplorersMask
equipment: ExplorersMask

- type: startingGear
id: ExplorersMask
equipment:
mask: ClothingMaskGasExplorer

# Jumpsuits
# Grey
- type: loadout
id: ScavJumpsuit
equipment: ScavJumpsuit

- type: startingGear
id: ScavJumpsuit
equipment:
jumpsuit: ClothingUniformJumpsuitOperative

- type: loadout
id: ScavJumpskirt
equipment: ScavJumpskirt

- type: startingGear
id: ScavJumpskirt
equipment:
jumpsuit: ClothingUniformJumpskirtOperative

# Gloves

- type: loadout
id: BlackGloves
equipment: BlackGloves

- type: startingGear
id: BlackGloves
equipment:
gloves: ClothingHandsGlovesColorBlack

- type: loadout
id: PassengerGloves
equipment: FingerlessInsulatedGloves

- type: startingGear
id: FingerlessInsulatedGloves
equipment:
gloves: ClothingHandsGlovesFingerlessInsulated

# Outerclothing
- type: loadout
id: PassengerWintercoat
equipment: PassengerWintercoat

- type: startingGear
id: PassengerWintercoat
equipment:
outerClothing: ClothingOuterWinterCoatToggleable

# Shoes
- type: loadout
id: BlackShoes
equipment: BlackShoes

- type: startingGear
id: BlackShoes
equipment:
shoes: ClothingShoesColorBlack

- type: loadout
id: WinterBoots
equipment: WinterBoots

- type: startingGear
id: WinterBoots
equipment:
shoes: ClothingShoesBootsWinter
33 changes: 33 additions & 0 deletions Resources/Prototypes/2G2C2/Loadouts/loadout_groups.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
- type: loadoutGroup
id: PassengerJumpsuit
name: loadout-group-passenger-jumpsuit
loadouts:
- ScavJumpsuit
- ScavJumpskirt

- type: loadoutGroup
id: PassengerFace
name: loadout-group-passenger-mask
loadouts:
- ExplorersMask
- GasMask

- type: loadoutGroup
id: PassengerGloves
name: loadout-group-passenger-gloves
loadouts:
- BlackGloves
- PassengerGloves

- type: loadoutGroup
id: PassengerOuterClothing
name: loadout-group-passenger-outerclothing
loadouts:
- PassengerWintercoat

- type: loadoutGroup
id: PassengerShoes
name: loadout-group-passenger-shoes
loadouts:
- WinterBoots
- BlackShoes
10 changes: 10 additions & 0 deletions Resources/Prototypes/2G2C2/Loadouts/role_loadouts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Mercs don't get a loadout because uniform rules
- type: roleLoadout
id: JobPassenger
groups:
- PassengerJumpsuit
- PassengerFace
- PassengerGloves
- PassengerOuterClothing
- PassengerShoes
# - Trinkets
Loading
Loading