-
Notifications
You must be signed in to change notification settings - Fork 669
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into upstream-sync
# Conflicts: # Resources/Prototypes/Entities/Objects/Misc/fluff_lights.yml # Resources/Textures/Objects/Devices/nuke.rsi/meta.json # Resources/Textures/Objects/Misc/Lights/lamp.rsi/meta.json
- Loading branch information
Showing
242 changed files
with
4,007 additions
and
1,230 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace Content.Client.Holiday; | ||
|
||
/// <summary> | ||
/// This is used for a component that swaps an entity's RSI based on HolidayVisuals | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class HolidayRsiSwapComponent : Component | ||
{ | ||
/// <summary> | ||
/// A dictionary of arbitrary visual keys to an rsi to swap the sprite to. | ||
/// </summary> | ||
[DataField] | ||
public Dictionary<string, string> Sprite = new(); | ||
} |
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,34 @@ | ||
using Content.Shared.Holiday; | ||
using Content.Shared.Item; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.Graphics; | ||
using Robust.Client.ResourceManagement; | ||
using Robust.Shared.Serialization.TypeSerializers.Implementations; | ||
|
||
namespace Content.Client.Holiday; | ||
|
||
public sealed class HolidaySystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IResourceCache _rescache = default!; | ||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!; | ||
|
||
/// <inheritdoc/> | ||
public override void Initialize() | ||
{ | ||
SubscribeLocalEvent<HolidayRsiSwapComponent, AppearanceChangeEvent>(OnAppearanceChange); | ||
} | ||
|
||
private void OnAppearanceChange(Entity<HolidayRsiSwapComponent> ent, ref AppearanceChangeEvent args) | ||
{ | ||
if (!_appearance.TryGetData<string>(ent, HolidayVisuals.Holiday, out var data, args.Component)) | ||
return; | ||
|
||
var comp = ent.Comp; | ||
if (!comp.Sprite.TryGetValue(data, out var rsistring) || args.Sprite == null) | ||
return; | ||
|
||
var path = SpriteSpecifierSerializer.TextureRoot / rsistring; | ||
if (_rescache.TryGetResource(path, out RSIResource? rsi)) | ||
args.Sprite.BaseRSI = rsi.RSI; | ||
} | ||
} |
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,51 @@ | ||
using Content.Shared.Movement.Components; | ||
using Content.Shared.Movement.Events; | ||
using Content.Shared.Movement.Systems; | ||
using Robust.Client.GameObjects; | ||
using Robust.Shared.Timing; | ||
|
||
namespace Content.Client.Movement.Systems; | ||
|
||
/// <summary> | ||
/// Handles setting sprite states based on whether an entity has movement input. | ||
/// </summary> | ||
public sealed class SpriteMovementSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IGameTiming _timing = default!; | ||
|
||
private EntityQuery<SpriteComponent> _spriteQuery; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<SpriteMovementComponent, MoveInputEvent>(OnSpriteMoveInput); | ||
_spriteQuery = GetEntityQuery<SpriteComponent>(); | ||
} | ||
|
||
private void OnSpriteMoveInput(EntityUid uid, SpriteMovementComponent component, ref MoveInputEvent args) | ||
{ | ||
if (!_timing.IsFirstTimePredicted) | ||
return; | ||
|
||
var oldMoving = SharedMoverController.GetNormalizedMovement(args.OldMovement) != MoveButtons.None; | ||
var moving = SharedMoverController.GetNormalizedMovement(args.Component.HeldMoveButtons) != MoveButtons.None; | ||
|
||
if (oldMoving == moving || !_spriteQuery.TryGetComponent(uid, out var sprite)) | ||
return; | ||
|
||
if (moving) | ||
{ | ||
foreach (var (layer, state) in component.MovementLayers) | ||
{ | ||
sprite.LayerSetData(layer, state); | ||
} | ||
} | ||
else | ||
{ | ||
foreach (var (layer, state) in component.NoMovementLayers) | ||
{ | ||
sprite.LayerSetData(layer, state); | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.