Improve paradox clone item copying (#35993)
* even better item copying for the paradox clone * copy paper * fix * blacklist implanter * string.Empty --------- Co-authored-by: ScarKy0 <scarky0@onet.eu>
This commit is contained in:
@@ -224,6 +224,26 @@ public sealed class PaperSystem : EntitySystem
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy any stamp information from one piece of paper to another.
|
||||
/// </summary>
|
||||
public void CopyStamps(Entity<PaperComponent?> source, Entity<PaperComponent?> target)
|
||||
{
|
||||
if (!Resolve(source, ref source.Comp) || !Resolve(target, ref target.Comp))
|
||||
return;
|
||||
|
||||
target.Comp.StampedBy = new List<StampDisplayInfo>(source.Comp.StampedBy);
|
||||
target.Comp.StampState = source.Comp.StampState;
|
||||
Dirty(target);
|
||||
|
||||
if (TryComp<AppearanceComponent>(target, out var appearance))
|
||||
{
|
||||
// delete any stamps if the stamp state is null
|
||||
_appearance.SetData(target, PaperVisuals.Stamp, target.Comp.StampState ?? "", appearance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetContent(Entity<PaperComponent> entity, string content)
|
||||
{
|
||||
entity.Comp.Content = content;
|
||||
|
||||
Reference in New Issue
Block a user