fish-station/Content.Shared/_Sunrise/CartridgeLoader/Cartridges/PhotoCartridgeComponent.cs

65 lines
2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Robust.Shared.Serialization;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
namespace Content.Shared._Sunrise.CartridgeLoader.Cartridges;
/// <summary>
/// Компонент фото-картриджа для КПК
/// </summary>
[RegisterComponent]
public sealed partial class PhotoCartridgeComponent : Component
{
/// <summary>
/// Галерея фотографий пользователя (PhotoId -> PhotoMetadata)
/// </summary>
[ViewVariables]
public Dictionary<string, PhotoMetadata> PhotoGallery = new();
/// <summary>
/// Звук срабатывания затвора
/// </summary>
[DataField]
public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/_Sunrise/camera_shot.ogg");
/// <summary>
/// Эффект вспышки
/// </summary>
[DataField]
public EntProtoId FlashEffect = "PhotoFlashEffect";
/// <summary>
/// Включена ли вспышка (пользовательская настройка)
/// </summary>
[DataField]
public bool FlashEnabled = true;
}
/// <summary>
/// Метаданные фотографии в галерее
/// </summary>
[Serializable, NetSerializable]
public sealed class PhotoMetadata
{
/// <summary>
/// Уникальный идентификатор фотографии (GUID)
/// </summary>
public string PhotoId { get; set; }
/// <summary>
/// Путь к сетевому ресурсу изображения (например, "/NetTextures/Messenger/photo_123.png")
/// </summary>
public string ImagePath { get; set; }
/// <summary>
/// Время создания фотографии (относительно начала раунда)
/// </summary>
public TimeSpan Timestamp { get; set; }
public PhotoMetadata(string photoId, string imagePath, TimeSpan timestamp)
{
PhotoId = photoId;
ImagePath = imagePath;
Timestamp = timestamp;
}
}