Add chatty lathes (#34959)

This commit is contained in:
pathetic meowmeow
2025-04-16 15:29:25 -04:00
committed by GitHub
parent be5bbd4dc3
commit 5d38ae56de
8 changed files with 69 additions and 4 deletions

View File

@@ -54,7 +54,7 @@ public sealed partial class TechnologyDatabaseComponent : Component
/// server to all of it's clients.
/// </remarks>
[ByRefEvent]
public readonly record struct TechnologyDatabaseModifiedEvent;
public readonly record struct TechnologyDatabaseModifiedEvent(List<string>? NewlyUnlockedRecipes);
/// <summary>
/// Event raised on a database after being synchronized

View File

@@ -7,6 +7,7 @@ using Content.Shared.Research.Prototypes;
using Content.Shared.Whitelist;
using Robust.Shared.Containers;
using Robust.Shared.Prototypes;
using System.Linq;
namespace Content.Shared.Research.Systems;
@@ -64,7 +65,7 @@ public sealed class BlueprintSystem : EntitySystem
_container.Insert(blueprint.Owner, _container.GetContainer(ent, ent.Comp.ContainerId));
var ev = new TechnologyDatabaseModifiedEvent();
var ev = new TechnologyDatabaseModifiedEvent(blueprint.Comp.ProvidedRecipes.Select(it => it.Id).ToList());
RaiseLocalEvent(ent, ref ev);
return true;
}

View File

@@ -301,7 +301,7 @@ public abstract class SharedResearchSystem : EntitySystem
component.UnlockedRecipes.Add(recipe);
Dirty(uid, component);
var ev = new TechnologyDatabaseModifiedEvent();
var ev = new TechnologyDatabaseModifiedEvent(new List<string> { recipe });
RaiseLocalEvent(uid, ref ev);
}
}