Skip to content

Commit

Permalink
Renames
Browse files Browse the repository at this point in the history
  • Loading branch information
FireNameFN committed Nov 9, 2024
1 parent f293531 commit e520367
Show file tree
Hide file tree
Showing 18 changed files with 68 additions and 68 deletions.
38 changes: 19 additions & 19 deletions Content.Client/_CorvaxNext/FootPrint/FootPrintsVisualizerSystem.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Content.Shared._CorvaxNext.FootPrint;
using Content.Shared._CorvaxNext.Footprint;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Shared.Random;

namespace Content.Client._CorvaxNext.FootPrint;
namespace Content.Client._CorvaxNext.Footprint;

public sealed class FootPrintsVisualizerSystem : VisualizerSystem<FootPrintComponent>
public sealed class FootprintsVisualizerSystem : VisualizerSystem<FootprintComponent>
{
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly IRobustRandom _random = default!;
Expand All @@ -14,52 +14,52 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<FootPrintComponent, ComponentInit>(OnInitialized);
SubscribeLocalEvent<FootPrintComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<FootprintComponent, ComponentInit>(OnInitialized);
SubscribeLocalEvent<FootprintComponent, ComponentShutdown>(OnShutdown);
}

private void OnInitialized(EntityUid uid, FootPrintComponent comp, ComponentInit args)
private void OnInitialized(EntityUid uid, FootprintComponent comp, ComponentInit args)
{
if (!TryComp<SpriteComponent>(uid, out var sprite))
return;

sprite.LayerMapReserveBlank(FootPrintVisualLayers.Print);
sprite.LayerMapReserveBlank(FootprintVisualLayers.Print);
UpdateAppearance(uid, comp, sprite);
}

private void OnShutdown(EntityUid uid, FootPrintComponent comp, ComponentShutdown args)
private void OnShutdown(EntityUid uid, FootprintComponent comp, ComponentShutdown args)
{
if (TryComp<SpriteComponent>(uid, out var sprite) &&
sprite.LayerMapTryGet(FootPrintVisualLayers.Print, out var layer))
sprite.LayerMapTryGet(FootprintVisualLayers.Print, out var layer))
{
sprite.RemoveLayer(layer);
}
}

