Skip to content

Commit

Permalink
Merge pull request SS14-Classic#85 from SS14-Classic/chirp
Browse files Browse the repository at this point in the history
Fix Harpy Singing
  • Loading branch information
VMSolidus authored Oct 15, 2024
2 parents 0c35d9a + 3ab5731 commit 5a7341b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Content.Shared/Traits/Assorted/Components/SingerComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ public sealed partial class SingerComponent : Component
[DataField(required: true), AutoNetworkedField]
public ProtoId<SingerInstrumentPrototype> Proto = string.Empty;

[DataField(serverOnly: true)]
public EntProtoId? MidiActionId = "ActionHarpyPlayMidi";

[DataField(serverOnly: true)]
public EntityUid? MidiAction;
}
7 changes: 1 addition & 6 deletions Content.Shared/Traits/Assorted/Systems/SharedSingerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,12 @@ private void OnStartup(Entity<SingerComponent> ent, ref ComponentStartup args)
if (!ProtoMan.TryIndex(ent.Comp.Proto, out var singer))
return;

_actionsSystem.AddAction(ent, ref ent.Comp.MidiAction, singer.MidiActionId);
_actionsSystem.AddAction(ent, ref ent.Comp.MidiAction, ent.Comp.MidiActionId);

var instrumentComp = EnsureInstrumentComp(ent);
var defaultData = singer.InstrumentList[singer.DefaultInstrument];
_instrument.SetInstrumentProgram(instrumentComp, defaultData.Item1, defaultData.Item2);
SetUpSwappableInstrument(ent, singer);

EntityManager.TryGetComponent<UserInterfaceComponent>(ent.Owner, out var comp);
var entui = new Entity<UserInterfaceComponent?>(ent.Owner, comp);
if (singer.MidiUi is { } uiKey && !_ui.IsUiOpen(entui, uiKey))
_ui.OpenUi(entui, uiKey, entui);
}

private void OnShutdown(Entity<SingerComponent> ent, ref ComponentShutdown args)
Expand Down
7 changes: 6 additions & 1 deletion Resources/Prototypes/Entities/Mobs/Species/harpy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@
- Shard
- Landmine
- Mousetrap
- type: UserInterface
interfaces:
enum.InstrumentUiKey.Key:
type: InstrumentBoundUserInterface
requireInputValidation: false

- type: entity
save: false
Expand Down Expand Up @@ -218,4 +223,4 @@
checkCanInteract: false
icon: { sprite: Interface/Actions/flight.rsi, state: flight_off }
iconOn: { sprite : Interface/Actions/flight.rsi, state: flight_on }
event: !type:ToggleFlightEvent
event: !type:ToggleFlightEvent

0 comments on commit 5a7341b

Please sign in to comment.