@@ -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)
|
||||||
|
|||||||
@@ -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; } = [];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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 };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user