Files
OldThink/Content.Shared/Examine/GroupExamineComponent.cs
Jabak f9c1f13d16 что делать что делать муравью хуй приделать (#155)
* Локализация (#746)

* Правка мелочей

* Имя клоуну

* Перевод оповещений для РНД

* перевод занавесок

* перевод столов

* Перевод и обновление кода гипоспрея для боргов (#745)

* Я только хотел перевести...

* refactor

* ещё перевод

* Revert "refactor"

This reverts commit 355c2724c4ed9cd1357661e3ba889a88bdf17db7.

* инверсия условия для проверки наличия прототипа

* Больше вещей в пояса охраны (#748)

* Подкрутки и докрутки (#749)

* Добавил отображение защиты от горения и подправил описание защиты от взрывов (#747)

* Добавил отображение защиты от горения

* Update Content.Shared/Clothing/EntitySystems/FireProtectionSystem.cs

Co-authored-by: ThereDrD <88589686+ThereDrD0@users.noreply.github.com>

* Update Resources/Locale/ru-RU/_white/info/fire-protection.ftl

Co-authored-by: ThereDrD <88589686+ThereDrD0@users.noreply.github.com>

* Правки

* негативный ноль с плавающей точкой

---------

Co-authored-by: ThereDrD <88589686+ThereDrD0@users.noreply.github.com>

* Фикс текстурок внешних шлюзов (#751)

* Микромелочь

* Ещё одна мелочь

* Починка прозрачности

* Ребаланс РНД (#750)

* Третий тир больше нас не остановит

* More less

* Ребаланс

* правочки подправочки

* СКОРАЯ!!! ПОМОГИТЕ!!!

* Конфета или жизнь (#757)

* Конфета или жизнь

* gremlins invasion

* Я ДОБАВИЛ БОЛЬШЕ МУСОРА НА СТАНЦИЮ!!!

* Переводы (много) (#755)

* Перевод технологий РНД

* Перевод действий поглаживающего характера

* Целая куча мелочей

* Ещё больше мелочей

* Слишком много мелочей

* маленькая мелочь

* unshit some ftl shit

* [Tweak] Random updates (#760)

* Security random updates

* Engineering random updates

* ERT random updates

* Really random

* Important random update

---------

Co-authored-by: BIGZi0348 <118811750+BIGZi0348@users.noreply.github.com>
Co-authored-by: ThereDrD <88589686+ThereDrD0@users.noreply.github.com>
Co-authored-by: keslik <114428094+keslik1313@users.noreply.github.com>
2024-10-31 18:00:47 +03:00

115 lines
3.5 KiB
C#

using Robust.Shared.Serialization;
using Robust.Shared.Utility;
namespace Content.Shared.Examine
{
/// <summary>
/// This component groups examine messages together
/// </summary>
[RegisterComponent]
public sealed partial class GroupExamineComponent : Component
{
/// <summary>
/// A list of ExamineGroups.
/// </summary>
[DataField]
public List<ExamineGroup> Group = new()
{
// TODO Remove hardcoded component names.
new ExamineGroup()
{
Components = new()
{
"Armor",
"ClothingSpeedModifier",
"FireProtection" // WD
},
},
};
}
[DataDefinition]
public sealed partial class ExamineGroup
{
/// <summary>
/// The title of the Examine Group. Localized string that gets added to the examine tooltip.
/// </summary>
[DataField]
[ViewVariables(VVAccess.ReadWrite)]
public string? Title;
/// <summary>
/// A list of ExamineEntries, containing which component it belongs to, which priority it has, and what FormattedMessage it holds.
/// </summary>
[DataField]
public List<ExamineEntry> Entries = new();
// TODO custom type serializer, or just make this work via some other automatic grouping process that doesn't
// rely on manually specifying component names in yaml.
/// <summary>
/// A list of all components this ExamineGroup encompasses.
/// </summary>
[DataField]
public List<string> Components = new();
/// <summary>
/// The icon path for the Examine Group.
/// </summary>
[DataField]
public SpriteSpecifier Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/examine-star.png"));
/// <summary>
/// The text shown in the context verb menu.
/// </summary>
[DataField]
public LocId ContextText = "verb-examine-group-other";
/// <summary>
/// Details shown when hovering over the button.
/// </summary>
[DataField]
public string HoverMessage = string.Empty;
}
/// <summary>
/// An entry used when showing examine details
/// </summary>
[Serializable, NetSerializable, DataDefinition]
public sealed partial class ExamineEntry
{
/// <summary>
/// Which component does this entry relate to?
/// </summary>
[DataField(required: true)]
public string Component;
/// <summary>
/// What priority has this entry - entries are sorted high to low.
/// </summary>
[DataField]
public float Priority = 0f;
/// <summary>
/// The FormattedMessage of this entry.
/// </summary>
[DataField(required: true)]
public FormattedMessage Message;
/// <param name="component">Should be set to _componentFactory.GetComponentName(component.GetType()) to properly function.</param>
public ExamineEntry(string component, float priority, FormattedMessage message)
{
Component = component;
Priority = priority;
Message = message;
}
private ExamineEntry()
{
// parameterless ctor is required for data-definition serialization
Message = default!;
Component = default!;
}
}
}