4 [
Attribute(
params:
"edds imageset", uiwidget: UIWidgets.ResourcePickerThumbnail)]
5 private ResourceName m_Image;
8 private FactionKey m_sFaction;
10 [
Attribute(
"1", UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(
EEditableEntityLabel),
desc:
"Entity labels configured by developers, changes will be applied when updating editable entities")]
11 private ref array<EEditableEntityLabel> m_aAuthoredLabels;
13 [
Attribute(
"1", UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(
EEditableEntityLabel),
desc:
"Autoconfigured labels, for manual changes edit AuthoredLabels array instead")]
14 private ref array<EEditableEntityLabel> m_aAutoLabels;
17 private ref array<ref SCR_EntityBudgetValue> m_EntityBudgetCost;
19 [
Attribute(
"",
category:
"Editable Entity",
desc:
"Autoconfigured budget costs of child entities (group/composition entities)")]
20 private ref array<ref SCR_EntityBudgetValue> m_EntityChildrenBudgetCost;
23 protected ResourceName m_SlotPrefab;
30 static const LocalizedString EDITABLE_ENTITY_FALLBACK_NAME =
"#AR-AttributesDialog_TitlePage_Entity_Text";
38 if (Name.IsEmpty() || Name[0] ==
"(")
39 return EDITABLE_ENTITY_FALLBACK_NAME;
45 ResourceName GetImage()
57 FactionKey GetFactionKey()
65 FactionManager factionManager =
GetGame().GetFactionManager();
67 return factionManager.GetFactionByKey(m_sFaction);
76 int GetEntityLabels(out notnull array<EEditableEntityLabel> entityLabels)
78 entityLabels.InsertAll(m_aAutoLabels);
79 entityLabels.InsertAll(m_aAuthoredLabels);
80 return entityLabels.Count();
89 if (m_aAutoLabels.Contains(label))
92 if (m_aAuthoredLabels.Contains(label))
101 bool GetEntityBudgetCost(out notnull array<ref SCR_EntityBudgetValue> outBudgets)
104 return !outBudgets.IsEmpty();
109 void GetEntityAndChildrenBudgetCost(out notnull array<ref SCR_EntityBudgetValue> outBudgets)
117 void GetEntityChildrenBudgetCost(out notnull array<ref SCR_EntityBudgetValue> outBudgets)
125 ResourceName GetSlotPrefab()
144 return (m_EntityFlags & flag) == flag;
153 bool SetAssetImageTo(ImageWidget imageWidget)
155 if (!imageWidget || m_Image.IsEmpty())
158 imageWidget.LoadImageTexture(0, m_Image);
165 void InitFromSource(IEntityComponentSource componentSource)
172 protected override void CopyFrom(
SCR_UIName source)
175 if (editableEntitySource)
177 m_Image = editableEntitySource.m_Image;
178 m_sFaction = editableEntitySource.m_sFaction;
179 m_aAuthoredLabels = editableEntitySource.m_aAuthoredLabels;
180 m_aAutoLabels = editableEntitySource.m_aAutoLabels;
181 m_EntityBudgetCost = editableEntitySource.m_EntityBudgetCost;
182 m_EntityChildrenBudgetCost = editableEntitySource.m_EntityChildrenBudgetCost;
186 super.CopyFrom(source);