Skip to content

Commit

Permalink
Merge branch 'impstation:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mqole authored Nov 14, 2024
2 parents 8f1a390 + f6ca587 commit 35f1515
Show file tree
Hide file tree
Showing 21 changed files with 7,691 additions and 3,445 deletions.
121 changes: 121 additions & 0 deletions Content.Client/_Goobstation/Emoting/AnimatedEmotesSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
using Robust.Client.Animations;
using Robust.Shared.Animations;
using Robust.Shared.GameStates;
using Robust.Client.GameObjects;
using Content.Shared.Emoting;
using System.Numerics;
using Robust.Shared.Prototypes;
using Content.Shared.Chat.Prototypes;

namespace Content.Client.Emoting;

public sealed partial class AnimatedEmotesSystem : SharedAnimatedEmotesSystem
{
[Dependency] private readonly AnimationPlayerSystem _anim = default!;
[Dependency] private readonly IPrototypeManager _prot = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<AnimatedEmotesComponent, ComponentHandleState>(OnHandleState);

SubscribeLocalEvent<AnimatedEmotesComponent, AnimationFlipEmoteEvent>(OnFlip);
SubscribeLocalEvent<AnimatedEmotesComponent, AnimationSpinEmoteEvent>(OnSpin);
SubscribeLocalEvent<AnimatedEmotesComponent, AnimationJumpEmoteEvent>(OnJump);
}

public void PlayEmote(EntityUid uid, Animation anim, string animationKey = "emoteAnimKeyId")
{
if (_anim.HasRunningAnimation(uid, animationKey))
return;

_anim.Play(uid, anim, animationKey);
}

private void OnHandleState(EntityUid uid, AnimatedEmotesComponent component, ref ComponentHandleState args)
{
if (args.Current is not AnimatedEmotesComponentState state
|| !_prot.TryIndex<EmotePrototype>(state.Emote, out var emote))
return;

if (emote.Event != null)
RaiseLocalEvent(uid, emote.Event);
}

private void OnFlip(Entity<AnimatedEmotesComponent> ent, ref AnimationFlipEmoteEvent args)
{
var a = new Animation
{
Length = TimeSpan.FromMilliseconds(500),
AnimationTracks =
{
new AnimationTrackComponentProperty
{
ComponentType = typeof(SpriteComponent),
Property = nameof(SpriteComponent.Rotation),
InterpolationMode = AnimationInterpolationMode.Linear,
KeyFrames =
{
new AnimationTrackProperty.KeyFrame(Angle.Zero, 0f),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(180), 0.25f),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(360), 0.25f),
}
}
}
};
PlayEmote(ent, a);
}
private void OnSpin(Entity<AnimatedEmotesComponent> ent, ref AnimationSpinEmoteEvent args)
{
var a = new Animation
{
Length = TimeSpan.FromMilliseconds(600),
AnimationTracks =
{
new AnimationTrackComponentProperty
{
ComponentType = typeof(TransformComponent),
Property = nameof(TransformComponent.LocalRotation),
InterpolationMode = AnimationInterpolationMode.Linear,
KeyFrames =
{
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(0), 0f),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(90), 0.075f),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(180), 0.075f),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(270), 0.075f),
new AnimationTrackProperty.KeyFrame(Angle.Zero, 0.075f),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(90), 0.075f),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(180), 0.075f),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(270), 0.075f),
new AnimationTrackProperty.KeyFrame(Angle.Zero, 0.075f),
}
}
}
};
PlayEmote(ent, a, "emoteAnimSpin");
}
private void OnJump(Entity<AnimatedEmotesComponent> ent, ref AnimationJumpEmoteEvent args)
{
var a = new Animation
{
Length = TimeSpan.FromMilliseconds(250),
AnimationTracks =
{
new AnimationTrackComponentProperty
{
ComponentType = typeof(SpriteComponent),
Property = nameof(SpriteComponent.Offset),
InterpolationMode = AnimationInterpolationMode.Cubic,
KeyFrames =
{
new AnimationTrackProperty.KeyFrame(Vector2.Zero, 0f),
new AnimationTrackProperty.KeyFrame(new Vector2(0, .35f), 0.125f),
new AnimationTrackProperty.KeyFrame(Vector2.Zero, 0.125f),
}
}
}
};
PlayEmote(ent, a);
}
}
28 changes: 28 additions & 0 deletions Content.Server/_Goobstation/Emoting/AnimatedEmotesSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Robust.Shared.GameStates;
using Content.Server.Chat.Systems;
using Content.Shared.Chat.Prototypes;
using Content.Shared.Emoting;
using Robust.Shared.Prototypes;

