ConstructionGL2 Part 2: Better guided steps and recipes. (#5103)
This commit is contained in:
committed by
GitHub
parent
5be8271907
commit
5a5006e4cf
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Maps;
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.Maps;
|
||||
using Content.Shared.Window;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -30,5 +31,13 @@ namespace Content.Shared.Construction.Conditions
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public ConstructionGuideEntry? GenerateGuideEntry()
|
||||
{
|
||||
return new ConstructionGuideEntry()
|
||||
{
|
||||
Localization = "construction-guide-condition-empty-or-window-valid-in-tile"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace Content.Shared.Construction.Conditions
|
||||
{
|
||||
public interface IConstructionCondition
|
||||
{
|
||||
ConstructionGuideEntry? GenerateGuideEntry();
|
||||
bool Condition(IEntity user, EntityCoordinates location, Direction direction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,5 +22,13 @@ namespace Content.Shared.Construction.Conditions
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public ConstructionGuideEntry? GenerateGuideEntry()
|
||||
{
|
||||
return new ConstructionGuideEntry()
|
||||
{
|
||||
Localization = "construction-step-condition-no-windows-in-tile"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,5 +23,13 @@ namespace Content.Shared.Construction.Conditions
|
||||
|
||||
return !tileRef.Value.IsBlockedTurf(_filterMobs);
|
||||
}
|
||||
|
||||
public ConstructionGuideEntry? GenerateGuideEntry()
|
||||
{
|
||||
return new ConstructionGuideEntry()
|
||||
{
|
||||
Localization = "construction-step-condition-tile-not-blocked",
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.Construction.Conditions
|
||||
{
|
||||
@@ -12,7 +13,14 @@ namespace Content.Shared.Construction.Conditions
|
||||
[DataDefinition]
|
||||
public class TileType : IConstructionCondition
|
||||
{
|
||||
[DataField("targets")] public List<string> TargetTiles { get; private set; } = new();
|
||||
[DataField("targets")]
|
||||
public List<string> TargetTiles { get; } = new();
|
||||
|
||||
[DataField("guideText")]
|
||||
public string? GuideText = null;
|
||||
|
||||
[DataField("guideIcon")]
|
||||
public SpriteSpecifier? GuideIcon = null;
|
||||
|
||||
public bool Condition(IEntity user, EntityCoordinates location, Direction direction)
|
||||
{
|
||||
@@ -32,5 +40,17 @@ namespace Content.Shared.Construction.Conditions
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public ConstructionGuideEntry? GenerateGuideEntry()
|
||||
{
|
||||
if (GuideText == null)
|
||||
return null;
|
||||
|
||||
return new ConstructionGuideEntry()
|
||||
{
|
||||
Localization = GuideText,
|
||||
Icon = GuideIcon,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,5 +50,13 @@ namespace Content.Shared.Construction.Conditions
|
||||
predicate: (e) => e == targetWall || !e.HasTag("Wall"));
|
||||
return !adjWallRaycastResults.Any();
|
||||
}
|
||||
|
||||
public ConstructionGuideEntry? GenerateGuideEntry()
|
||||
{
|
||||
return new ConstructionGuideEntry()
|
||||
{
|
||||
Localization = "construction-step-condition-wallmount",
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user