private void UpdateAppearance(EntityUid uid, FootPrintComponent component, SpriteComponent sprite)
private void UpdateAppearance(EntityUid uid, FootprintComponent component, SpriteComponent sprite)
{
if (!sprite.LayerMapTryGet(FootPrintVisualLayers.Print, out var layer)
|| !TryComp<FootPrintVisualiserComponent>(component.PrintOwner, out var printsComponent)
if (!sprite.LayerMapTryGet(FootprintVisualLayers.Print, out var layer)
|| !TryComp<FootprintVisualizerComponent>(component.FootprintsVisualizer, out var printsComponent)
|| !TryComp<AppearanceComponent>(uid, out var appearance))
return;

if (!_appearance.TryGetData<FootPrintVisuals>(uid, FootPrintVisualState.State, out var printVisuals, appearance))
if (!_appearance.TryGetData<FootprintVisuals>(uid, FootprintVisualState.State, out var printVisuals, appearance))
return;

sprite.LayerSetState(layer, new RSI.StateId(printVisuals switch
{
FootPrintVisuals.BareFootPrint => printsComponent.RightStep ? printsComponent.RightBarePrint : printsComponent.LeftBarePrint,
FootPrintVisuals.ShoesPrint => printsComponent.ShoesPrint,
FootPrintVisuals.SuitPrint => printsComponent.SuitPrint,
FootPrintVisuals.Dragging => _random.Pick(printsComponent.DraggingPrint),
FootprintVisuals.BareFootprint => printsComponent.RightStep ? printsComponent.RightBarePrint : printsComponent.LeftBarePrint,
FootprintVisuals.ShoesPrint => printsComponent.ShoesPrint,
FootprintVisuals.SuitPrint => printsComponent.SuitPrint,
FootprintVisuals.Dragging => _random.Pick(printsComponent.DraggingPrint),
_ => throw new ArgumentOutOfRangeException($"Unknown {printVisuals} parameter.")
}), printsComponent.RsiPath);

if (_appearance.TryGetData<Color>(uid, FootPrintVisualState.Color, out var printColor, appearance))
if (_appearance.TryGetData<Color>(uid, FootprintVisualState.Color, out var printColor, appearance))
sprite.LayerSetColor(layer, printColor);
}

protected override void OnAppearanceChange (EntityUid uid, FootPrintComponent component, ref AppearanceChangeEvent args)
protected override void OnAppearanceChange (EntityUid uid, FootprintComponent component, ref AppearanceChangeEvent args)
{
if (args.Sprite is not { } sprite)
return;
Expand Down
34 changes: 17 additions & 17 deletions Content.Server/_CorvaxNext/FootPrint/FootPrintsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
using Content.Shared.Inventory;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Content.Shared._CorvaxNext.FootPrint;
using Content.Shared._CorvaxNext.Footprint;
using Content.Shared.Standing;
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.EntitySystems;
using Robust.Shared.Map;
using Robust.Shared.Random;

namespace Content.Server._CorvaxNext.FootPrint;
namespace Content.Server._CorvaxNext.Footprint;

public sealed class FootPrintsSystem : EntitySystem
public sealed class FootprintsSystem : EntitySystem
{
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly InventorySystem _inventory = default!;
Expand All @@ -33,16 +33,16 @@ public override void Initialize()
_mobThresholdQuery = GetEntityQuery<MobThresholdsComponent>();
_appearanceQuery = GetEntityQuery<AppearanceComponent>();

SubscribeLocalEvent<FootPrintVisualiserComponent, ComponentStartup>(OnStartupComponent);
SubscribeLocalEvent<FootPrintVisualiserComponent, MoveEvent>(OnMove);
SubscribeLocalEvent<FootprintVisualizerComponent, ComponentStartup>(OnStartupComponent);
SubscribeLocalEvent<FootprintVisualizerComponent, MoveEvent>(OnMove);
}

private void OnStartupComponent(EntityUid uid, FootPrintVisualiserComponent component, ComponentStartup args)
private void OnStartupComponent(EntityUid uid, FootprintVisualizerComponent component, ComponentStartup args)
{
component.StepSize = Math.Max(0f, component.StepSize + _random.NextFloat(-0.05f, 0.05f));
}

private void OnMove(EntityUid uid, FootPrintVisualiserComponent component, ref MoveEvent args)
private void OnMove(EntityUid uid, FootprintVisualizerComponent component, ref MoveEvent args)
{
if (component.PrintsColor.A <= 0f
|| !_transformQuery.TryComp(uid, out var transform)
Expand All @@ -60,15 +60,15 @@ private void OnMove(EntityUid uid, FootPrintVisualiserComponent component, ref M
component.RightStep = !component.RightStep;

var entity = Spawn(component.StepProtoId, CalcCoords(gridUid, component, transform, dragging));
var footPrintComponent = EnsureComp<FootPrintComponent>(entity);
var footPrintComponent = EnsureComp<FootprintComponent>(entity);

footPrintComponent.PrintOwner = uid;
footPrintComponent.FootprintsVisualizer = uid;
Dirty(entity, footPrintComponent);

if (_appearanceQuery.TryComp(entity, out var appearance))
{
_appearance.SetData(entity, FootPrintVisualState.State, PickState(uid, dragging), appearance);
_appearance.SetData(entity, FootPrintVisualState.Color, component.PrintsColor, appearance);
_appearance.SetData(entity, FootprintVisualState.State, PickState(uid, dragging), appearance);
_appearance.SetData(entity, FootprintVisualState.Color, component.PrintsColor, appearance);
}

if (!_transformQuery.TryComp(entity, out var stepTransform))
Expand All @@ -89,7 +89,7 @@ private void OnMove(EntityUid uid, FootPrintVisualiserComponent component, ref M
_solution.TryAddReagent(footPrintComponent.Solution.Value, component.ReagentToTransfer, 1, out _);
}

private EntityCoordinates CalcCoords(EntityUid uid, FootPrintVisualiserComponent component, TransformComponent transform, bool state)
private EntityCoordinates CalcCoords(EntityUid uid, FootprintVisualizerComponent component, TransformComponent transform, bool state)
{
if (state)
return new EntityCoordinates(uid, transform.LocalPosition);
Expand All @@ -101,18 +101,18 @@ private EntityCoordinates CalcCoords(EntityUid uid, FootPrintVisualiserComponent
return new EntityCoordinates(uid, transform.LocalPosition + offset);
}

private FootPrintVisuals PickState(EntityUid uid, bool dragging)
private FootprintVisuals PickState(EntityUid uid, bool dragging)
{
var state = FootPrintVisuals.BareFootPrint;
var state = FootprintVisuals.BareFootprint;

if (_inventory.TryGetSlotEntity(uid, "shoes", out _))
state = FootPrintVisuals.ShoesPrint;
state = FootprintVisuals.ShoesPrint;

if (_inventory.TryGetSlotEntity(uid, "outerClothing", out var suit) && TryComp<PressureProtectionComponent>(suit, out _))
state = FootPrintVisuals.SuitPrint;
state = FootprintVisuals.SuitPrint;

if (dragging)
state = FootPrintVisuals.Dragging;
state = FootprintVisuals.Dragging;

return state;
}
Expand Down
14 changes: 7 additions & 7 deletions Content.Server/_CorvaxNext/FootPrint/PuddleFootPrintsSystem.cs
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
using System.Linq;
using Content.Shared._CorvaxNext.FootPrint;
using Content.Shared._CorvaxNext.Footprint;
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Fluids;
using Content.Shared.Fluids.Components;
using Robust.Shared.Physics.Events;

namespace Content.Server._CorvaxNext.FootPrint;
namespace Content.Server._CorvaxNext.Footprint;

public sealed class PuddleFootPrintsSystem : EntitySystem
public sealed class PuddleFootprintsSystem : EntitySystem
{
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<PuddleFootPrintsComponent, EndCollideEvent>(OnStepTrigger);
SubscribeLocalEvent<PuddleFootprintsComponent, EndCollideEvent>(OnStepTrigger);
}

private void OnStepTrigger(EntityUid uid, PuddleFootPrintsComponent component, ref EndCollideEvent args)
private void OnStepTrigger(EntityUid uid, PuddleFootprintsComponent component, ref EndCollideEvent args)
{
if (!TryComp<AppearanceComponent>(uid, out var appearance)
|| !TryComp<PuddleComponent>(uid, out var puddle)
|| !TryComp<FootPrintVisualiserComponent>(args.OtherEntity, out var tripper)
|| !TryComp<FootprintVisualizerComponent>(args.OtherEntity, out var tripper)
|| !TryComp<SolutionContainerManagerComponent>(uid, out var solutionManager)
||!_solutionContainer.ResolveSolution((uid, solutionManager), puddle.SolutionName, ref puddle.Solution, out var solutions))
return;
Expand All @@ -45,7 +45,7 @@ private void OnStepTrigger(EntityUid uid, PuddleFootPrintsComponent component, r
_solutionContainer.RemoveEachReagent(puddle.Solution.Value, 1);
}

private void AddColor(Color col, float quantity, FootPrintVisualiserComponent component)
private void AddColor(Color col, float quantity, FootprintVisualizerComponent component)
{
component.PrintsColor = component.ColorQuantity == 0f ? col : Color.InterpolateBetween(component.PrintsColor, col, component.ColorInterpolationFactor);
component.ColorQuantity += quantity;
Expand Down
8 changes: 4 additions & 4 deletions Content.Shared/_CorvaxNext/Footprint/FootPrintComponent.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
using Content.Shared.Chemistry.Components;
using Robust.Shared.GameStates;

namespace Content.Shared._CorvaxNext.FootPrint;
namespace Content.Shared._CorvaxNext.Footprint;

/// <summary>
/// This is used for marking footsteps, handling footprint drawing.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class FootPrintComponent : Component
public sealed partial class FootprintComponent : Component
{
/// <summary>
/// Owner (with <see cref="FootPrintsComponent"/>) of a print (this component).
/// Owner (with <see cref="FootprintVisualizerComponent"/>) of a print (this component).
/// </summary>
[AutoNetworkedField]
public EntityUid PrintOwner;
public EntityUid FootprintsVisualizer;

[DataField]
public string SolutionName = "step";
Expand Down
10 changes: 5 additions & 5 deletions Content.Shared/_CorvaxNext/Footprint/FootPrintVisuals.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
using Robust.Shared.Serialization;

namespace Content.Shared._CorvaxNext.FootPrint;
namespace Content.Shared._CorvaxNext.Footprint;

[Serializable, NetSerializable]
public enum FootPrintVisuals : byte
public enum FootprintVisuals : byte
{
BareFootPrint,
BareFootprint,
ShoesPrint,
SuitPrint,
Dragging
}

[Serializable, NetSerializable]
public enum FootPrintVisualState : byte
public enum FootprintVisualState : byte
{
State,
Color
}

[Serializable, NetSerializable]
public enum FootPrintVisualLayers : byte
public enum FootprintVisualLayers : byte
{
Print
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;

namespace Content.Shared._CorvaxNext.FootPrint;
namespace Content.Shared._CorvaxNext.Footprint;

[RegisterComponent]
public sealed partial class FootPrintVisualiserComponent : Component
public sealed partial class FootprintVisualizerComponent : Component
{
[ViewVariables(VVAccess.ReadOnly), DataField]
public ResPath RsiPath = new("/Textures/_CorvaxNext/Effects/footprints.rsi");
Expand Down Expand Up @@ -35,7 +35,7 @@ public sealed partial class FootPrintVisualiserComponent : Component
// yea, those

[ViewVariables(VVAccess.ReadOnly), DataField]
public EntProtoId<FootPrintComponent> StepProtoId = "Footstep";
public EntProtoId<FootprintComponent> StepProtoId = "Footstep";

[ViewVariables(VVAccess.ReadOnly), DataField]
public Color PrintsColor = Color.FromHex("#00000000");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Content.Shared._CorvaxNext.FootPrint;
namespace Content.Shared._CorvaxNext.Footprint;

[RegisterComponent]
public sealed partial class PuddleFootPrintsComponent : Component
public sealed partial class PuddleFootprintsComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
public float SizeRatio = 0.2f;
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Entities/Effects/puddle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,4 @@
- type: Tag
tags:
- DNASolutionScannable
- type: PuddleFootPrints # Corvax-Next-Footprints
- type: PuddleFootprints # Corvax-Next-Footprints
2 changes: 1 addition & 1 deletion Resources/Prototypes/Entities/Mobs/Species/arachnid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
visible: false
- type: Inventory
templateId: arachnid
- type: FootPrints # Corvax-Next-Footprints
- type: Footprints # Corvax-Next-Footprints
leftBarePrint: "footprint-left-bare-spider"
rightBarePrint: "footprint-right-bare-spider"

Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Entities/Mobs/Species/diona.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
32:
sprite: Mobs/Species/Human/displacement.rsi
state: jumpsuit-female
- type: FootPrints # Corvax-Next-Footprints
- type: Footprints # Corvax-Next-Footprints
leftBarePrint: "footprint-left-bare-diona"
rightBarePrint: "footprint-right-bare-diona"

Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Entities/Mobs/Species/dwarf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
32:
sprite: Mobs/Species/Human/displacement.rsi
state: jumpsuit-female
- type: FootPrints # Corvax-Next-Footprints
- type: Footprints # Corvax-Next-Footprints
leftBarePrint: "footprint-left-bare-dwarf"
rightBarePrint: "footprint-right-bare-dwarf"

Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Entities/Mobs/Species/human.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
32:
sprite: Mobs/Species/Human/displacement.rsi
state: jumpsuit-female
- type: FootPrints # Corvax-Next-Footprints
- type: Footprints # Corvax-Next-Footprints


- type: entity
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Entities/Mobs/Species/moth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
32:
sprite: Mobs/Species/Human/displacement.rsi
state: jumpsuit-female
- type: FootPrints # Corvax-Next-Footprints
- type: Footprints # Corvax-Next-Footprints

- type: entity
parent: BaseSpeciesDummy
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Entities/Mobs/Species/reptilian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
32:
sprite: Mobs/Species/Human/displacement.rsi
state: jumpsuit-female
- type: FootPrints # Corvax-Next-Footprints
- type: Footprints # Corvax-Next-Footprints
leftBarePrint: "footprint-left-bare-lizard"
rightBarePrint: "footprint-right-bare-lizard"

Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Entities/Mobs/Species/skeleton.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
32:
sprite: Mobs/Species/Human/displacement.rsi
state: jumpsuit-female
- type: FootPrints # Corvax-Next-Footprints
- type: Footprints # Corvax-Next-Footprints

- type: entity
parent: BaseSpeciesDummy
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Entities/Mobs/Species/slime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
32:
sprite: Mobs/Species/Human/displacement.rsi
state: jumpsuit-female
- type: FootPrints # Corvax-Next-Footprints
- type: Footprints # Corvax-Next-Footprints
leftBarePrint: "footprint-left-bare-slime"
rightBarePrint: "footprint-right-bare-slime"

Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Entities/Mobs/Species/vox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
32:
sprite: Mobs/Species/Vox/displacement.rsi
state: shoes
- type: FootPrints # Corvax-Next-Footprints
- type: Footprints # Corvax-Next-Footprints
leftBarePrint: "footprint-left-bare-lizard"
rightBarePrint: "footprint-right-bare-lizard"

Expand Down
Loading

0 comments on commit e520367

Please sign in to comment.