namespace Content.Server.Emoting;

public sealed partial class AnimatedEmotesSystem : SharedAnimatedEmotesSystem
{
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<AnimatedEmotesComponent, EmoteEvent>(OnEmote);
}

private void OnEmote(EntityUid uid, AnimatedEmotesComponent component, ref EmoteEvent args)
{
PlayEmoteAnimation(uid, component, args.Emote.ID);
}

public void PlayEmoteAnimation(EntityUid uid, AnimatedEmotesComponent component, ProtoId<EmotePrototype> prot)
{
component.Emote = prot;
Dirty(uid, component);
}
}
4 changes: 4 additions & 0 deletions Content.Shared/Chat/Prototypes/EmotePrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public sealed partial class EmotePrototype : IPrototype
/// </summary>
[DataField]
public HashSet<string> ChatTriggers = new();

// goob edit - animations
[DataField]
public object? Event = null;
}

/// <summary>
Expand Down
28 changes: 28 additions & 0 deletions Content.Shared/_Goobstation/Emoting/AnimatedEmotesComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Content.Shared.Chat.Prototypes;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;

namespace Content.Shared.Emoting;

// use as a template
//[Serializable, NetSerializable, DataDefinition] public sealed partial class AnimationNameEmoteEvent : EntityEventArgs { }

[Serializable, NetSerializable, DataDefinition] public sealed partial class AnimationFlipEmoteEvent : EntityEventArgs { }
[Serializable, NetSerializable, DataDefinition] public sealed partial class AnimationSpinEmoteEvent : EntityEventArgs { }
[Serializable, NetSerializable, DataDefinition] public sealed partial class AnimationJumpEmoteEvent : EntityEventArgs { }

[RegisterComponent, NetworkedComponent] public sealed partial class AnimatedEmotesComponent : Component
{
[DataField] public ProtoId<EmotePrototype>? Emote;
}

[Serializable, NetSerializable] public sealed partial class AnimatedEmotesComponentState : ComponentState
{
public ProtoId<EmotePrototype>? Emote;

public AnimatedEmotesComponentState(ProtoId<EmotePrototype>? emote)
{
Emote = emote;
}
}
18 changes: 18 additions & 0 deletions Content.Shared/_Goobstation/Emoting/SharedAnimatedEmotesSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Robust.Shared.GameStates;

namespace Content.Shared.Emoting;

public abstract class SharedAnimatedEmotesSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<AnimatedEmotesComponent, ComponentGetState>(OnGetState);
}

