[feat] donate

# Conflicts:
#	Content.Client/Entry/EntryPoint.cs
#	Content.Client/IoC/ClientContentIoC.cs
#	Content.Server/Chat/Managers/ChatManager.cs
#	Content.Server/Entry/EntryPoint.cs
#	Content.Server/GameTicking/GameTicker.Player.cs
#	Content.Server/GameTicking/GameTicker.StatusShell.cs
#	Content.Server/IoC/ServerContentIoC.cs
#	Content.Shared/Humanoid/HumanoidCharacterAppearance.cs
#	Content.Shared/Humanoid/Markings/MarkingPrototype.cs
#	Content.Shared/Preferences/HumanoidCharacterProfile.cs
This commit is contained in:
rhailrake
2023-04-25 19:46:20 +06:00
committed by Remuchi
parent 0cbb69d0a1
commit 4e85539ec6
29 changed files with 809 additions and 83 deletions

View File

@@ -4,7 +4,6 @@ using System.Linq;
using Content.Shared.Humanoid.Prototypes;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
namespace Content.Shared.Humanoid.Markings;
@@ -265,6 +264,37 @@ public sealed partial class MarkingSet
}
}
// WD-EDIT
public void FilterSponsor(string[] sponsorMarkings, MarkingManager? markingManager = null, IPrototypeManager? prototypeManager = null)
{
IoCManager.Resolve(ref markingManager);
IoCManager.Resolve(ref prototypeManager);
var toRemove = new List<(MarkingCategories category, string id)>();
foreach (var (category, list) in Markings)
{
foreach (var marking in list)
{
if (prototypeManager.TryIndex<MarkingPrototype>(marking.MarkingId, out var proto) && !proto.SponsorOnly)
{
return;
}
var allowedToHave = sponsorMarkings.Contains(marking.MarkingId);
if (!allowedToHave)
{
toRemove.Add((category, marking.MarkingId));
}
}
}
foreach (var marking in toRemove)
{
Remove(marking.category, marking.id);
}
}
// WD-EDIT
/// <summary>
/// Ensures that the default markings as defined by the marking point set in this marking set are applied.
/// </summary>