Ремонтник: в «Содержимом» урны ячейка с недостающим материалом и «!»
Пока ремонтник ждёт материал, под блоком лимита урн видна ячейка: иконка материала, сколько доложить в ящики с нитями, красный «!» и подпись. Только показ, не ячейка сумки. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c208e3b9f9
commit
7452eba0d9
@@ -0,0 +1,64 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace NecromancerTome
|
||||
{
|
||||
/// <summary>
|
||||
/// Чего не хватает ремонтнику (24.10.2026, пользователь: «сделать в его урне блок текста, который показывает какой материал
|
||||
/// нужен в данный момент? А то не угадать», «Пусть показывает в виде ячейки с материалом», «И восклицательный знак. Чтобы
|
||||
/// было понятно что именно это требуется»). Ячейка дописана в окно игры windowBagStorage (Config/XUi_InGame/windows.xml)
|
||||
/// под блоком лимита урн: иконка материала, сколько доложить в ящики с нитями, красный «!». Только показ - не ячейка
|
||||
/// сумки, взять из неё нечего. Видна у ремонтника, пока он ждёт материал (TEFeatureCinerarium.LackType/LackCount).
|
||||
/// </summary>
|
||||
[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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,6 +75,9 @@ namespace NecromancerTome
|
||||
public int ZonePressedBy = -1;
|
||||
/// <summary>Не хватает материалов / ящик полон - кнопка мигает жёлтым.</summary>
|
||||
public bool ZoneLacking;
|
||||
/// <summary>Ремонтник: какого материала и сколько не хватило последней проверке (ячейка в «Содержимом»,
|
||||
/// XUiC_NecroRepairNeed). Не сохраняется.</summary>
|
||||
public int LackType, LackCount;
|
||||
|
||||
public static float RepairSeconds = 2.5f;
|
||||
public static float LootSeconds = 1.5f;
|
||||
@@ -403,6 +406,8 @@ namespace NecromancerTome
|
||||
}
|
||||
if (have < n)
|
||||
{
|
||||
LackType = iv.type;
|
||||
LackCount = n - have;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user