НонКон на нет + защита от хитрых педалей (#169)

MassiveCok
This commit is contained in:
BIGZi0348
2024-11-11 23:47:20 +03:00
committed by GitHub
parent 2826352ec3
commit eadcc227d5
4 changed files with 13 additions and 8 deletions

View File

@@ -3,5 +3,5 @@ namespace Content.Shared._Amour.RoleplayInfo;
[RegisterComponent]
public sealed partial class RoleplayInfoComponent : Component
{
[DataField] public List<RoleplayInfo> Data = new();
[ViewVariables] public List<RoleplayInfo> Data { get; set; } = [];
}

View File

@@ -5,8 +5,8 @@ namespace Content.Shared._Amour.RoleplayInfo;
[Serializable, NetSerializable, DataDefinition]
public sealed partial class RoleplayInfo
{
[DataField] public string Name ;
[DataField] public RoleplaySelection RoleplaySelection;
[ViewVariables] public string Name;
[ViewVariables] public RoleplaySelection RoleplaySelection;
public RoleplayInfo(string name, RoleplaySelection roleplaySelection)
{
Name = name;

View File

@@ -15,5 +15,11 @@ public abstract class SharedRoleplaySystem : EntitySystem
private void OnHumanoidLoading(EntityUid uid, RoleplayInfoComponent component, HumanoidAppearanceLoadingEvent args)
{
component.Data = new List<RoleplayInfo>(args.Profile.RoleplayInfoData.Select(p => p.Value));
if (component.Data.Count == 0)
{
var erp = new RoleplayInfo(name: "erp", roleplaySelection: RoleplaySelection.No);
var noncon = new RoleplayInfo(name: "noncon", roleplaySelection: RoleplaySelection.No);
component.Data = new List<RoleplayInfo> { erp, noncon };
}
}
}