2 new Lobby image, some bugfix (#468)
* +2 lobby screens * Update goblin.yml * workbench recipes remove nesting * tips update * Update sewing_table.yml
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
* https://github.com/space-wizards/space-station-14/blob/master/LICENSE.TXT
|
||||
*/
|
||||
|
||||
using Content.Server.Chemistry.Containers.EntitySystems;
|
||||
using Content.Server.DoAfter;
|
||||
using Content.Server.Popups;
|
||||
using Content.Server.Stack;
|
||||
using Content.Shared._CP14.Workbench;
|
||||
using Content.Shared._CP14.Workbench.Prototypes;
|
||||
using Content.Shared.Chemistry.EntitySystems;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Stacks;
|
||||
using Content.Shared.UserInterface;
|
||||
@@ -27,16 +27,13 @@ public sealed partial class CP14WorkbenchSystem : SharedCP14WorkbenchSystem
|
||||
[Dependency] private readonly IPrototypeManager _proto = default!;
|
||||
[Dependency] private readonly PopupSystem _popup = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _userInterface = default!;
|
||||
[Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
|
||||
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
|
||||
|
||||
private EntityQuery<MetaDataComponent> _metaQuery;
|
||||
private EntityQuery<StackComponent> _stackQuery;
|
||||
|
||||
// Why not in component? Why?
|
||||
private const float WorkbenchRadius = 0.5f;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -44,12 +41,28 @@ public sealed partial class CP14WorkbenchSystem : SharedCP14WorkbenchSystem
|
||||
_metaQuery = GetEntityQuery<MetaDataComponent>();
|
||||
_stackQuery = GetEntityQuery<StackComponent>();
|
||||
|
||||
SubscribeLocalEvent<CP14WorkbenchComponent, MapInitEvent>(OnMapInit);
|
||||
|
||||
SubscribeLocalEvent<CP14WorkbenchComponent, BeforeActivatableUIOpenEvent>(OnBeforeUIOpen);
|
||||
SubscribeLocalEvent<CP14WorkbenchComponent, CP14WorkbenchUiCraftMessage>(OnCraft);
|
||||
|
||||
SubscribeLocalEvent<CP14WorkbenchComponent, CP14CraftDoAfterEvent>(OnCraftFinished);
|
||||
}
|
||||
|
||||
private void OnMapInit(Entity<CP14WorkbenchComponent> ent, ref MapInitEvent args)
|
||||
{
|
||||
foreach (var recipe in _proto.EnumeratePrototypes<CP14WorkbenchRecipePrototype>())
|
||||
{
|
||||
if (ent.Comp.Recipes.Contains(recipe))
|
||||
continue;
|
||||
|
||||
if (!ent.Comp.RecipeTags.Contains(recipe.Tag))
|
||||
continue;
|
||||
|
||||
ent.Comp.Recipes.Add(recipe);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnBeforeUIOpen(Entity<CP14WorkbenchComponent> ent, ref BeforeActivatableUIOpenEvent args)
|
||||
{
|
||||
UpdateUIRecipes(ent);
|
||||
@@ -64,7 +77,7 @@ public sealed partial class CP14WorkbenchSystem : SharedCP14WorkbenchSystem
|
||||
if (!_proto.TryIndex(args.Recipe, out var recipe))
|
||||
return;
|
||||
|
||||
var placedEntities = _lookup.GetEntitiesInRange(Transform(ent).Coordinates, WorkbenchRadius, LookupFlags.Uncontained);
|
||||
var placedEntities = _lookup.GetEntitiesInRange(Transform(ent).Coordinates, ent.Comp.WorkbenchRadius, LookupFlags.Uncontained);
|
||||
|
||||
if (!CanCraftRecipe(recipe, placedEntities))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user