From fb8834ac631b8ef2d31a9631f2596d424c60c7a6 Mon Sep 17 00:00:00 2001 From: KurokoTurbo <92106367+melanoTurbo@users.noreply.github.com> Date: Sun, 1 Oct 2023 05:55:21 +0300 Subject: [PATCH] Seed analyzer (#433) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * hey * added it to vending machine * added to vending * лицензия спрайта * Update SeedAnalyzerWindow.xaml.cs * fix my recently added bug * обосрался знатно, пофиксил * fix всего кроме null проверки --------- Co-authored-by: melano Co-authored-by: KurokoTurbo <92106367+VildanMinnakhmetov@users.noreply.github.com> --- .../UI/SeedAnalyzerBoundUserInterface.cs | 51 ++++++++ .../SeedAnalyzer/UI/SeedAnalyzerWindow.xaml | 9 ++ .../UI/SeedAnalyzerWindow.xaml.cs | 102 +++++++++++++++ .../Components/SeedAnalyzerComponent.cs | 32 +++++ .../Botany/Systems/SeedAnalyzerSystem.cs | 117 ++++++++++++++++++ .../Botany/SeedAnalyzerDoAfterEvent.cs | 9 ++ .../Botany/SeedAnalyzerScannedUserMessage.cs | 81 ++++++++++++ Content.Shared/Botany/SeedAnalyzerUiKey.cs | 9 ++ .../components/seed-analyzer-component.ftl | 37 ++++++ .../objects/specific/hydroponics/tools.ftl | 9 ++ .../VendingMachines/Inventories/nutri.yml | 3 +- .../Specific/Hydroponics/seedanalyzer.yml | 43 +++++++ .../Hydroponics/seed_analyzer.rsi/icon.png | Bin 0 -> 255 bytes .../Hydroponics/seed_analyzer.rsi/meta.json | 14 +++ 14 files changed, 515 insertions(+), 1 deletion(-) create mode 100644 Content.Client/SeedAnalyzer/UI/SeedAnalyzerBoundUserInterface.cs create mode 100644 Content.Client/SeedAnalyzer/UI/SeedAnalyzerWindow.xaml create mode 100644 Content.Client/SeedAnalyzer/UI/SeedAnalyzerWindow.xaml.cs create mode 100644 Content.Server/Botany/Components/SeedAnalyzerComponent.cs create mode 100644 Content.Server/Botany/Systems/SeedAnalyzerSystem.cs create mode 100644 Content.Shared/Botany/SeedAnalyzerDoAfterEvent.cs create mode 100644 Content.Shared/Botany/SeedAnalyzerScannedUserMessage.cs create mode 100644 Content.Shared/Botany/SeedAnalyzerUiKey.cs create mode 100644 Resources/Locale/ru-RU/botany/components/seed-analyzer-component.ftl create mode 100644 Resources/Prototypes/Entities/Objects/Specific/Hydroponics/seedanalyzer.yml create mode 100644 Resources/Textures/Objects/Specific/Hydroponics/seed_analyzer.rsi/icon.png create mode 100644 Resources/Textures/Objects/Specific/Hydroponics/seed_analyzer.rsi/meta.json diff --git a/Content.Client/SeedAnalyzer/UI/SeedAnalyzerBoundUserInterface.cs b/Content.Client/SeedAnalyzer/UI/SeedAnalyzerBoundUserInterface.cs new file mode 100644 index 0000000000..fd2fa206f4 --- /dev/null +++ b/Content.Client/SeedAnalyzer/UI/SeedAnalyzerBoundUserInterface.cs @@ -0,0 +1,51 @@ +using Content.Shared.Botany; +using JetBrains.Annotations; +using Robust.Client.GameObjects; + +namespace Content.Client.SeedAnalyzer.UI +{ + [UsedImplicitly] + public sealed class SeedAnalyzerBoundUserInterface : BoundUserInterface + { + [ViewVariables] + private SeedAnalyzerWindow? _window; + + public SeedAnalyzerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) + { + } + + protected override void Open() + { + base.Open(); + _window = new SeedAnalyzerWindow + { + Title = EntMan.GetComponent(Owner).EntityName, + }; + _window.OnClose += Close; + _window.OpenCentered(); + } + + protected override void ReceiveMessage(BoundUserInterfaceMessage message) + { + if (_window == null) + return; + + if (message is not SeedAnalyzerScannedUserMessage cast) + return; + + _window.Populate(cast); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + if (!disposing) + return; + + if (_window != null) + _window.OnClose -= Close; + + _window?.Dispose(); + } + } +} diff --git a/Content.Client/SeedAnalyzer/UI/SeedAnalyzerWindow.xaml b/Content.Client/SeedAnalyzer/UI/SeedAnalyzerWindow.xaml new file mode 100644 index 0000000000..28a8825e69 --- /dev/null +++ b/Content.Client/SeedAnalyzer/UI/SeedAnalyzerWindow.xaml @@ -0,0 +1,9 @@ + + + + diff --git a/Content.Client/SeedAnalyzer/UI/SeedAnalyzerWindow.xaml.cs b/Content.Client/SeedAnalyzer/UI/SeedAnalyzerWindow.xaml.cs new file mode 100644 index 0000000000..d55726b442 --- /dev/null +++ b/Content.Client/SeedAnalyzer/UI/SeedAnalyzerWindow.xaml.cs @@ -0,0 +1,102 @@ +using System.Numerics; +using System.Text; +using Content.Shared.FixedPoint; +using Content.Shared.Botany; +using Robust.Client.AutoGenerated; //probably useless +using Robust.Client.UserInterface.CustomControls; +using Robust.Client.UserInterface.XAML; +using Robust.Shared.Prototypes; +using Content.Shared.Chemistry.Reagent; + +namespace Content.Client.SeedAnalyzer.UI +{ + [GenerateTypedNameReferences] + public sealed partial class SeedAnalyzerWindow : DefaultWindow + { + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + public SeedAnalyzerWindow() + { + RobustXamlLoader.Load(this); + IoCManager.InjectDependencies(this); + } + + public void Populate(SeedAnalyzerScannedUserMessage msg) + { + var text = new StringBuilder(); + var entities = IoCManager.Resolve(); // maybe bad + + if (msg.TargetEntity != null) // this may be bad, maybe && entities.TryGetComponent(msg.TargetEntity, out var seed) + { + string entityName = "Unknown"; // без этой строки все ломается и я не знаю почему + + if (msg.Viable == false) + { + text.Append($"{Loc.GetString("seed-analyzer-window-entity-viable-text")}\n"); + } + if (msg.TurnIntoKudzu == true) + { + text.Append($"\n{Loc.GetString("seed-analyzer-window-entity-turnintokudzu-text")}\n"); + } + text.Append($"{Loc.GetString("seed-analyzer-window-entity-endurance-text", ("endurance", msg.Endurance!))}"); + text.Append($"\n{Loc.GetString("seed-analyzer-window-entity-yield-text", ("yield", msg.Yield!))}"); //maybe msg.Yield.HasValue ? "N/A" : $"{msg.Yield}" + text.Append($"\n{Loc.GetString("seed-analyzer-window-entity-maturation-text", ("maturation", msg.Maturation!))}"); + text.Append($"\n{Loc.GetString("seed-analyzer-window-entity-production-text", ("production", msg.Production!))}"); + text.Append($"\n{Loc.GetString("seed-analyzer-window-entity-lifespan-text", ("lifespan", msg.Lifespan!))}"); + text.Append($"\n{Loc.GetString("seed-analyzer-window-entity-potency-text", ("potency", msg.Potency!))}"); + + + int zero = 0; + var zero2 = FixedPoint2.New(zero); + Dictionary nodic = new Dictionary(); + nodic.Add("\nNo chemicals", zero2); + + if (msg.Chemicals != nodic && msg.Chemicals != null) + { + //text.Append($"\n{Loc.GetString("seed-analyzer-window-entity-chemicals-text")}"); + foreach (var (chemical, amount) in msg.Chemicals!) + { + var localizedName = _prototypeManager.TryIndex(chemical, out ReagentPrototype? p) ? p.LocalizedName : Loc.GetString("seed-analyzer-window-reagent-name-not-found-text"); //maybe Loc.GetString("seed-analyzer-window-reagent-name-not-found-text") + text.Append($"\n{Loc.GetString("seed-analyzer-window-entity-chemical-text", ("localizedName", localizedName))}"); + text.Append($" {Loc.GetString("seed-analyzer-window-entity-amount-text", ("amount", amount))}"); + } + } + + + if (msg.Ligneous == true) + { + text.Append($"\n{Loc.GetString("seed-analyzer-window-entity-ligneous-text")}"); + } + if (msg.CanScream == true) + { + text.Append($"\n{Loc.GetString("seed-analyzer-window-entity-canscream-text")}"); + } + if (msg.Slip == true) + { + text.Append($"\n{Loc.GetString("seed-analyzer-window-entity-slip-text")}"); + } + if (msg.Bioluminescent == true) + { + text.Append($"\n{Loc.GetString("seed-analyzer-window-entity-bioluminescent-text")}"); + } + if (msg.Sentient == true) + { + text.Append($"\n{Loc.GetString("seed-analyzer-window-entity-sentient-text")}"); + } + if (msg.Seedless == true) + { + text.Append($"\n{Loc.GetString("seed-analyzer-window-entity-seedless-text")}"); + } + + + + Diagnostics.Text = text.ToString(); + SetSize = new Vector2(250, 600); + } + else + { + Diagnostics.Text = Loc.GetString("seed-analyzer-window-no-plant-data-text"); + SetSize = new Vector2(250, 100); + } + } + } +} diff --git a/Content.Server/Botany/Components/SeedAnalyzerComponent.cs b/Content.Server/Botany/Components/SeedAnalyzerComponent.cs new file mode 100644 index 0000000000..fc593ad481 --- /dev/null +++ b/Content.Server/Botany/Components/SeedAnalyzerComponent.cs @@ -0,0 +1,32 @@ +using Content.Server.UserInterface; +using Content.Shared.Botany; +using Robust.Server.GameObjects; +using Robust.Shared.Audio; + +namespace Content.Server.Botany.Components +{ + /// + /// After scanning, retrieves the target Uid to use with its related UI. + /// + [RegisterComponent] + public sealed partial class SeedAnalyzerComponent : Component + { + /// + /// How long it takes to scan a seed. + /// + [DataField("scanDelay")] + public float ScanDelay = 0.8f; + + /// + /// Sound played on scanning begin + /// + [DataField("scanningBeginSound")] + public SoundSpecifier? ScanningBeginSound; + + /// + /// Sound played on scanning end + /// + [DataField("scanningEndSound")] + public SoundSpecifier? ScanningEndSound; + } +} diff --git a/Content.Server/Botany/Systems/SeedAnalyzerSystem.cs b/Content.Server/Botany/Systems/SeedAnalyzerSystem.cs new file mode 100644 index 0000000000..61ff142577 --- /dev/null +++ b/Content.Server/Botany/Systems/SeedAnalyzerSystem.cs @@ -0,0 +1,117 @@ +using Content.Server.Botany.Components; +using Content.Server.PowerCell; +using Content.Shared.FixedPoint; +using Content.Shared.DoAfter; +using Content.Shared.Interaction; +using Content.Shared.Botany; +using Content.Shared.Mobs.Components; //probably useless +using Robust.Server.GameObjects; +using Robust.Shared.Audio.Systems; +using Robust.Shared.Player; + +namespace Content.Server.Botany +{ + public sealed class SeedAnalyzerSystem : EntitySystem + { + [Dependency] private readonly PowerCellSystem _cell = default!; + [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!; + [Dependency] private readonly UserInterfaceSystem _uiSystem = default!; + + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(OnAfterInteract); + SubscribeLocalEvent(OnDoAfter); + } + + private void OnAfterInteract(EntityUid uid, SeedAnalyzerComponent seedAnalyzer, AfterInteractEvent args) + { + if (args.Target == null || !args.CanReach || !HasComp(args.Target) || !_cell.HasActivatableCharge(uid, user: args.User)) + return; + + _audio.PlayPvs(seedAnalyzer.ScanningBeginSound, uid); // maybe healthAnalyzer.ScanningBeginSound + + _doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, seedAnalyzer.ScanDelay, new SeedAnalyzerDoAfterEvent(), uid, target: args.Target, used: uid) //maybe healthAnalyzer.ScanDelay + { + BreakOnTargetMove = true, + BreakOnUserMove = true, + NeedHand = true + }); + } + + private void OnDoAfter(EntityUid uid, SeedAnalyzerComponent component, DoAfterEvent args) + { + if (args.Handled || args.Cancelled || args.Args.Target == null || !_cell.TryUseActivatableCharge(uid, user: args.User)) + return; + + _audio.PlayPvs(component.ScanningEndSound, args.Args.User); + + UpdateScannedSeed(uid, args.Args.User, args.Args.Target.Value, component); + args.Handled = true; + } + + private void OpenUserInterface(EntityUid user, EntityUid seedAnalyzer) + { + if (!TryComp(user, out var actor) || !_uiSystem.TryGetUi(seedAnalyzer, SeedAnalyzerUiKey.Key, out var ui)) + return; + + _uiSystem.OpenUi(ui, actor.PlayerSession); + } + + public void UpdateScannedSeed(EntityUid uid, EntityUid user, EntityUid? target, SeedAnalyzerComponent? seedAnalyzer) + { + if (!Resolve(uid, ref seedAnalyzer)) + return; + + if (target == null || !_uiSystem.TryGetUi(uid, SeedAnalyzerUiKey.Key, out var ui)) + return; + + if (!TryComp(target, out var plant)) + return; + + if (plant!.Seed == null) + { + return; + } + + int zero = 0; + string nonameseed = "None"; + Dictionary emptydic = new Dictionary(); + var zero2 = FixedPoint2.New(zero); + emptydic?.Add("No chemicals", zero2!); + Dictionary passchems = new Dictionary(); + + if (plant?.Seed?.Chemicals != null) + { + foreach (var (chem, quantity) in plant.Seed.Chemicals) + { + var amount = FixedPoint2.New(quantity.Min); + amount += FixedPoint2.New(plant.Seed.Potency / quantity.PotencyDivisor); + amount = FixedPoint2.New((int) MathHelper.Clamp(amount.Float(), quantity.Min, quantity.Max)); + passchems?.Add(chem, amount); + } + } + + OpenUserInterface(user, uid); + + _uiSystem.SendUiMessage(ui, new SeedAnalyzerScannedUserMessage(GetNetEntity(target), + plant!.Seed?.Yield, + plant != null ? plant.Seed?.Production : float.NaN, + plant != null ? plant.Seed?.Lifespan : float.NaN, + plant != null ? plant.Seed?.Maturation : float.NaN, + plant != null ? plant.Seed?.Endurance : float.NaN, + plant != null ? plant.Seed?.Potency : float.NaN, + plant != null ? plant.Seed?.Viable : false, + plant != null ? plant.Seed?.TurnIntoKudzu : false, + plant != null ? plant.Seed?.Seedless : false, + plant != null ? plant.Seed?.DisplayName : nonameseed, + passchems != null ? passchems : emptydic, + plant != null ? plant.Seed?.Ligneous : false, + plant != null ? plant.Seed?.CanScream : false, + plant != null ? plant.Seed?.Slip : false, + plant != null ? plant.Seed?.Bioluminescent : false, + plant != null ? plant.Seed?.Sentient : false)); + } + } +} diff --git a/Content.Shared/Botany/SeedAnalyzerDoAfterEvent.cs b/Content.Shared/Botany/SeedAnalyzerDoAfterEvent.cs new file mode 100644 index 0000000000..d0f509f84e --- /dev/null +++ b/Content.Shared/Botany/SeedAnalyzerDoAfterEvent.cs @@ -0,0 +1,9 @@ +using Content.Shared.DoAfter; +using Robust.Shared.Serialization; + +namespace Content.Shared.Botany; + +[Serializable, NetSerializable] +public sealed partial class SeedAnalyzerDoAfterEvent : SimpleDoAfterEvent +{ +} diff --git a/Content.Shared/Botany/SeedAnalyzerScannedUserMessage.cs b/Content.Shared/Botany/SeedAnalyzerScannedUserMessage.cs new file mode 100644 index 0000000000..307b11140c --- /dev/null +++ b/Content.Shared/Botany/SeedAnalyzerScannedUserMessage.cs @@ -0,0 +1,81 @@ +using Robust.Shared.Serialization; +using Content.Shared.FixedPoint; +namespace Content.Shared.Botany; + +/// +/// On interacting with an entity retrieves the entity UID for use with getting the current SeedData of the seed. +/// +[Serializable, NetSerializable] +public sealed class SeedAnalyzerScannedUserMessage : BoundUserInterfaceMessage +{ + public readonly NetEntity? TargetEntity; + public int? Yield; + public float? Production; + public float? Lifespan; + public float? Maturation; + public float? Endurance; + public float? Potency; + public bool? Viable; + public bool? TurnIntoKudzu; + public bool? Seedless; + public Dictionary? Chemicals; + public string? DisplayName; + public bool? CanScream; + public bool? Slip; + public bool? Sentient; + public bool? Ligneous; + public bool? Bioluminescent; + + + public SeedAnalyzerScannedUserMessage(NetEntity? targetEntity, + int? yield, + float? production, + float? lifespan, + float? maturation, + float? endurance, + float? potency, + bool? viable, + bool? turnIntoKudzu, + bool? seedless, + string? displayName, + Dictionary? chemicals, + bool? ligneous, + bool? canScream, + bool? slip, + bool? bioluminescent, + bool? sentient) + { + TargetEntity = targetEntity; + DisplayName = displayName; //broken for unknown reason + Viable = viable; + TurnIntoKudzu = turnIntoKudzu; + + // general traits + Yield = yield; + Production = production; + Endurance = endurance; + Chemicals = chemicals; + + + Potency = potency; + Lifespan = lifespan; + Maturation = maturation; + Seedless = seedless; + Endurance = endurance; + Ligneous = ligneous; + + // minor traits + //ConsumeGasses = consumeGasses; + //ExudeGasses = exudeGasses; + //NutrientConsumption = nutrientConsumption; + //WaterConsumption = waterConsumption; + //IdealHeat = idealHeat; + //LowPressureTolerance = lowPressureTolerance; + //HighPressureTolerance = highPressureTolerance; + + // mutations + CanScream = canScream; + Bioluminescent = bioluminescent; + + } +} diff --git a/Content.Shared/Botany/SeedAnalyzerUiKey.cs b/Content.Shared/Botany/SeedAnalyzerUiKey.cs new file mode 100644 index 0000000000..03a4cd6e53 --- /dev/null +++ b/Content.Shared/Botany/SeedAnalyzerUiKey.cs @@ -0,0 +1,9 @@ +using Robust.Shared.Serialization; + +namespace Content.Shared.Botany; + +[Serializable, NetSerializable] +public enum SeedAnalyzerUiKey : byte +{ + Key +} diff --git a/Resources/Locale/ru-RU/botany/components/seed-analyzer-component.ftl b/Resources/Locale/ru-RU/botany/components/seed-analyzer-component.ftl new file mode 100644 index 0000000000..85bc90a36b --- /dev/null +++ b/Resources/Locale/ru-RU/botany/components/seed-analyzer-component.ftl @@ -0,0 +1,37 @@ +seed-analyzer-window-entity-name-text = Растение: {$name} +seed-analyzer-window-entity-viable-text = Это растение нежизнеспособно, оно скоро погибнет. +seed-analyzer-window-entity-traits-text = Черты: +seed-analyzer-window-entity-traits-text = Нет интересных черт( +seed-analyzer-window-entity-chemicals-text = Химикаты: +seed-analyzer-window-entity-chemical-text = {$localizedName}: +seed-analyzer-window-entity-amount-text = {$amount}u +seed-analyzer-window-entity-consumeGasses-text = Seed: {$name} +seed-analyzer-window-entity-exudeGasses-text = Seed: {$name} +seed-analyzer-window-entity-nutrientConsumption-text = Seed: {$name} +seed-analyzer-window-entity-waterConsumption-text = Seed: {$name} +seed-analyzer-window-entity-seedless-text = Безсемянное +seed-analyzer-window-entity-heatTolerance-text = a +seed-analyzer-window-entity-idealLight-text = b +seed-analyzer-window-entity-toxinsTolerance-text = d +seed-analyzer-window-entity-lowPressureTolerance-text = c +seed-analyzer-window-entity-highPressureTolerance-text = e +seed-analyzer-window-entity-pestTolerance-text = f +seed-analyzer-window-entity-weedTolerance-text = g +seed-analyzer-window-entity-weedHighLevelThreshold-text = h +seed-analyzer-window-entity-endurance-text = Здоровье: {$endurance} +seed-analyzer-window-entity-yield-text = Урожайность: {$yield} +seed-analyzer-window-entity-lifespan-text = Продолжительность жизни: {$lifespan} +seed-analyzer-window-entity-maturation-text = Время роста: {$maturation} +seed-analyzer-window-entity-production-text = Время до урожая: {$production} +seed-analyzer-window-entity-harvestRepeat-text = i +seed-analyzer-window-entity-potency-text = Потенция: {$potency} +seed-analyzer-window-entity-slip-text = Скользкий урожай +seed-analyzer-window-entity-sentient-text = Разумное +seed-analyzer-window-entity-ligneous-text = Древесное +seed-analyzer-window-entity-canscream-text = Кричащее +seed-analyzer-window-entity-bioluminescent-text = Светящийся урожай +seed-analyzer-window-entity-bioluminescentColor-text = j +seed-analyzer-window-entity-turnintokudzu-text = Внимание: аномальная активность сорняков. +seed-analyzer-window-entity-kudzuPrototype-text = k +seed-analyzer-window-no-plant-data-text = Нет данных. +seed-analyzer-window-reagent-name-not-found-text = Неизвестный реагент diff --git a/Resources/Locale/ru-RU/ss14-ru/prototypes/entities/objects/specific/hydroponics/tools.ftl b/Resources/Locale/ru-RU/ss14-ru/prototypes/entities/objects/specific/hydroponics/tools.ftl index 38fee02b9c..e6ec7b421a 100644 --- a/Resources/Locale/ru-RU/ss14-ru/prototypes/entities/objects/specific/hydroponics/tools.ftl +++ b/Resources/Locale/ru-RU/ss14-ru/prototypes/entities/objects/specific/hydroponics/tools.ftl @@ -16,3 +16,12 @@ ent-HydroponicsToolSpade = лопатка ent-PlantBag = сумка для растений .desc = Сумка для ботаников, чтобы легко переносить свои огромные урожаи. .suffix = { "" } +ent-HandheldSeedAnalyzerUnpowered = сканер растений (без питания) + .desc = Показывает характеристики растения. + .suffix = { "" } +ent-HandheldSeedAnalyzer = сканер растений + .desc = Показывает характеристики растения. + .suffix = { "" } +ent-HandheldSeedAnalyzerEmpty = сканер растений (пустой) + .desc = Показывает характеристики растения. + .suffix = { "" } diff --git a/Resources/Prototypes/Catalog/VendingMachines/Inventories/nutri.yml b/Resources/Prototypes/Catalog/VendingMachines/Inventories/nutri.yml index c3933dfa3d..446358d16f 100644 --- a/Resources/Prototypes/Catalog/VendingMachines/Inventories/nutri.yml +++ b/Resources/Prototypes/Catalog/VendingMachines/Inventories/nutri.yml @@ -6,7 +6,8 @@ HydroponicsToolClippers: 4 HydroponicsToolScythe: 4 HydroponicsToolHatchet: 4 - PlantBag: 3 + PlantBag: 4 + HandheldSeedAnalyzer: 4 PlantBGoneSpray: 20 WeedSpray: 20 PestSpray: 20 diff --git a/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/seedanalyzer.yml b/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/seedanalyzer.yml new file mode 100644 index 0000000000..b1920cf61a --- /dev/null +++ b/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/seedanalyzer.yml @@ -0,0 +1,43 @@ +- type: entity + id: HandheldSeedAnalyzerUnpowered + parent: BaseItem + name: seed analyzer + description: A hand-held seed scanner capable of deciphering genes of the subject. + components: + - type: Sprite + sprite: Objects/Specific/Hydroponics/seed_analyzer.rsi + state: icon + - type: ActivatableUI + key: enum.SeedAnalyzerUiKey.Key + closeOnHandDeselect: false + - type: UserInterface + interfaces: + - key: enum.SeedAnalyzerUiKey.Key + type: SeedAnalyzerBoundUserInterface + - type: SeedAnalyzer + scanningEndSound: + path: "/Audio/Items/Medical/healthscanner.ogg" + - type: Tag + tags: + - DiscreteHealthAnalyzer + - type: Appearance + +- type: entity + id: HandheldSeedAnalyzer + parent: [ HandheldSeedAnalyzerUnpowered, PowerCellSlotSmallItem] + suffix: Powered + components: + - type: PowerCellDraw + drawRate: 0 + useRate: 5 + - type: ActivatableUIRequiresPowerCell + +- type: entity + id: HandheldSeedAnalyzerEmpty + parent: HandheldSeedAnalyzer + suffix: Empty + components: + - type: ItemSlots + slots: + cell_slot: + name: power-cell-slot-component-slot-name-default diff --git a/Resources/Textures/Objects/Specific/Hydroponics/seed_analyzer.rsi/icon.png b/Resources/Textures/Objects/Specific/Hydroponics/seed_analyzer.rsi/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..6e12e2989382f63d7dc84f8c03db1cf06a21acbd GIT binary patch literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv-2k5uSD(y6IXO882Z!L`;GS~x z{fm6{^z=?12nNbG{A;MMuV?trz_^xyVG@Ixnc0%6U(bLNj3q&S!3+-1Zlr-!dAc}; zXiQ8_SRj>zopr03{1lr~m)} literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Specific/Hydroponics/seed_analyzer.rsi/meta.json b/Resources/Textures/Objects/Specific/Hydroponics/seed_analyzer.rsi/meta.json new file mode 100644 index 0000000000..c0df8862aa --- /dev/null +++ b/Resources/Textures/Objects/Specific/Hydroponics/seed_analyzer.rsi/meta.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "size": { + "x": 32, + "y": 32 + }, + "license": "CC-BY-NC-SA-3.0", + "copyright": "Taken from goonstation", + "states": [ + { + "name": "icon" + } + ] +}