Knowledge UI (#779)
* knowledge button in HUD * ui controller * bugfixes * finish * all-knowing ghosts * Create knowledge-ui.ftl
This commit is contained in:
@@ -2,6 +2,7 @@ using System.Text;
|
||||
using Content.Shared._CP14.Knowledge.Components;
|
||||
using Content.Shared._CP14.Knowledge.Prototypes;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Ghost;
|
||||
using Content.Shared.MagicMirror;
|
||||
using Content.Shared.Paper;
|
||||
using Robust.Shared.Prototypes;
|
||||
@@ -65,6 +66,9 @@ public abstract partial class SharedCP14KnowledgeSystem : EntitySystem
|
||||
ProtoId<CP14KnowledgePrototype> knowledge,
|
||||
CP14KnowledgeStorageComponent? knowledgeStorage = null)
|
||||
{
|
||||
if (HasComp<GhostComponent>(uid)) //All-knowing ghosts
|
||||
return true;
|
||||
|
||||
if (!Resolve(uid, ref knowledgeStorage, false))
|
||||
return false;
|
||||
|
||||
@@ -92,3 +96,27 @@ public sealed partial class CP14KnowledgeLearnDoAfterEvent : DoAfterEvent
|
||||
public ProtoId<CP14KnowledgePrototype> Knowledge;
|
||||
public override DoAfterEvent Clone() => this;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class CP14KnowledgeInfoEvent : EntityEventArgs
|
||||
{
|
||||
public readonly NetEntity NetEntity;
|
||||
public readonly HashSet<ProtoId<CP14KnowledgePrototype>> AllKnowledge;
|
||||
|
||||
public CP14KnowledgeInfoEvent(NetEntity netEntity, HashSet<ProtoId<CP14KnowledgePrototype>> allKnowledge)
|
||||
{
|
||||
NetEntity = netEntity;
|
||||
AllKnowledge = allKnowledge;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class RequestKnowledgeInfoEvent : EntityEventArgs
|
||||
{
|
||||
public readonly NetEntity NetEntity;
|
||||
|
||||
public RequestKnowledgeInfoEvent(NetEntity netEntity)
|
||||
{
|
||||
NetEntity = netEntity;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user