НонКон на нет + защита от хитрых педалей (#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

@@ -17,7 +17,6 @@ public sealed class RoleplayInfoSystem : SharedRoleplaySystem
if (component.Data.Count == 0) if (component.Data.Count == 0)
return; return;
args.PushText($"\n{Loc.GetString("roleplay-info")}", -1); args.PushText($"\n{Loc.GetString("roleplay-info")}", -1);
foreach (var data in component.Data) foreach (var data in component.Data)

View File

@@ -3,5 +3,5 @@ namespace Content.Shared._Amour.RoleplayInfo;
[RegisterComponent] [RegisterComponent]
public sealed partial class RoleplayInfoComponent : Component 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] [Serializable, NetSerializable, DataDefinition]
public sealed partial class RoleplayInfo public sealed partial class RoleplayInfo
{ {
[DataField] public string Name ; [ViewVariables] public string Name;
[DataField] public RoleplaySelection RoleplaySelection; [ViewVariables] public RoleplaySelection RoleplaySelection;
public RoleplayInfo(string name, RoleplaySelection roleplaySelection) public RoleplayInfo(string name, RoleplaySelection roleplaySelection)
{ {
Name = name; Name = name;

View File

@@ -15,5 +15,11 @@ public abstract class SharedRoleplaySystem : EntitySystem
private void OnHumanoidLoading(EntityUid uid, RoleplayInfoComponent component, HumanoidAppearanceLoadingEvent args) private void OnHumanoidLoading(EntityUid uid, RoleplayInfoComponent component, HumanoidAppearanceLoadingEvent args)
{ {
component.Data = new List<RoleplayInfo>(args.Profile.RoleplayInfoData.Select(p => p.Value)); 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 };
}
} }
} }