This commit is contained in:
Aviu00
2024-01-13 12:24:00 +03:00
parent b39320ad30
commit b40f935571
22 changed files with 93 additions and 80 deletions

View File

@@ -1,4 +1,4 @@
using Content.Client.Ghost; using Content.Shared.Ghost;
using Content.Shared.White.CustomGhostSystem; using Content.Shared.White.CustomGhostSystem;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;

View File

@@ -11,16 +11,14 @@ public sealed class JukeboxBUI : BoundUserInterface
private readonly SharedPopupSystem _sharedPopupSystem = default!; private readonly SharedPopupSystem _sharedPopupSystem = default!;
private JukeboxMenu? _window; private JukeboxMenu? _window;
public JukeboxBUI(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey) public JukeboxBUI(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{ {
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
_sharedPopupSystem = _entityManager.System<SharedPopupSystem>(); _sharedPopupSystem = _entityManager.System<SharedPopupSystem>();
var uid = owner.Owner; if (!_entityManager.TryGetComponent(owner, out JukeboxComponent? jukeboxComponent))
if (!_entityManager.TryGetComponent<JukeboxComponent>(uid, out var jukeboxComponent))
{ {
_sharedPopupSystem.PopupEntity($"Тут нет JukeboxComponent, звоните кодерам", uid); _sharedPopupSystem.PopupEntity($"Тут нет JukeboxComponent, звоните кодерам", owner);
return; return;
} }

View File

@@ -5,7 +5,6 @@ using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;
using Robust.Shared.Timing; using Robust.Shared.Timing;
using TerraFX.Interop.Windows;
namespace Content.Client.White.Jukebox; namespace Content.Client.White.Jukebox;

View File

@@ -10,6 +10,8 @@ using Robust.Client.Physics;
using Robust.Client.Player; using Robust.Client.Player;
using Robust.Client.ResourceManagement; using Robust.Client.ResourceManagement;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Audio.Components;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration; using Robust.Shared.Configuration;
using Robust.Shared.ContentPack; using Robust.Shared.ContentPack;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
@@ -67,18 +69,18 @@ public sealed class JukeboxSystem : EntitySystem
private void OnComponentRemoved(EntityUid uid, JukeboxComponent component, ComponentRemove args) private void OnComponentRemoved(EntityUid uid, JukeboxComponent component, ComponentRemove args)
{ {
if (!_playingJukeboxes.TryGetValue(component, out var playingData)) return; if (!_playingJukeboxes.TryGetValue(component, out var playingData)) return;
playingData.PlayingStream.Stop(); _audioSystem.Stop(playingData.PlayingStream, playingData.Component);
_playingJukeboxes.Remove(component); _playingJukeboxes.Remove(component);
} }
private void OnStopPlaying(JukeboxStopPlaying ev) private void OnStopPlaying(JukeboxStopPlaying ev)
{ {
if (!ev.JukeboxUid.HasValue) return; if (!ev.JukeboxUid.HasValue) return;
if(!TryComp<JukeboxComponent>(ev.JukeboxUid, out var jukeboxComponent)) return; if(!TryComp<JukeboxComponent>(GetEntity(ev.JukeboxUid), out var jukeboxComponent)) return;
if(!_playingJukeboxes.TryGetValue(jukeboxComponent, out var jukeboxAudio)) return; if(!_playingJukeboxes.TryGetValue(jukeboxComponent, out var jukeboxAudio)) return;
jukeboxAudio.PlayingStream.Stop(); _audioSystem.Stop(jukeboxAudio.PlayingStream, jukeboxAudio.Component);
_playingJukeboxes.Remove(jukeboxComponent); _playingJukeboxes.Remove(jukeboxComponent);
} }
@@ -91,7 +93,7 @@ public sealed class JukeboxSystem : EntitySystem
RaiseNetworkEvent(new JukeboxRequestSongPlay() RaiseNetworkEvent(new JukeboxRequestSongPlay()
{ {
Jukebox = component.Owner, Jukebox = GetNetEntity(component.Owner),
SongName = jukeboxSong.SongName, SongName = jukeboxSong.SongName,
SongPath = jukeboxSong.SongPath, SongPath = jukeboxSong.SongPath,
SongDuration = (float)songResource.AudioStream.Length.TotalSeconds SongDuration = (float)songResource.AudioStream.Length.TotalSeconds
@@ -128,11 +130,11 @@ public sealed class JukeboxSystem : EntitySystem
{ {
if(jukeboxXform.MapID != playerXform.MapID) continue; if(jukeboxXform.MapID != playerXform.MapID) continue;
if ((jukeboxXform.MapPosition.Position - playerXform.MapPosition.Position).Length > _maxAudioRange) continue; if ((jukeboxXform.MapPosition.Position - playerXform.MapPosition.Position).Length() > _maxAudioRange) continue;
if (_playingJukeboxes.TryGetValue(jukeboxComponent, out var jukeboxAudio)) if (_playingJukeboxes.TryGetValue(jukeboxComponent, out var jukeboxAudio))
{ {
if (jukeboxAudio.PlayingStream.Done) if (!jukeboxAudio.Component.Playing)
{ {
HandleDoneStream(jukeboxAudio, jukeboxComponent); HandleDoneStream(jukeboxAudio, jukeboxComponent);
return; return;
@@ -167,7 +169,7 @@ public sealed class JukeboxSystem : EntitySystem
private void HandleSongChanged(JukeboxAudio jukeboxAudio, JukeboxComponent jukeboxComponent) private void HandleSongChanged(JukeboxAudio jukeboxAudio, JukeboxComponent jukeboxComponent)
{ {
jukeboxAudio.PlayingStream.Stop(); _audioSystem.Stop(jukeboxAudio.PlayingStream, jukeboxAudio.Component);
if (jukeboxComponent.PlayingSongData != null && jukeboxComponent.PlayingSongData.SongPath == jukeboxAudio.SongData.SongPath) if (jukeboxComponent.PlayingSongData != null && jukeboxComponent.PlayingSongData.SongPath == jukeboxAudio.SongData.SongPath)
{ {
@@ -188,7 +190,7 @@ public sealed class JukeboxSystem : EntitySystem
{ {
if (!jukeboxComponent.Repeating) if (!jukeboxComponent.Repeating)
{ {
jukeboxAudio.PlayingStream.Stop(); _audioSystem.Stop(jukeboxAudio.PlayingStream, jukeboxAudio.Component);
_playingJukeboxes.Remove(jukeboxComponent); _playingJukeboxes.Remove(jukeboxComponent);
SetBarsLayerVisible(jukeboxComponent, false); SetBarsLayerVisible(jukeboxComponent, false);
return; return;
@@ -234,25 +236,22 @@ public sealed class JukeboxSystem : EntitySystem
MaxDistance = _maxAudioRange MaxDistance = _maxAudioRange
}; };
AudioSystem.PlayingStream? playingStream = null!; var playingStream = _audioSystem.PlayEntity(resourcePath.ToString()!, localSession, jukeboxComponent.Owner, audioParams);
playingStream = _audioSystem.PlayEntity(resourcePath.ToString()!, localSession, jukeboxComponent.Owner, audioParams) as AudioSystem.PlayingStream; return new JukeboxAudio(playingStream.Value.Entity, playingStream.Value.Component, audio!, jukeboxComponent.PlayingSongData);
if (playingStream == null)
return null!;
return new JukeboxAudio(playingStream, audio!, jukeboxComponent.PlayingSongData);
} }
private class JukeboxAudio private class JukeboxAudio
{ {
public PlayingSongData SongData { get; } public PlayingSongData SongData { get; }
public AudioSystem.PlayingStream PlayingStream { get; } public EntityUid PlayingStream { get; }
public AudioComponent Component { get; }
public AudioResource AudioStream { get; } public AudioResource AudioStream { get; }
public JukeboxAudio(AudioSystem.PlayingStream playingStream, AudioResource audioStream, PlayingSongData songData) public JukeboxAudio(EntityUid playingStream, AudioComponent component, AudioResource audioStream, PlayingSongData songData)
{ {
PlayingStream = playingStream; PlayingStream = playingStream;
Component = component;
AudioStream = audioStream; AudioStream = audioStream;
SongData = songData; SongData = songData;
} }
@@ -269,7 +268,7 @@ public sealed class JukeboxSystem : EntitySystem
{ {
foreach (var playingJukebox in _playingJukeboxes.Values) foreach (var playingJukebox in _playingJukeboxes.Values)
{ {
playingJukebox.PlayingStream.Stop(); _audioSystem.Stop(playingJukebox.PlayingStream, playingJukebox.Component);
} }
_playingJukeboxes.Clear(); _playingJukeboxes.Clear();

View File

@@ -11,16 +11,14 @@ public sealed class TapeCreatorBUI : BoundUserInterface
private TapeCreatorMenu? _window; private TapeCreatorMenu? _window;
public TapeCreatorBUI(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey) public TapeCreatorBUI(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{ {
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
_sharedPopupSystem = _entityManager.System<SharedPopupSystem>(); _sharedPopupSystem = _entityManager.System<SharedPopupSystem>();
var uid = owner.Owner; if (!_entityManager.TryGetComponent<TapeCreatorComponent>(owner, out var tapeCreatorComponent))
if (!_entityManager.TryGetComponent<TapeCreatorComponent>(uid, out var tapeCreatorComponent))
{ {
_sharedPopupSystem.PopupEntity($"Тут нет TapeCreatorComponent, звоните кодерам", uid); _sharedPopupSystem.PopupEntity($"Тут нет TapeCreatorComponent, звоните кодерам", owner);
return; return;
} }

View File

@@ -67,7 +67,7 @@ public sealed partial class TapeCreatorMenu : DefaultWindow
{ {
SongName = songName, SongName = songName,
SongBytes = songBytes, SongBytes = songBytes,
TapeCreatorUid = _component.Owner TapeCreatorUid = _entityManager.GetNetEntity(_component.Owner)
}; };
_huetaSystem.SendNetMessage(msg); _huetaSystem.SendNetMessage(msg);

View File

@@ -227,7 +227,7 @@ public sealed partial class StoreSystem
UpdateUserInterface(buyer, uid, component); UpdateUserInterface(buyer, uid, component);
} }
public void CloseSessionUi(EntityUid user, StoreComponent component) public void CloseUi(EntityUid user, StoreComponent component)
{ {
if (!TryComp<ActorComponent>(user, out var actor)) if (!TryComp<ActorComponent>(user, out var actor))
return; return;

View File

@@ -1,7 +1,9 @@
using Content.Server.Ghost.Components; using Content.Server.Ghost.Components;
using Content.Shared.Ghost;
using Content.Shared.White.CustomGhostSystem; using Content.Shared.White.CustomGhostSystem;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Server.Player; using Robust.Server.Player;
using Robust.Shared.Player;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
namespace Content.Server.White.CustomGhostSpriteSystem; namespace Content.Server.White.CustomGhostSpriteSystem;
@@ -11,6 +13,7 @@ public sealed class CustomGhostSpriteSystem : EntitySystem
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!; [Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly MetaDataSystem _metaData = default!;
public override void Initialize() public override void Initialize()
@@ -45,12 +48,12 @@ public sealed class CustomGhostSpriteSystem : EntitySystem
if (customGhostPrototype.GhostName != string.Empty) if (customGhostPrototype.GhostName != string.Empty)
{ {
MetaData(ghostUid).EntityName = customGhostPrototype.GhostName; _metaData.SetEntityName(ghostUid, customGhostPrototype.GhostName);
} }
if (customGhostPrototype.GhostDescription != string.Empty) if (customGhostPrototype.GhostDescription != string.Empty)
{ {
MetaData(ghostUid).EntityDescription = customGhostPrototype.GhostDescription; _metaData.SetEntityDescription(ghostUid, customGhostPrototype.GhostDescription);
} }
return; return;

View File

@@ -4,6 +4,7 @@ using Content.Shared.Hands.EntitySystems;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Verbs; using Content.Shared.Verbs;
using Content.Shared.White.Jukebox; using Content.Shared.White.Jukebox;
using Robust.Server.Audio;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Server.GameStates; using Robust.Server.GameStates;
using Robust.Shared.Containers; using Robust.Shared.Containers;
@@ -21,7 +22,7 @@ public sealed class JukeboxSystem : EntitySystem
[Dependency] private readonly SharedContainerSystem _containerSystem = default!; [Dependency] private readonly SharedContainerSystem _containerSystem = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!; [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly PVSOverrideSystem _pvsOverrideSystem = default!; [Dependency] private readonly PvsOverrideSystem _pvsOverrideSystem = default!;
private readonly List<JukeboxComponent> _playingJukeboxes = new(); private readonly List<JukeboxComponent> _playingJukeboxes = new();
@@ -132,7 +133,7 @@ public sealed class JukeboxSystem : EntitySystem
private void OnSongRequestPlay(JukeboxRequestSongPlay msg, EntitySessionEventArgs args) private void OnSongRequestPlay(JukeboxRequestSongPlay msg, EntitySessionEventArgs args)
{ {
var jukebox = Comp<JukeboxComponent>(msg.Jukebox!.Value); var jukebox = Comp<JukeboxComponent>(GetEntity(msg.Jukebox!.Value));
jukebox.Repeating = true; jukebox.Repeating = true;
var songData = new PlayingSongData() var songData = new PlayingSongData()

View File

@@ -113,7 +113,7 @@ public sealed class TapeCreatorSystem : EntitySystem
component.TapeContainer.Insert(args.Used); component.TapeContainer.Insert(args.Used);
} }
component.InsertedTape = tape.Owner; component.InsertedTape = GetNetEntity(tape.Owner);
Dirty(component); Dirty(component);
return; return;
} }
@@ -130,7 +130,7 @@ public sealed class TapeCreatorSystem : EntitySystem
private void OnSongUploaded(JukeboxSongUploadRequest ev) private void OnSongUploaded(JukeboxSongUploadRequest ev)
{ {
if(!TryComp<TapeCreatorComponent>(ev.TapeCreatorUid, out var tapeCreatorComponent)) return; if(!TryComp<TapeCreatorComponent>(GetEntity(ev.TapeCreatorUid), out var tapeCreatorComponent)) return;
if (!tapeCreatorComponent.InsertedTape.HasValue || tapeCreatorComponent.CoinBalance <= 0) if (!tapeCreatorComponent.InsertedTape.HasValue || tapeCreatorComponent.CoinBalance <= 0)
{ {
@@ -141,7 +141,7 @@ public sealed class TapeCreatorSystem : EntitySystem
tapeCreatorComponent.CoinBalance -= 1; tapeCreatorComponent.CoinBalance -= 1;
tapeCreatorComponent.Recording = true; tapeCreatorComponent.Recording = true;
var tapeComponent = Comp<TapeComponent>(tapeCreatorComponent.InsertedTape.Value); var tapeComponent = Comp<TapeComponent>(GetEntity(tapeCreatorComponent.InsertedTape.Value));
var songData = _songsSyncManager.SyncSongData(ev.SongName, ev.SongBytes); var songData = _songsSyncManager.SyncSongData(ev.SongName, ev.SongBytes);
var song = new JukeboxSong() var song = new JukeboxSong()
@@ -152,7 +152,7 @@ public sealed class TapeCreatorSystem : EntitySystem
tapeComponent.Songs.Add(song); tapeComponent.Songs.Add(song);
_popupSystem.PopupEntity($"Запись началась, примерное время ожидания: {_recordTime} секунд", tapeCreatorComponent.Owner); _popupSystem.PopupEntity($"Запись началась, примерное время ожидания: {_recordTime} секунд", tapeCreatorComponent.Owner);
Dirty(ev.TapeCreatorUid); DirtyEntity(GetEntity(ev.TapeCreatorUid));
Dirty(tapeComponent); Dirty(tapeComponent);
StartRecordDelayAsync(tapeCreatorComponent, _popupSystem, _containerSystem); StartRecordDelayAsync(tapeCreatorComponent, _popupSystem, _containerSystem);
} }

View File

@@ -60,7 +60,11 @@ public sealed class LoadoutSystem : EntitySystem
// Automatically search empty slot for clothes to equip // Automatically search empty slot for clothes to equip
string? firstSlotName = null; string? firstSlotName = null;
bool isEquiped = false; bool isEquiped = false;
foreach (var slot in _inventorySystem.GetSlots(ev.Mob))
if (!_inventorySystem.TryGetSlots(ev.Mob, out var slots))
continue;
foreach (var slot in slots)
{ {
if (!clothing.Slots.HasFlag(slot.SlotFlags)) if (!clothing.Slots.HasFlag(slot.SlotFlags))
continue; continue;
@@ -87,7 +91,7 @@ public sealed class LoadoutSystem : EntitySystem
_inventorySystem.TryGetSlotEntity(ev.Mob, BackpackSlotId, out var backEntity) && _inventorySystem.TryGetSlotEntity(ev.Mob, BackpackSlotId, out var backEntity) &&
_storageSystem.CanInsert(backEntity.Value, slotEntity.Value, out _)) _storageSystem.CanInsert(backEntity.Value, slotEntity.Value, out _))
{ {
_storageSystem.Insert(backEntity.Value, slotEntity.Value); _storageSystem.Insert(backEntity.Value, slotEntity.Value, out _);
} }
_inventorySystem.TryEquip(ev.Mob, entity, firstSlotName, true); _inventorySystem.TryEquip(ev.Mob, entity, firstSlotName, true);
} }

View File

@@ -107,7 +107,7 @@ public sealed class MeatyOreStoreSystem : EntitySystem
var playerEntity = session.AttachedEntity; var playerEntity = session.AttachedEntity;
if(!playerEntity.HasValue) continue; if(!playerEntity.HasValue) continue;
_storeSystem.CloseSessionUi(playerEntity.Value, meatyOreStoreData.Value); _storeSystem.CloseUi(playerEntity.Value, meatyOreStoreData.Value);
} }
} }
MeatyOrePanelEnabled = newValue; MeatyOrePanelEnabled = newValue;

View File

@@ -1,6 +1,6 @@
namespace Content.Server.White.Other.EnergySword; namespace Content.Server.White.Other.EnergySword;
[RegisterComponent] [RegisterComponent]
public sealed class DoubleSwordCraftComponent : Component public sealed partial class DoubleSwordCraftComponent : Component
{ {
} }

View File

@@ -1,16 +1,13 @@
using Content.Shared.Actions.ActionTypes; using Robust.Shared.Prototypes;
using Robust.Shared.Utility; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.White.Other.Lazy; namespace Content.Server.White.Other.Lazy;
[RegisterComponent] [RegisterComponent]
public sealed class EarsSpawnComponent : Component public sealed partial class EarsSpawnComponent : Component
{ {
[DataField("summonAction")] public InstantAction SummonAction = new() [DataField("summonAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
{ public string SummonAction = "ActionEarsSummon";
Icon = new SpriteSpecifier.Texture(new ResPath("Clothing/Head/Hats/witch.rsi/icon.png")),
DisplayName = "summon cat ears", [DataField("summonActionEntity")] public EntityUid? SummonActionEntity;
Description = "meow!",
Event = new SummonActionEarsEvent()
};
} }

View File

@@ -3,7 +3,9 @@ using Content.Shared.Actions;
using Content.Shared.Hands.EntitySystems; using Content.Shared.Hands.EntitySystems;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Verbs; using Content.Shared.Verbs;
using Content.Shared.White.Events;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Player;
namespace Content.Server.White.Other.Lazy; namespace Content.Server.White.Other.Lazy;
@@ -79,10 +81,6 @@ public sealed class EarsSpawnSystem : EntitySystem
private static void GetSummonAction(EntityUid uid, EarsSpawnComponent component, GetItemActionsEvent args) private static void GetSummonAction(EntityUid uid, EarsSpawnComponent component, GetItemActionsEvent args)
{ {
args.Actions.Add(component.SummonAction); args.AddAction(ref component.SummonActionEntity, component.SummonAction);
} }
} }
public sealed class SummonActionEarsEvent : InstantActionEvent
{
}

View File

@@ -1,8 +1,10 @@
using Content.Server.Chat.Systems; using Content.Server.Chat.Systems;
using Content.Server.Ghost.Components; using Content.Server.Ghost.Components;
using Content.Shared.Ghost;
using Content.Shared.Humanoid; using Content.Shared.Humanoid;
using Content.Shared.Mobs; using Content.Shared.Mobs;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Random; using Robust.Shared.Random;
namespace Content.Server.White.Other; namespace Content.Server.White.Other;
@@ -19,7 +21,7 @@ public sealed class OnDeath : EntitySystem
SubscribeLocalEvent<GhostComponent, ComponentInit>(OnGhosted); SubscribeLocalEvent<GhostComponent, ComponentInit>(OnGhosted);
} }
private readonly Dictionary<EntityUid, IPlayingAudioStream> _playingStreams = new(); private readonly Dictionary<EntityUid, EntityUid> _playingStreams = new();
private static readonly SoundSpecifier DeathSounds = new SoundCollectionSpecifier("deathSounds"); private static readonly SoundSpecifier DeathSounds = new SoundCollectionSpecifier("deathSounds");
private static readonly SoundSpecifier HeartSounds = new SoundCollectionSpecifier("heartSounds"); private static readonly SoundSpecifier HeartSounds = new SoundCollectionSpecifier("heartSounds");
private static readonly string[] DeathGaspMessages = private static readonly string[] DeathGaspMessages =
@@ -58,14 +60,11 @@ public sealed class OnDeath : EntitySystem
{ {
if (_playingStreams.TryGetValue(uid, out var currentStream)) if (_playingStreams.TryGetValue(uid, out var currentStream))
{ {
currentStream.Stop(); _audio.Stop(currentStream);
} }
var newStream = _audio.PlayEntity(HeartSounds, uid, uid, AudioParams.Default.WithLoop(true)); var newStream = _audio.PlayEntity(HeartSounds, uid, uid, AudioParams.Default.WithLoop(true));
if (newStream != null) _playingStreams[uid] = newStream.Value.Entity;
{
_playingStreams[uid] = newStream;
}
} }
@@ -73,7 +72,7 @@ public sealed class OnDeath : EntitySystem
{ {
if (_playingStreams.TryGetValue(uid, out var currentStream)) if (_playingStreams.TryGetValue(uid, out var currentStream))
{ {
currentStream.Stop(); _audio.Stop(currentStream);
_playingStreams.Remove(uid); _playingStreams.Remove(uid);
} }
} }
@@ -85,7 +84,7 @@ public sealed class OnDeath : EntitySystem
=> Loc.GetString(message); => Loc.GetString(message);
private void SendDeathGaspMessage(EntityUid uid, string message) private void SendDeathGaspMessage(EntityUid uid, string message)
=> _chat.TrySendInGameICMessage(uid, message, InGameICChatType.Emote, false, force: true); => _chat.TrySendInGameICMessage(uid, message, InGameICChatType.Emote, ChatTransmitRange.Normal, force: true);
private void PlayDeathSound(EntityUid uid) private void PlayDeathSound(EntityUid uid)
=> _audio.PlayEntity(DeathSounds, uid, uid, AudioParams.Default); => _audio.PlayEntity(DeathSounds, uid, uid, AudioParams.Default);

View File

@@ -0,0 +1,7 @@
using Content.Shared.Actions;
namespace Content.Shared.White.Events;
public sealed partial class SummonActionEarsEvent : InstantActionEvent
{
}

View File

@@ -22,7 +22,7 @@ public enum TapeCreatorUIKey : byte
} }
[NetworkedComponent, RegisterComponent] [NetworkedComponent, RegisterComponent]
public class JukeboxComponent : Component public sealed partial class JukeboxComponent : Component
{ {
public static string JukeboxContainerName = "jukebox_tapes"; public static string JukeboxContainerName = "jukebox_tapes";
@@ -46,7 +46,7 @@ public class JukeboxComponent : Component
public PlayingSongData? PlayingSongData { get; set; } public PlayingSongData? PlayingSongData { get; set; }
} }
public class TapeContainerComponent : Component public sealed partial class TapeContainerComponent : Component
{ {
public int MaxTapeCount = 1; public int MaxTapeCount = 1;
public Container TapeContainer { get; set; } = new(); public Container TapeContainer { get; set; } = new();
@@ -71,7 +71,7 @@ public class JukeboxComponentState : ComponentState
} }
[Serializable, NetSerializable, DataDefinition] [Serializable, NetSerializable, DataDefinition]
public class JukeboxSong public sealed partial class JukeboxSong
{ {
[DataField("songName")] [DataField("songName")]
public string? SongName; public string? SongName;
@@ -84,20 +84,20 @@ public class JukeboxRequestSongPlay : EntityEventArgs
{ {
public string? SongName { get; set; } public string? SongName { get; set; }
public ResPath? SongPath { get; set; } public ResPath? SongPath { get; set; }
public EntityUid? Jukebox { get; set; } public NetEntity? Jukebox { get; set; }
public float SongDuration { get; set; } public float SongDuration { get; set; }
} }
[Serializable, NetSerializable] [Serializable, NetSerializable]
public class JukeboxRequestStop : EntityEventArgs public class JukeboxRequestStop : EntityEventArgs
{ {
public EntityUid? JukeboxUid { get; set; } public NetEntity? JukeboxUid { get; set; }
} }
[Serializable, NetSerializable] [Serializable, NetSerializable]
public class JukeboxStopPlaying : EntityEventArgs public class JukeboxStopPlaying : EntityEventArgs
{ {
public EntityUid? JukeboxUid { get; set; } public NetEntity? JukeboxUid { get; set; }
} }
[Serializable, NetSerializable] [Serializable, NetSerializable]
@@ -105,7 +105,7 @@ public class JukeboxSongUploadRequest : EntityEventArgs
{ {
public string SongName = string.Empty; public string SongName = string.Empty;
public List<byte> SongBytes = new(); public List<byte> SongBytes = new();
public EntityUid TapeCreatorUid = default!; public NetEntity TapeCreatorUid = default!;
} }
public class JukeboxSongUploadNetMessage : NetMessage public class JukeboxSongUploadNetMessage : NetMessage

View File

@@ -4,14 +4,14 @@ using Robust.Shared.Serialization;
namespace Content.Shared.White.Jukebox; namespace Content.Shared.White.Jukebox;
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent]
public sealed class TapeComponent : Component public sealed partial class TapeComponent : Component
{ {
[DataField("songs")] [DataField("songs")]
public List<JukeboxSong> Songs { get; set; } = new(); public List<JukeboxSong> Songs { get; set; } = new();
} }
[Serializable, NetSerializable] [Serializable, NetSerializable]
public sealed class TapeComponentState : ComponentState public sealed partial class TapeComponentState : ComponentState
{ {
public List<JukeboxSong> Songs { get; set; } = new(); public List<JukeboxSong> Songs { get; set; } = new();
} }

View File

@@ -5,7 +5,7 @@ using Robust.Shared.Serialization;
namespace Content.Shared.White.Jukebox; namespace Content.Shared.White.Jukebox;
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent]
public sealed class TapeCreatorComponent : Component public sealed partial class TapeCreatorComponent : Component
{ {
[DataField("coins")] [DataField("coins")]
public int CoinBalance { get; set; } public int CoinBalance { get; set; }
@@ -14,7 +14,7 @@ public sealed class TapeCreatorComponent : Component
public bool Recording { get; set; } public bool Recording { get; set; }
[ViewVariables(VVAccess.ReadOnly)] [ViewVariables(VVAccess.ReadOnly)]
public EntityUid? InsertedTape { get; set; } public NetEntity? InsertedTape { get; set; }
[ViewVariables(VVAccess.ReadOnly)] [ViewVariables(VVAccess.ReadOnly)]
public Container TapeContainer { get; set; } = default!; public Container TapeContainer { get; set; } = default!;
@@ -25,5 +25,5 @@ public sealed class TapeCreatorComponentState : ComponentState
{ {
public int CoinBalance { get; set; } public int CoinBalance { get; set; }
public bool Recording { get; set; } public bool Recording { get; set; }
public EntityUid? InsertedTape { get; set; } public NetEntity? InsertedTape { get; set; }
} }

View File

@@ -25,7 +25,7 @@
underweart: ClothingUnderwearTopBraWhite # White-Underwear underweart: ClothingUnderwearTopBraWhite # White-Underwear
underwearb: ClothingUnderwearBottomPantiesWhite # White-Underwear underwearb: ClothingUnderwearBottomPantiesWhite # White-Underwear
inhand: inhand:
right hand: BriefcaseBrownFilled - BriefcaseBrownFilled
innerclothingskirt: ClothingUniformJumpskirtColorLightBrown innerclothingskirt: ClothingUniformJumpskirtColorLightBrown
satchel: ClothingBackpackSatchelLibrarianFilled satchel: ClothingBackpackSatchelLibrarianFilled
duffelbag: ClothingBackpackDuffelLibrarianFilled duffelbag: ClothingBackpackDuffelLibrarianFilled

View File

@@ -0,0 +1,10 @@
- type: entity
id: ActionEarsSummon
name: summon cat ears
description: meow!
noSpawn: true
components:
- type: InstantAction
icon: { sprite: Clothing/Head/Hats/witch.rsi, state: icon }
event: !type:SummonActionEarsEvent {}
useDelay: 1