Engine Entity Anchoring Changes (#4195)
* Converted all SnapGridPositionChangedEvent subscriptions to AnchorStateChangedEvent. * Fixes power tests with new anchored requirements. * Moved AnchorableComponent into construction. AnchorableComponent now uses Transform.Anchored. * Fixed bug with nodes, power works again. * Adds lifetime stages to Component. * Update Engine to v0.4.70.
This commit is contained in:
@@ -12,7 +12,7 @@ namespace Content.Client.Animations
|
||||
{
|
||||
public override string Name => "AnimationsTest";
|
||||
|
||||
public override void Initialize()
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Content.Client.CharacterInfo.Components
|
||||
public Control Scene { get; private set; } = default!;
|
||||
public UIPriority Priority => UIPriority.Info;
|
||||
|
||||
public override void OnAdd()
|
||||
protected override void OnAdd()
|
||||
{
|
||||
base.OnAdd();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Content.Client.CharacterInterface
|
||||
/// <summary>
|
||||
/// Create the window with all character UIs and bind it to a keypress
|
||||
/// </summary>
|
||||
public override void Initialize()
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Content.Client.CharacterInterface
|
||||
/// <summary>
|
||||
/// Dispose of window and the keypress binding
|
||||
/// </summary>
|
||||
public override void OnRemove()
|
||||
protected override void OnRemove()
|
||||
{
|
||||
base.OnRemove();
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Content.Client.Clothing
|
||||
}
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
ClothingEquippedPrefix = ClothingEquippedPrefix;
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Content.Client.Cuffs.Components
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemove()
|
||||
protected override void OnRemove()
|
||||
{
|
||||
base.OnRemove();
|
||||
|
||||
|
||||
@@ -33,13 +33,13 @@ namespace Content.Client.DoAfter
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAdd()
|
||||
protected override void OnAdd()
|
||||
{
|
||||
base.OnAdd();
|
||||
Enable();
|
||||
}
|
||||
|
||||
public override void OnRemove()
|
||||
protected override void OnRemove()
|
||||
{
|
||||
base.OnRemove();
|
||||
Disable();
|
||||
|
||||
@@ -72,14 +72,14 @@ namespace Content.Client.Hands
|
||||
return GetHand(handName)?.Entity;
|
||||
}
|
||||
|
||||
public override void OnRemove()
|
||||
protected override void OnRemove()
|
||||
{
|
||||
base.OnRemove();
|
||||
|
||||
_gui?.Dispose();
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
@@ -201,6 +201,7 @@ namespace Content.Client.Hands
|
||||
|
||||
protected override void Startup()
|
||||
{
|
||||
base.Startup();
|
||||
ActiveIndex = _hands.LastOrDefault()?.Name;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Content.Client.IconSmoothing
|
||||
/// </summary>
|
||||
internal int UpdateGeneration { get; set; }
|
||||
|
||||
public override void Initialize()
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
@@ -263,7 +263,7 @@ namespace Content.Client.IconSmoothing
|
||||
}
|
||||
}
|
||||
|
||||
public void SnapGridOnPositionChanged()
|
||||
public void AnchorStateChanged()
|
||||
{
|
||||
if (Owner.Transform.Anchored)
|
||||
{
|
||||
|
||||
@@ -25,8 +25,7 @@ namespace Content.Client.IconSmoothing
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<IconSmoothDirtyEvent>(HandleDirtyEvent);
|
||||
|
||||
SubscribeLocalEvent<IconSmoothComponent, SnapGridPositionChangedEvent>(HandleSnapGridMove);
|
||||
SubscribeLocalEvent<IconSmoothComponent, AnchorStateChangedEvent>(HandleAnchorChanged);
|
||||
}
|
||||
|
||||
public override void FrameUpdate(float frameTime)
|
||||
@@ -92,9 +91,9 @@ namespace Content.Client.IconSmoothing
|
||||
}
|
||||
}
|
||||
|
||||
private static void HandleSnapGridMove(EntityUid uid, IconSmoothComponent component, SnapGridPositionChangedEvent args)
|
||||
private static void HandleAnchorChanged(EntityUid uid, IconSmoothComponent component, AnchorStateChangedEvent args)
|
||||
{
|
||||
component.SnapGridOnPositionChanged();
|
||||
component.AnchorStateChanged();
|
||||
}
|
||||
|
||||
private void AddValidEntities(IEnumerable<EntityUid> candidates)
|
||||
|
||||
@@ -196,7 +196,7 @@ namespace Content.Client.Instruments
|
||||
}
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Content.Client.Inventory
|
||||
[ViewVariables]
|
||||
[DataField("speciesId")] public string? SpeciesId { get; set; }
|
||||
|
||||
public override void OnRemove()
|
||||
protected override void OnRemove()
|
||||
{
|
||||
base.OnRemove();
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Content.Client.Inventory
|
||||
InterfaceController?.Dispose();
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Client.Singularity.Components
|
||||
|
||||
private SpriteComponent? _spriteComponent;
|
||||
|
||||
public override void Initialize()
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace Content.Client.Sound
|
||||
}
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SoundSystem.OcclusionCollisionMask = (int) CollisionGroup.Impassable;
|
||||
|
||||
@@ -17,13 +17,13 @@ namespace Content.Client.Spawners
|
||||
|
||||
private readonly List<IEntity> _entity = new();
|
||||
|
||||
public override void Initialize()
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SpawnEntities();
|
||||
}
|
||||
|
||||
public override void OnRemove()
|
||||
protected override void OnRemove()
|
||||
{
|
||||
RemoveEntities();
|
||||
base.OnRemove();
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Content.Client.Storage
|
||||
|
||||
public override IReadOnlyList<IEntity> StoredEntities => _storedEntities;
|
||||
|
||||
public override void Initialize()
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
@@ -41,14 +41,14 @@ namespace Content.Client.Storage
|
||||
ChangeStorageVisualization(SharedBagState.Close);
|
||||
}
|
||||
|
||||
public override void OnAdd()
|
||||
protected override void OnAdd()
|
||||
{
|
||||
base.OnAdd();
|
||||
|
||||
_window = new StorageWindow(this) {Title = Owner.Name};
|
||||
}
|
||||
|
||||
public override void OnRemove()
|
||||
protected override void OnRemove()
|
||||
{
|
||||
_window?.Dispose();
|
||||
base.OnRemove();
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace Content.Client.Suspicion
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemove()
|
||||
protected override void OnRemove()
|
||||
{
|
||||
base.OnRemove();
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Client.Weapons.Melee.Components
|
||||
private SpriteComponent? _sprite;
|
||||
private Angle _baseAngle;
|
||||
|
||||
public override void Initialize()
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Client.Window
|
||||
|
||||
private ISpriteComponent? _sprite;
|
||||
|
||||
public override void Initialize()
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Content.Client.Window
|
||||
}
|
||||
}
|
||||
|
||||
public void SnapGridOnPositionChanged()
|
||||
public void AnchorStateChanged()
|
||||
{
|
||||
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new WindowSmoothDirtyEvent(Owner));
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Content.Client.Window
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<WindowSmoothDirtyEvent>(HandleDirtyEvent);
|
||||
SubscribeLocalEvent<WindowComponent, SnapGridPositionChangedEvent>(HandleSnapGridMove);
|
||||
SubscribeLocalEvent<WindowComponent, AnchorStateChangedEvent>(HandleAnchorChanged);
|
||||
}
|
||||
|
||||
private void HandleDirtyEvent(WindowSmoothDirtyEvent ev)
|
||||
@@ -25,9 +25,9 @@ namespace Content.Client.Window
|
||||
}
|
||||
}
|
||||
|
||||
private static void HandleSnapGridMove(EntityUid uid, WindowComponent component, SnapGridPositionChangedEvent args)
|
||||
private static void HandleAnchorChanged(EntityUid uid, WindowComponent component, AnchorStateChangedEvent args)
|
||||
{
|
||||
component.SnapGridOnPositionChanged();
|
||||
component.AnchorStateChanged();
|
||||
}
|
||||
|
||||
public override void FrameUpdate(float frameTime)
|
||||
|
||||
Reference in New Issue
Block a user