forked from new-frontiers-14/frontier-station-14
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'new-frontiers-14:master' into teloscontainerships
- Loading branch information
Showing
12 changed files
with
196 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
Content.Server/_NF/Construction/Conditions/NFStrapEmpty.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using Content.Shared.Construction; | ||
using JetBrains.Annotations; | ||
using Content.Shared.Examine; | ||
using Content.Shared.Buckle.Components; | ||
|
||
namespace Content.Server.Construction.Conditions; | ||
|
||
[UsedImplicitly] | ||
[DataDefinition] | ||
public sealed partial class NFStrapEmpty : IGraphCondition | ||
{ | ||
public bool Condition(EntityUid uid, IEntityManager entityManager) | ||
{ | ||
if (!entityManager.TryGetComponent(uid, out StrapComponent? strap)) | ||
return true; // No strap, nothing can be buckled. | ||
|
||
return strap.BuckledEntities.Count == 0; | ||
} | ||
|
||
public bool DoExamine(ExaminedEvent args) | ||
{ | ||
var entity = args.Examined; | ||
|
||
var entMan = IoCManager.Resolve<IEntityManager>(); | ||
|
||
if (!entMan.TryGetComponent(entity, out StrapComponent? strap)) return false; | ||
|
||
if (strap.BuckledEntities.Count > 0) | ||
{ | ||
args.PushMarkup(Loc.GetString("construction-examine-condition-nf-strap-empty", ("entityName", entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n"); | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
public IEnumerable<ConstructionGuideEntry> GenerateGuideEntry() | ||
{ | ||
yield return new ConstructionGuideEntry() | ||
{ | ||
Localization = "construction-step-condition-nf-strap-empty" | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
Resources/Locale/en-US/_NF/construction/conditions/strap-buckled.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# NFBuckled | ||
construction-examine-condition-nf-strap-empty = Unbuckle everything from the {$entityName}. | ||
construction-step-condition-nf-strap-empty = Nothing must be buckled. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.