ConstructionGL2 Part 2: Better guided steps and recipes. (#5103)
This commit is contained in:
committed by
GitHub
parent
5be8271907
commit
5a5006e4cf
@@ -1,12 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Shared.Construction;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Maps;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
@@ -24,6 +29,15 @@ namespace Content.Server.Construction.Conditions
|
||||
[DataField("hasEntity")]
|
||||
public bool HasEntity { get; private set; }
|
||||
|
||||
[DataField("examineText")]
|
||||
public string? ExamineText { get; }
|
||||
|
||||
[DataField("guideText")]
|
||||
public string? GuideText { get; }
|
||||
|
||||
[DataField("guideIcon")]
|
||||
public SpriteSpecifier? GuideIcon { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The component name in question.
|
||||
/// </summary>
|
||||
@@ -49,6 +63,25 @@ namespace Content.Server.Construction.Conditions
|
||||
return !HasEntity;
|
||||
}
|
||||
|
||||
// TODO CONSTRUCTION: Custom examine for this condition.
|
||||
public bool DoExamine(ExaminedEvent args)
|
||||
{
|
||||
if (string.IsNullOrEmpty(ExamineText))
|
||||
return false;
|
||||
|
||||
args.PushMarkup(Loc.GetString(ExamineText));
|
||||
return true;
|
||||
}
|
||||
|
||||
public IEnumerable<ConstructionGuideEntry> GenerateGuideEntry()
|
||||
{
|
||||
if (string.IsNullOrEmpty(GuideText))
|
||||
yield break;
|
||||
|
||||
yield return new ConstructionGuideEntry()
|
||||
{
|
||||
Localization = GuideText,
|
||||
Icon = GuideIcon,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user