Skip to content

Commit

Permalink
change secborg thing so it doesnt log errors
Browse files Browse the repository at this point in the history
  • Loading branch information
deltanedas committed Nov 24, 2024
1 parent 51d8874 commit 9977160
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 deletions.
11 changes: 4 additions & 7 deletions Content.Client/Silicons/Borgs/BorgSwitchableTypeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
using Content.Shared.Silicons.Borgs;
using Content.Shared.Silicons.Borgs.Components;
using Robust.Client.GameObjects;
using Robust.Client.ResourceManagement; // DeltaV
using static Robust.Shared.Serialization.TypeSerializers.Implementations.SpriteSpecifierSerializer; // DeltaV

namespace Content.Client.Silicons.Borgs;

Expand All @@ -16,7 +14,6 @@ public sealed class BorgSwitchableTypeSystem : SharedBorgSwitchableTypeSystem
{
[Dependency] private readonly BorgSystem _borgSystem = default!;
[Dependency] private readonly AppearanceSystem _appearance = default!;
[Dependency] private readonly IResourceCache _resourceCache = default!; // DeltaV

public override void Initialize()
{
Expand All @@ -40,12 +37,12 @@ protected override void UpdateEntityAppearance(
Entity<BorgSwitchableTypeComponent> entity,
BorgTypePrototype prototype)
{
// Begin DeltaV Code
if (prototype.ClientComponents is {} add)
EntityManager.AddComponents(entity, add);
// End DeltaV Code
if (TryComp(entity, out SpriteComponent? sprite))
{
// DeltaV: Begin sprite path stuff
if (prototype.SpritePath is {} path && _resourceCache.TryGetResource(TextureRoot / path, out RSIResource? resource))
sprite.BaseRSI = resource.RSI;
// DeltaV: End sprite path stuff
sprite.LayerSetState(BorgVisualLayers.Body, prototype.SpriteBodyState);
sprite.LayerSetState(BorgVisualLayers.LightStatus, prototype.SpriteToggleLightState);
}
Expand Down
5 changes: 2 additions & 3 deletions Content.Shared/Silicons/Borgs/BorgTypePrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Content.Shared.Whitelist;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility; // DeltaV

namespace Content.Shared.Silicons.Borgs;

Expand Down Expand Up @@ -95,10 +94,10 @@ public sealed partial class BorgTypePrototype : IPrototype
//

/// <summary>
/// DeltaV: Sprite RSI path to use instead of the default.
/// DeltaV: Components only added on the client.
/// </summary>
[DataField]
public ResPath? SpritePath;
public ComponentRegistry? ClientComponents;

/// <summary>
/// The sprite state for the main borg body.
Expand Down
13 changes: 0 additions & 13 deletions Resources/Prototypes/DeltaV/Entities/Mobs/Cyborgs/borg_chassis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,5 @@
parent: BorgChassisSelectable
name: security cyborg
components:
- type: Sprite
sprite: DeltaV/Mobs/Silicon/chassis.rsi
layers:
- state: security
map: ["enum.BorgVisualLayers.Body", "movement"]
- state: security_e_r
map: ["enum.BorgVisualLayers.Light"]
shader: unshaded
visible: false
- state: security_l
shader: unshaded
map: ["light","enum.BorgVisualLayers.LightStatus"]
visible: false
- type: BorgSwitchableType
selectedBorgType: security
15 changes: 14 additions & 1 deletion Resources/Prototypes/DeltaV/borg_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,21 @@
- Security

# Visual
clientComponents:
- type: Sprite
sprite: DeltaV/Mobs/Silicon/chassis.rsi
layers:
- state: security
map: ["enum.BorgVisualLayers.Body", "movement"]
- state: security_e_r
map: ["enum.BorgVisualLayers.Light"]
shader: unshaded
visible: false
- state: security_l
shader: unshaded
map: ["light","enum.BorgVisualLayers.LightStatus"]
visible: false
inventoryTemplateId: borgShort
spritePath: DeltaV/Mobs/Silicon/chassis.rsi
spriteBodyState: security
spriteHasMindState: security_e
spriteNoMindState: security_e_r
Expand Down

0 comments on commit 9977160

Please sign in to comment.