* init * fax translate * translate * translate cargo panel * road map translate * Fix cargo panel | fix bot craft translate * fix, steal objectives translate * do not break my not localized fax! * fix * radio guide translate * Better DefaultRules * Translate Criminal Records * Space luw fully translate excluding CrimeList(need to rework) * Some Guidebook translate * Перевод глоссария, некоторые термины были переписанны под РУ комьюнити игры, некоторые к сожелению остались прежними * Fix * fix, translate * Обновил структуру SpeakOnUIClosed, пофиксил перевод автоматов * update and fix * fully translate * fix * not fail but warn * fix * fix2 * фикс уже переведённого дерьма от корвахов * Добавил термин подов в глоссарий * roles translate fix * Сикей в глоссарий * Delete Resources/Locale/ru-RU/_sunrise/info/character-info.ftl * remove cluster from pool * new translation * fully translate borgs * some fixes * Mr.Chang moment * upd * upd * upd * hotfix * big fix * fix some hardcode lang * oh no shitcode language * some translation * some actions| admin commands translate start * some new translation * fully translate commands | figurines | chat-repo * upd * second upd * upd * start translating items * some fixes * translate wackpack Из-за игры слов, я не смог нормально интерпритировать это дерьмо, так что пусть будет так, да теряется смысл и смешинка, но извините, я не смог как-то придумать игру слов * translate * debug translate * upd * Актуализация всего перевода * fix * fix * upd * some fixes | guns to his folders * upd * upd * upd * upd * upd * upd * Перевод меток атмоса * Последние коррективы * fix * some hardcode localization fix * fix * some fixes * stats entry fully translate * upd * some fixes * translate server side stats entry * fix * fix * fix2 * fix * upd * upd * fix * holly shit * fix * totaly feed * upd * upd * fix * upd * init * upd * upd * access in prototypes * Sunrise comments on code * my bad * я даун
71 lines
No EOL
2.8 KiB
C#
71 lines
No EOL
2.8 KiB
C#
using Content.Shared.Examine;
|
|
using Content.Shared.Tag;
|
|
using JetBrains.Annotations;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Utility;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
|
|
namespace Content.Shared.Construction.Steps
|
|
{
|
|
public abstract partial class ArbitraryInsertConstructionGraphStep : EntityInsertConstructionGraphStep
|
|
{
|
|
[DataField("name")] public string Name { get; private set; } = string.Empty;
|
|
|
|
[DataField("icon")] public SpriteSpecifier? Icon { get; private set; }
|
|
|
|
[DataField("tag", customTypeSerializer: typeof(PrototypeIdSerializer<TagPrototype>))]
|
|
public string? Tag { get; private set; }
|
|
|
|
public override void DoExamine(ExaminedEvent examinedEvent)
|
|
{
|
|
if (string.IsNullOrEmpty(Name))
|
|
return;
|
|
|
|
examinedEvent.PushMarkup(Loc.GetString("construction-insert-arbitrary-entity", ("stepName", Name)));
|
|
}
|
|
|
|
public override ConstructionGuideEntry GenerateGuideEntry()
|
|
{
|
|
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
|
|
var entityManager = IoCManager.Resolve<IEntityManager>();
|
|
|
|
string? nameLocale = null;
|
|
|
|
if (Tag is not null && prototypeManager.TryIndex<TagPrototype>(Tag, out var tag))
|
|
{
|
|
var entities = prototypeManager.EnumeratePrototypes<EntityPrototype>();
|
|
|
|
foreach (var item in entities)
|
|
{
|
|
if (item.TryGetComponent<TagComponent>(out var entityTag) && entityManager.System<TagSystem>().HasTag(entityTag, Tag))
|
|
{
|
|
//Sunrise-start
|
|
if(item.Name == "левая рука киборга-официанта") //костыль так как лень фиксить по другому, хд
|
|
{
|
|
nameLocale = "левая рука киборга";
|
|
}
|
|
else if(item.Name == "голова киборга-уборщика")
|
|
{
|
|
nameLocale = "голова киборга";
|
|
}
|
|
else
|
|
{
|
|
nameLocale = item.Name;
|
|
}
|
|
//Sunrise-End
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
var formattedName = Name.Replace(" ", "-").ToLower();
|
|
|
|
return new ConstructionGuideEntry
|
|
{
|
|
Localization = "construction-presenter-arbitrary-step",
|
|
Arguments = new (string, object)[] { ("name", nameLocale ?? Loc.GetString($"material-{formattedName}-name")) },
|
|
Icon = Icon,
|
|
};
|
|
}
|
|
}
|
|
} |