Clean up PDA code a little.
This commit is contained in:
@@ -39,7 +39,7 @@ namespace Content.Server.GameObjects.Components.PDA
|
|||||||
[ViewVariables] private BoundUserInterface _interface = default!;
|
[ViewVariables] private BoundUserInterface _interface = default!;
|
||||||
[ViewVariables] private string _startingIdCard = default!;
|
[ViewVariables] private string _startingIdCard = default!;
|
||||||
[ViewVariables] public bool IdSlotEmpty => _idSlot.ContainedEntities.Count < 1;
|
[ViewVariables] public bool IdSlotEmpty => _idSlot.ContainedEntities.Count < 1;
|
||||||
[ViewVariables] public IEntity? OwnerMob { get; private set; }
|
[ViewVariables] public string? OwnerName { get; private set; }
|
||||||
|
|
||||||
[ViewVariables] public IdCardComponent? ContainedID { get; private set; }
|
[ViewVariables] public IdCardComponent? ContainedID { get; private set; }
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ namespace Content.Server.GameObjects.Components.PDA
|
|||||||
{
|
{
|
||||||
var ownerInfo = new PDAIdInfoText
|
var ownerInfo = new PDAIdInfoText
|
||||||
{
|
{
|
||||||
ActualOwnerName = OwnerMob?.Name,
|
ActualOwnerName = OwnerName,
|
||||||
IdOwner = ContainedID?.FullName,
|
IdOwner = ContainedID?.FullName,
|
||||||
JobTitle = ContainedID?.JobTitle
|
JobTitle = ContainedID?.JobTitle
|
||||||
};
|
};
|
||||||
@@ -182,16 +182,10 @@ namespace Content.Server.GameObjects.Components.PDA
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPDAOwner(IEntity mob)
|
public void SetPDAOwner(string name)
|
||||||
{
|
{
|
||||||
if (mob == OwnerMob)
|
OwnerName = name;
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
OwnerMob = mob;
|
|
||||||
UpdatePDAUserInterface();
|
UpdatePDAUserInterface();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InsertIdCard(IdCardComponent card)
|
private void InsertIdCard(IdCardComponent card)
|
||||||
|
|||||||
@@ -800,7 +800,7 @@ namespace Content.Server.GameTicking
|
|||||||
var access = card.Owner.GetComponent<AccessComponent>();
|
var access = card.Owner.GetComponent<AccessComponent>();
|
||||||
var accessTags = access.Tags;
|
var accessTags = access.Tags;
|
||||||
accessTags.UnionWith(jobPrototype.Access);
|
accessTags.UnionWith(jobPrototype.Access);
|
||||||
pdaComponent.SetPDAOwner(mob);
|
pdaComponent.SetPDAOwner(characterName);
|
||||||
var mindComponent = mob.GetComponent<MindComponent>();
|
var mindComponent = mob.GetComponent<MindComponent>();
|
||||||
if (mindComponent.HasMind) //Redundancy checks.
|
if (mindComponent.HasMind) //Redundancy checks.
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user