Salvage Job Board (#37549)

* Salvage Job Board

* More development

* Small boy

* Computer yaml (partial)

* UI

* Rank unlock logic

* Job label printing

* appraisal tool integration

* Jobs

* add board to QM locker

* boom!

* command desc

* mild rewording

* ackh, mein pr ist brohken
This commit is contained in:
Nemanja
2025-05-18 00:02:52 -04:00
committed by GitHub
parent 93305c21df
commit 0d878751fa
45 changed files with 1239 additions and 61 deletions

View File

@@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Server.Cargo.Components;
using Content.Server.Station.Components;
using Content.Shared.Cargo;
@@ -372,7 +373,7 @@ namespace Content.Server.Cargo.Systems
return;
}
if (!component.AllowedGroups.Contains(product.Group))
if (!GetAvailableProducts((uid, component)).Contains(args.CargoProductId))
return;
if (component.SlipPrinter)
@@ -421,7 +422,8 @@ namespace Content.Server.Cargo.Systems
GetOutstandingOrderCount(orderDatabase, console.Account),
orderDatabase.Capacity,
GetNetEntity(station.Value),
orderDatabase.Orders[console.Account]
orderDatabase.Orders[console.Account],
GetAvailableProducts((consoleUid, console))
));
}
}
@@ -617,6 +619,29 @@ namespace Content.Server.Cargo.Systems
}
public List<ProtoId<CargoProductPrototype>> GetAvailableProducts(Entity<CargoOrderConsoleComponent> ent)
{
if (_station.GetOwningStation(ent) is not { } station ||
!TryComp<StationCargoOrderDatabaseComponent>(station, out var db))
{
return new List<ProtoId<CargoProductPrototype>>();
}
var products = new List<ProtoId<CargoProductPrototype>>();
// Note that a market must be both on the station and on the console to be available.
var markets = ent.Comp.AllowedGroups.Intersect(db.Markets).ToList();
foreach (var product in _protoMan.EnumeratePrototypes<CargoProductPrototype>())
{
if (!markets.Contains(product.Group))
continue;
products.Add(product.ID);
}
return products;
}
#region Station
private bool TryGetOrderDatabase([NotNullWhen(true)] EntityUid? stationUid, [MaybeNullWhen(false)] out StationCargoOrderDatabaseComponent dbComp)