fish-station/Content.Shared/Construction/Steps/ArbitraryInsertConstructionGraphStep.cs
Rinary 64f1aed90c
Большие изменения (#345)
* init

* мать масштаба тарабанил

* fix

* upd

* upd

* upd

* upd

* upd

* console spam fix

* hohohohohohohooooonkeeeeeeeeeeeeeerrrrrrrrrrrsssssssss........

* fix

* fix

* upd

* upd

* some fixes

* fix

* upd

* upd translation for steal obj

* teg translate

* upd

* fix locale + add advertisements

* translate configurator

* Fully translate

* upd

* Я манал это переводить, позже переведу

* upd en-US

* fix Linter

* upd

* fix

* upd

* fix

* fix

* fix

* Возврат ПНТ

* remove agent non silent equipment

* add acid to uplink

* carrySystem new popups

* fix

* fix

* fix disease locale

* add Disease Guide

* upd locale

* upd

* Revert "Merge branch 'master' of https://github.com/space-wizards/space-station-14 into misc"

This reverts commit 4130d241fc47fb80924c0dd3b9c9a2db85af8a25, reversing
changes made to 30abf7341ecce404f61f64e2000ad327964fcb00.

* Revert "Merge branch 'master' of https://github.com/space-wizards/space-station-14 into misc"

This reverts commit 4e5a50d21c29be8482f31e49db253b1ed17a0ae4, reversing
changes made to 449cd7bfd50f29eb653e68ba60e3f0b9310f0443.

* Revert "Merge branch 'master' of https://github.com/space-wizards/space-station-14 into misc"

This reverts commit a4679665ef441d4b63a92dc3c4e217e2cdedbc16, reversing
changes made to a80ef96cfbbc3cc737045e41a2f063a0910bf1ce.

* Revert "Merge branch 'master' of https://github.com/space-wizards/space-station-14 into misc"

This reverts commit 94f585756bb27d10a1be7fab1f340d79b7c0a213, reversing
changes made to 906d18a3f66eaed73f3a894d70971872904fad4e.

* Revert "Merge branch 'master' of https://github.com/space-wizards/space-station-14 into misc"

This reverts commit d0a7c6436ba5c175b0e00d69f495ba51f9aac645, reversing
changes made to e7933332274b336af1fc2a960264bc546c95d208.

# Conflicts:
#	Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
#	Resources/Prototypes/Roles/Jobs/departments.yml

* fix

* upd

* upd

* Reapply "Merge branch 'master' of https://github.com/space-wizards/space-station-14 into misc"

This reverts commit 042a3f112bbc32a622108475ac28081eb0bbbf9f.

# Conflicts:
#	Content.Server/Dragon/DragonRiftSystem.cs
#	Content.Server/GameTicking/GameTicker.Spawning.cs
#	Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs
#	Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs
#	Content.Server/Spawners/EntitySystems/ContainerSpawnPointSystem.cs
#	Content.Server/Zombies/ZombieSystem.cs
#	Content.Server/_Sunrise/NPCSleep/NPCSleepSystem.cs
#	Resources/Changelog/Changelog.yml
#	Resources/Locale/en-US/_strings/store/uplink-catalog.ftl
#	Resources/Prototypes/Catalog/VendingMachines/Inventories/secdrobe.yml
#	Resources/Prototypes/Entities/Clothing/Head/hardsuit-helmets.yml
#	Resources/Prototypes/Entities/Clothing/Head/helmets.yml
#	Resources/Prototypes/Entities/Mobs/Player/silicon.yml
#	Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml
#	Resources/Prototypes/Entities/Stations/base.yml
#	Resources/Prototypes/Loadouts/Jobs/Security/security_officer.yml
#	Resources/Prototypes/Loadouts/loadout_groups.yml
#	Resources/Prototypes/Maps/box.yml
#	Resources/Prototypes/Maps/core.yml
#	Resources/Prototypes/Maps/fland.yml
#	Resources/Prototypes/Maps/marathon.yml
#	Resources/Prototypes/Maps/meta.yml
#	Resources/Prototypes/Maps/packed.yml
#	Resources/Prototypes/Roles/Jobs/departments.yml
#	Resources/Prototypes/Store/categories.yml
#	Resources/ServerInfo/Guidebook/Engineering/PortableGenerator.xml
#	Resources/ServerInfo/Guidebook/Security/Defusal.xml
#	Resources/ServerInfo/Guidebook/Security/Forensics.xml
#	Resources/migration.yml

* Reapply "Merge branch 'master' of https://github.com/space-wizards/space-station-14 into misc"

This reverts commit 2860e1d217a71be0c29684e020b2278c3f08685f.

# Conflicts:
#	Resources/Changelog/Changelog.yml

* Reapply "Merge branch 'master' of https://github.com/space-wizards/space-station-14 into misc"

This reverts commit 0dc7ea17e23d844ce93118db7812b844e36dda4f.

# Conflicts:
#	Resources/Changelog/Changelog.yml
#	Resources/Prototypes/Hydroponics/randomMutations.yml

* Reapply "Merge branch 'master' of https://github.com/space-wizards/space-station-14 into misc"

This reverts commit 439926b3c60e95cc2e701d84a032b17471a7c18e.

* Reapply "Merge branch 'master' of https://github.com/space-wizards/space-station-14 into misc"

This reverts commit 14160ab99909bf6b6f996f415d9dcfd5d4addbba.

# Conflicts:
#	Resources/Changelog/Changelog.yml

* fix

* upd

* upd uplink

* upd

* fix linter
2024-09-16 19:05:38 +03:00

75 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;
}
}
}
if (nameLocale == null)
{
var formattedName = Name.Replace(" ", "-").ToLower();
nameLocale = Loc.GetString($"material-{formattedName}-name");
}
return new ConstructionGuideEntry
{
Localization = "construction-presenter-arbitrary-step",
Arguments = new (string, object)[] { ("name", nameLocale ?? Name) },
Icon = Icon,
};
}
}
}