using UnityEngine; using UnityEngine.Scripting; namespace NecromancerTome { /// /// Чего не хватает ремонтнику (24.10.2026, пользователь: «сделать в его урне блок текста, который показывает какой материал /// нужен в данный момент? А то не угадать», «Пусть показывает в виде ячейки с материалом», «И восклицательный знак. Чтобы /// было понятно что именно это требуется»). Ячейка дописана в окно игры windowBagStorage (Config/XUi_InGame/windows.xml) /// под блоком лимита урн: иконка материала, сколько доложить в ящики с нитями, красный «!». Только показ - не ячейка /// сумки, взять из неё нечего. Видна у ремонтника, пока он ждёт материал (TEFeatureCinerarium.LackType/LackCount). /// [Preserve] public class XUiC_NecroRepairNeed : XUiController { XUiV_Sprite _icon; XUiV_Label _count; float _nextRefresh; public override void Init() { base.Init(); _icon = GetChildById("icon")?.ViewComponent as XUiV_Sprite; _count = GetChildById("count")?.ViewComponent as XUiV_Label; } public override void OnOpen() { base.OnOpen(); _nextRefresh = 0f; Refresh(); } public override void Update(float _dt) { base.Update(_dt); if (Time.time >= _nextRefresh) { Refresh(); } } void Refresh() { _nextRefresh = Time.time + 0.5f; TEFeatureCinerarium urn = CinerariumContents.Urn; ItemClass ic = urn != null && urn.IsRepairer && urn.ZoneLacking && urn.LackType > 0 ? ItemClass.GetForId(urn.LackType) : null; ViewComponent.IsVisible = ic != null; if (ic == null) { return; } if (_icon != null) { _icon.SpriteName = ic.GetIconName(); _icon.Color = ic.GetIconTint(); } if (_count != null) { _count.Text = urn.LackCount.ToString(); } } } }