Убрал у FootprintComponent AutoGenerateComponentState
This commit is contained in:
parent
e0fdcee976
commit
8440e2bd76
3 changed files with 13 additions and 12 deletions
|
|
@ -74,7 +74,14 @@ public sealed class FootprintVisualizerSystem : VisualizerSystem<FootprintCompon
|
|||
|| !TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
return;
|
||||
|
||||
UpdateSpriteState(sprite, layer,footprint.StateId, footprint.SpritePath);
|
||||
if (!_appearanceSystem.TryGetData<string>(
|
||||
uid,
|
||||
FootprintVisualParameter.VisualState,
|
||||
out var visualState,
|
||||
appearance))
|
||||
return;
|
||||
|
||||
UpdateSpriteState(sprite, layer, visualState, footprint.SpritePath);
|
||||
UpdateSpriteColor(sprite, layer, uid, appearance);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -197,13 +197,13 @@ public sealed class FootprintSystem : EntitySystem
|
|||
var coords = CalculateFootprintPosition(gridUid, emitter, transform, stand);
|
||||
var entity = Spawn(stand ? emitter.FootprintPrototype : emitter.DragMarkPrototype, coords);
|
||||
|
||||
var footprint = EnsureComp<FootprintComponent>(entity);
|
||||
|
||||
if (_appearanceQuery.TryComp(entity, out var appearance))
|
||||
{
|
||||
var visualType = DetermineVisualState(emitterOwner, stand);
|
||||
footprint.StateId = GetStateId(visualType, emitter);
|
||||
Dirty(entity, footprint);
|
||||
_appearanceSystem.SetData(entity,
|
||||
FootprintVisualParameter.VisualState,
|
||||
GetStateId(visualType, emitter),
|
||||
appearance);
|
||||
|
||||
var rawAlpha = emitterSolution.Volume.Float() / emitterSolution.MaxVolume.Float();
|
||||
var alpha = Math.Clamp((0.8f * rawAlpha) + 0.3f, 0f, 1f);
|
||||
|
|
|
|||
|
|
@ -10,15 +10,9 @@ namespace Content.Shared._Sunrise.Footprints;
|
|||
/// <summary>
|
||||
/// Component that represents a single footprint entity in the world
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class FootprintComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Entity that created this footprint
|
||||
/// </summary>
|
||||
[AutoNetworkedField]
|
||||
public string StateId;
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly), DataField]
|
||||
public ResPath SpritePath = new("/Textures/_Sunrise/Effects/footprints.rsi");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue