Adapt window construction to new sprites and grilles.
This commit is contained in:
@@ -10,23 +10,25 @@ namespace Content.Shared.Construction.Conditions
|
|||||||
{
|
{
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
[DataDefinition]
|
[DataDefinition]
|
||||||
public class LowWallInTile : IConstructionCondition
|
public class EmptyOrWindowValidInTile : IConstructionCondition
|
||||||
{
|
{
|
||||||
|
[DataField("tileNotBlocked")]
|
||||||
|
private readonly TileNotBlocked _tileNotBlocked = new();
|
||||||
|
|
||||||
public bool Condition(IEntity user, EntityCoordinates location, Direction direction)
|
public bool Condition(IEntity user, EntityCoordinates location, Direction direction)
|
||||||
{
|
{
|
||||||
var lowWall = false;
|
var result = false;
|
||||||
|
|
||||||
foreach (var entity in location.GetEntitiesInTile(LookupFlags.Approximate | LookupFlags.IncludeAnchored))
|
foreach (var entity in location.GetEntitiesInTile(LookupFlags.Approximate | LookupFlags.IncludeAnchored))
|
||||||
{
|
{
|
||||||
if (entity.HasComponent<SharedCanBuildWindowOnTopComponent>())
|
if (entity.HasComponent<SharedCanBuildWindowOnTopComponent>())
|
||||||
lowWall = true;
|
result = true;
|
||||||
|
|
||||||
// Already has a window.
|
|
||||||
if (entity.HasComponent<SharedWindowComponent>())
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return lowWall;
|
if (!result)
|
||||||
|
result = _tileNotBlocked.Condition(user, location, direction);
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
4
Resources/Changelog/Parts/window.yml
Normal file
4
Resources/Changelog/Parts/window.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
author: Zumorica
|
||||||
|
changes:
|
||||||
|
- type: Tweak # One of the following: Add, Remove, Tweak, Fix
|
||||||
|
message: Adapts window construction to the new sprites and grilles.
|
||||||
@@ -94,9 +94,9 @@
|
|||||||
startNode: start
|
startNode: start
|
||||||
targetNode: window
|
targetNode: window
|
||||||
category: Structures
|
category: Structures
|
||||||
description: Clear. Must be built on top of a low wall.
|
description: Clear.
|
||||||
conditions:
|
conditions:
|
||||||
- !type:LowWallInTile {}
|
- !type:EmptyOrWindowValidInTile {}
|
||||||
- !type:NoWindowsInTile {}
|
- !type:NoWindowsInTile {}
|
||||||
icon:
|
icon:
|
||||||
sprite: Structures/Windows/window.rsi
|
sprite: Structures/Windows/window.rsi
|
||||||
@@ -112,9 +112,9 @@
|
|||||||
startNode: start
|
startNode: start
|
||||||
targetNode: reinforcedWindow
|
targetNode: reinforcedWindow
|
||||||
category: Structures
|
category: Structures
|
||||||
description: Clear but tough. Must be built on top of a low wall.
|
description: Clear but tough.
|
||||||
conditions:
|
conditions:
|
||||||
- !type:LowWallInTile {}
|
- !type:EmptyOrWindowValidInTile {}
|
||||||
- !type:NoWindowsInTile {}
|
- !type:NoWindowsInTile {}
|
||||||
icon:
|
icon:
|
||||||
sprite: Structures/Windows/reinforced_window.rsi
|
sprite: Structures/Windows/reinforced_window.rsi
|
||||||
@@ -130,9 +130,9 @@
|
|||||||
startNode: start
|
startNode: start
|
||||||
targetNode: plasmaWindow
|
targetNode: plasmaWindow
|
||||||
category: Structures
|
category: Structures
|
||||||
description: Clear and even tougher, with an orange tint. Must be built on top of a low wall.
|
description: Clear and even tougher, with a purple tint.
|
||||||
conditions:
|
conditions:
|
||||||
- !type:LowWallInTile {}
|
- !type:EmptyOrWindowValidInTile {}
|
||||||
- !type:NoWindowsInTile {}
|
- !type:NoWindowsInTile {}
|
||||||
icon:
|
icon:
|
||||||
sprite: Structures/Windows/plasma_window.rsi
|
sprite: Structures/Windows/plasma_window.rsi
|
||||||
|
|||||||
Reference in New Issue
Block a user