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 pull request new-frontiers-14#2071 from whatston3/sep24-upstrea…
…m-merge September '24 Upstream Merge
- Loading branch information
Showing
2,178 changed files
with
269,553 additions
and
140,003 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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using Content.Shared.Anomaly.Components; | ||
using Content.Shared.Anomaly.Effects; | ||
using Content.Shared.Body.Components; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client.Anomaly.Effects; | ||
|
||
public sealed class ClientInnerBodyAnomalySystem : SharedInnerBodyAnomalySystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
SubscribeLocalEvent<InnerBodyAnomalyComponent, AfterAutoHandleStateEvent>(OnAfterHandleState); | ||
SubscribeLocalEvent<InnerBodyAnomalyComponent, ComponentShutdown>(OnCompShutdown); | ||
} | ||
|
||
private void OnAfterHandleState(Entity<InnerBodyAnomalyComponent> ent, ref AfterAutoHandleStateEvent args) | ||
{ | ||
if (!TryComp<SpriteComponent>(ent, out var sprite)) | ||
return; | ||
|
||
if (ent.Comp.FallbackSprite is null) | ||
return; | ||
|
||
if (!sprite.LayerMapTryGet(ent.Comp.LayerMap, out var index)) | ||
index = sprite.LayerMapReserveBlank(ent.Comp.LayerMap); | ||
|
||
if (TryComp<BodyComponent>(ent, out var body) && | ||
body.Prototype is not null && | ||
ent.Comp.SpeciesSprites.TryGetValue(body.Prototype.Value, out var speciesSprite)) | ||
{ | ||
sprite.LayerSetSprite(index, speciesSprite); | ||
} | ||
else | ||
{ | ||
sprite.LayerSetSprite(index, ent.Comp.FallbackSprite); | ||
} | ||
|
||
sprite.LayerSetVisible(index, true); | ||
sprite.LayerSetShader(index, "unshaded"); | ||
} | ||
|
||
private void OnCompShutdown(Entity<InnerBodyAnomalyComponent> ent, ref ComponentShutdown args) | ||
{ | ||
if (!TryComp<SpriteComponent>(ent, out var sprite)) | ||
return; | ||
|
||
var index = sprite.LayerMapGet(ent.Comp.LayerMap); | ||
sprite.LayerSetVisible(index, false); | ||
} | ||
} |
2 changes: 0 additions & 2 deletions
2
Content.Client/Anomaly/Ui/AnomalyGeneratorBoundUserInterface.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
Oops, something went wrong.