1 [
ComponentEditorProps(
category:
"GameScripted/Editor (Editables)", description:
"", icon:
"WBData/ComponentEditorProps/componentEditor.png")]
10 [
Attribute(
"", UIWidgets.Auto,
category:
"Visualization",
desc:
"Bone to which the icon is attached to")]
11 protected string m_sIconBoneName;
35 string GetIconBoneName()
37 return m_sIconBoneName;
45 if (m_EntityInteraction)
46 return m_EntityInteraction;
50 return core.GetEntityInteraction(GetEntityType());
59 static IEntityComponentSource GetEditableEntitySource(Resource entityResource)
64 BaseResourceObject entityBase = entityResource.GetResource();
68 IEntitySource entitySource = entityBase.ToEntitySource();
72 return GetEditableEntitySource(entitySource);
79 static IEntityComponentSource GetEditableEntitySource(IEntitySource entitySource)
84 int componentsCount = entitySource.GetComponentCount();
85 for (
int i = 0; i < componentsCount; i++)
87 IEntityComponentSource componentSource = entitySource.GetComponent(i);
89 return componentSource;
100 BaseContainer infoSource = componentSource.GetObject(
"m_UIInfo");
105 info.InitFromSource(componentSource);
116 componentSource.Get(
"m_EntityType",
type);
126 BaseContainer container = componentSource.GetObject(
"m_EntityInteraction");
132 return core.GetEntityInteraction(GetEntityType(componentSource));
141 static ResourceName GetSlotPrefab(IEntityComponentSource componentSource)
143 BaseContainer info = componentSource.GetObject(
"m_UIInfo");
145 return ResourceName.Empty;
147 ResourceName slotPrefab;
148 info.Get(
"m_SlotPrefab", slotPrefab);
159 componentSource.Get(
"m_Flags", flags);
171 componentSource.Get(
"m_Flags", flags);
181 static bool GetEntitySourceBudgetCost(IEntityComponentSource editableEntitySource, out notnull array<ref SCR_EntityBudgetValue> budgetValues)
183 if (!editableEntitySource)
187 if (editableEntityUIInfo)
188 return editableEntityUIInfo.GetEntityBudgetCost(budgetValues);
190 return !budgetValues.IsEmpty();
198 static bool GetEntitySourceChildrenBudgetCosts(IEntityComponentSource editableEntitySource, out notnull array<ref SCR_EntityBudgetValue> budgetValues)
200 if (!editableEntitySource)
204 if (editableEntityUIInfo)
205 editableEntityUIInfo.GetEntityChildrenBudgetCost(budgetValues);
207 return !budgetValues.IsEmpty();