Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Numerics;
|
||||
using Content.Client.Gravity;
|
||||
using Content.Shared.Rotation;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Events;
|
||||
using Robust.Client.Animations;
|
||||
@@ -14,6 +15,7 @@ public sealed class WaddleAnimationSystem : EntitySystem
|
||||
[Dependency] private readonly AnimationPlayerSystem _animation = default!;
|
||||
[Dependency] private readonly GravitySystem _gravity = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly AppearanceSystem _appearance = default!; // WD EDIT
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -32,7 +34,13 @@ public sealed class WaddleAnimationSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (!args.HasDirectionalMovement && component.IsCurrentlyWaddling)
|
||||
// WD EDIT
|
||||
_appearance.TryGetData<RotationState>(entity, RotationVisuals.RotationState, out var state);
|
||||
if (state is RotationState.Horizontal)
|
||||
return;
|
||||
// WD EDIT
|
||||
|
||||
if (!args.HasDirectionalMovement && component.IsCurrentlyWaddling)
|
||||
{
|
||||
component.IsCurrentlyWaddling = false;
|
||||
|
||||
@@ -71,6 +79,12 @@ public sealed class WaddleAnimationSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
// WD EDIT
|
||||
_appearance.TryGetData<RotationState>(uid, RotationVisuals.RotationState, out var state);
|
||||
if (TryComp<SpriteComponent>(uid, out var sprite) && TryComp<RotationVisualsComponent>(uid, out var rotat) && state is RotationState.Horizontal)
|
||||
return;
|
||||
// WD EDIT
|
||||
|
||||
var tumbleIntensity = component.LastStep ? 360 - component.TumbleIntensity : component.TumbleIntensity;
|
||||
var len = mover.Sprinting ? component.AnimationLength * component.RunAnimationLengthMultiplier : component.AnimationLength;
|
||||
|
||||
@@ -128,8 +142,13 @@ public sealed class WaddleAnimationSystem : EntitySystem
|
||||
|
||||
private void OnAnimationCompleted(EntityUid uid, WaddleAnimationComponent component, AnimationCompletedEvent args)
|
||||
{
|
||||
var started = new StartedWaddlingEvent(uid);
|
||||
if (args.Key is not "Waddle") // WD EDIT
|
||||
{
|
||||
component.IsCurrentlyWaddling = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var started = new StartedWaddlingEvent(uid);
|
||||
RaiseLocalEvent(uid, ref started);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,10 @@ public sealed class RotationVisualizerSystem : SharedRotationVisualsSystem
|
||||
_animation.Stop(animationComp, animationKey);
|
||||
}
|
||||
|
||||
// WD EDIT
|
||||
if (_animation.HasRunningAnimation(animationComp, "Waddle"))
|
||||
_animation.Stop(animationComp, "Waddle");
|
||||
|
||||
var animation = new Animation
|
||||
{
|
||||
Length = TimeSpan.FromSeconds(animationTime),
|
||||
|
||||
@@ -291,6 +291,15 @@ public sealed partial class WizardMirrorWindow : DefaultWindow
|
||||
};
|
||||
|
||||
#endregion Eyes
|
||||
|
||||
#region Markings
|
||||
|
||||
CMarkings.OnMarkingAdded += OnMarkingChange;
|
||||
CMarkings.OnMarkingRemoved += OnMarkingChange;
|
||||
CMarkings.OnMarkingColorChange += OnMarkingChange;
|
||||
CMarkings.OnMarkingRankChange += OnMarkingChange;
|
||||
|
||||
#endregion Markings
|
||||
}
|
||||
|
||||
#region Set
|
||||
@@ -354,6 +363,15 @@ public sealed partial class WizardMirrorWindow : DefaultWindow
|
||||
IsDirty = true;
|
||||
}
|
||||
|
||||
private void OnMarkingChange(MarkingSet markings)
|
||||
{
|
||||
if (Profile is null)
|
||||
return;
|
||||
|
||||
Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithMarkings(markings.GetForwardEnumerator().ToList()));
|
||||
IsDirty = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Update
|
||||
@@ -602,6 +620,18 @@ public sealed partial class WizardMirrorWindow : DefaultWindow
|
||||
EyesPicker.SetData(Profile.Appearance.EyeColor);
|
||||
}
|
||||
|
||||
private void UpdateMarkings()
|
||||
{
|
||||
if (Profile == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CMarkings.SetData(Profile.Appearance.Markings, Profile.Species,
|
||||
Profile.Sex, Profile.BodyType, Profile.Appearance.SkinColor, Profile.Appearance.EyeColor
|
||||
);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void OnSkinColorOnValueChanged()
|
||||
@@ -688,5 +718,6 @@ public sealed partial class WizardMirrorWindow : DefaultWindow
|
||||
UpdateCMarkingsFacialHair();
|
||||
UpdateTtsVoicesControls();
|
||||
UpdateBodyTypes();
|
||||
UpdateMarkings();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,6 +80,12 @@
|
||||
<humanoid:SingleMarkingPicker Name="CFacialHairPicker" Category="FacialHair" />
|
||||
</BoxContainer>
|
||||
</prefUi:HighlightedContainer>
|
||||
<!-- Markings -->
|
||||
<prefUi:HighlightedContainer>
|
||||
<BoxContainer Name="CMarkingsTab" Orientation="Vertical" Margin="10">
|
||||
<humanoid:MarkingPicker Name="CMarkings" IgnoreCategories="Hair,FacialHair" />
|
||||
</BoxContainer>
|
||||
</prefUi:HighlightedContainer>
|
||||
</BoxContainer>
|
||||
</ScrollContainer>
|
||||
</DefaultWindow>
|
||||
|
||||
Reference in New Issue
Block a user