private void OnGetState(Entity<AnimatedEmotesComponent> ent, ref ComponentGetState args)
{
args.State = new AnimatedEmotesComponentState(ent.Comp.Emote);
}
}
4 changes: 2 additions & 2 deletions Content.Shared/_Goobstation/Standing/LayingDownComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ namespace Content.Shared._Goobstation.Standing;
public sealed partial class LayingDownComponent : Component
{
[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public float StandingUpTime { get; set; } = 1f;
public float StandingUpTime { get; set; } = 1.25f;

[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public float SpeedModify { get; set; } = .25f;
public float SpeedModify { get; set; } = .19f;

[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public bool AutoGetUp;
Expand Down
116 changes: 81 additions & 35 deletions Resources/Changelog/Impstation.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,4 @@
Entries:
- author: joelsgp
changes:
- message: Add custom logo, icons, and loading tips
type: Add
id: 11
time: '2024-07-01T23:22:47.0000000+00:00'
url: https://github.com/medabunny/imp-station-14/pull/13
- author: TGRCDev
changes:
- message: Pets can now smoke
type: Add
id: 12
time: '2024-07-08T16:51:26.0000000+00:00'
url: https://github.com/medabunny/imp-station-14/pull/14
- author: joelsgp
changes:
- message: Add new logo and more loading tips
type: Add
id: 13
time: '2024-07-02T20:39:11.0000000+00:00'
url: https://github.com/medabunny/imp-station-14/pull/15
- author: LucasTheDrgn
changes:
- message: Forever Weed Brownies
type: Add
id: 14
time: '2024-07-03T15:39:30.0000000+00:00'
url: https://github.com/medabunny/imp-station-14/pull/16
- author: joelsgp
changes:
- message: Newports (sprites by Arch)
type: Add
id: 15
time: '2024-07-03T15:39:46.0000000+00:00'
url: https://github.com/medabunny/imp-station-14/pull/17
- author: joelsgp
changes:
- message: Finfin foods
Expand Down Expand Up @@ -4173,3 +4138,84 @@
id: 510
time: '2024-11-14T05:52:08.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/696
- author: EpicToast
changes:
- message: 'Made a bunch of miscellaneous updates and fixes for Union Station:'
type: Fix
- message: Made some layout changes.
type: Tweak
- message: Filled the Research Director's locker.
type: Tweak
- message: Fixed the slot count for paramedics, atmospheric technicians, salvage
specialists, and others.
type: Tweak
- message: Added a command-only area to the tech vault.
type: Add
- message: Gave every department extra resources.
type: Add
- message: Gave chemistry, salvage, atmos and robotics some extra utilities they
were missing.
type: Add
- message: Gave the captain their captain's thoughts, spare ID and flask.
type: Add
- message: Added more decals.
type: Add
- message: Added the pleasure pig.
type: Add
- message: And much more.
type: Tweak
id: 511
time: '2024-11-14T22:40:35.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/706
- author: DinnerCalzone
changes:
- message: (Hummingbird) Added a map beacon to the storage area in the shooting
range.
type: Add
- message: (Hummingbird) Added biohazard suit closets to virology and sec storage
area.
type: Add
- message: (Hummingbird) Added emergency wall closet and fire-safety wall closet
to sec storage area.
type: Add
- message: (Hummingbird) Added wall shelves to the kitchen and bar.
type: Add
- message: (Hummingbird) Added HoS's and Captain's flasks to their quarters.
type: Add
- message: (Hummingbird) Added a containment zone to keep a dark entity at bay.
type: Add
- message: (Hummingbird) Added a few more disposals chutes around the map.
type: Add
- message: (Hummingbird) You can now have a lollipop for being so brave at the doctor's.
type: Add
- message: (Hummingbird) Replaced a number of ore and asteroid rocks with bananium
ore rocks. Treat your clowns.
type: Tweak
- message: (Hummingbird) Made evac lounge narrower and fixed LV cabling.
type: Tweak
id: 512
time: '2024-11-14T22:43:50.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/707
- author: AirFryerBuyOneGetOneFree
changes:
- message: 'Added three animated emotes: flipping, spinning, and jumping!!'
type: Add
id: 513
time: '2024-11-14T22:47:21.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/704
- author: Darkmajia
changes:
- message: Quick construction radial menus work with more materials.
type: Add
- message: Uranium directional windows are now in the construction menu.
type: Add
id: 514
time: '2024-11-14T22:57:07.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/683
- author: AirFryerBuyOneGetOneFree
changes:
- message: Changed crawling and stand up speed to be slower overall.
type: Tweak
id: 515
time: '2024-11-14T23:02:55.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/711
7 changes: 7 additions & 0 deletions Resources/Locale/en-US/_Goobstation/emotes.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
chat-emote-name-flip = Do a flip
chat-emote-name-spin = Spin
chat-emote-name-jump = Jump
chat-emote-msg-flip = does a flip!
chat-emote-msg-spin = spins!
chat-emote-msg-jump = jumps!
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ui-options-function-auto-get-up = Automatically get up after falling
ui-options-function-toggle-standing = Toggle Standing or Laying
4 changes: 2 additions & 2 deletions Resources/Locale/en-US/escape-menu/ui/options-menu.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ ui-options-interface-label = Interface
ui-options-auto-fill-highlights = Auto-fill the highlights with the character's information
ui-options-highlights-color = Highlighs color:
ui-options-highlights-color-example = This is an highlighted text.
ui-options-highlights-color = Highlights color:
ui-options-highlights-color-example = This is some highlighted text.
ui-options-show-held-item = Show held item next to cursor
ui-options-show-combat-mode-indicators = Show combat mode indicators with cursor
ui-options-opaque-storage-window = Opaque storage window
Expand Down
Loading

0 comments on commit 35f1515

Please sign in to comment.