Placeholder pAIs, ghost role rules window (#4972)

This commit is contained in:
20kdc
2021-11-02 00:42:04 +00:00
committed by GitHub
parent 76bc00b218
commit 7a03f00cfd
18 changed files with 350 additions and 12 deletions

View File

@@ -2,6 +2,7 @@
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
using Robust.Shared.Localization;
namespace Content.Server.Ghost.Roles.Components
{
@@ -11,6 +12,8 @@ namespace Content.Server.Ghost.Roles.Components
[DataField("description")] private string _roleDescription = "Unknown";
[DataField("rules")] private string _roleRules = "";
// We do this so updating RoleName and RoleDescription in VV updates the open EUIs.
[ViewVariables(VVAccess.ReadWrite)]
@@ -35,6 +38,17 @@ namespace Content.Server.Ghost.Roles.Components
}
}
[ViewVariables(VVAccess.ReadWrite)]
public string RoleRules
{
get => _roleRules;
set
{
_roleRules = value;
EntitySystem.Get<GhostRoleSystem>().UpdateAllEui();
}
}
[ViewVariables(VVAccess.ReadOnly)]
public bool Taken { get; protected set; }
@@ -44,7 +58,8 @@ namespace Content.Server.Ghost.Roles.Components
protected override void Initialize()
{
base.Initialize();
if (_roleRules == "")
_roleRules = Loc.GetString("ghost-role-component-default-rules");
EntitySystem.Get<GhostRoleSystem>().RegisterGhostRole(this);
}