4 [
Attribute(
desc:
"Compartments Types to fill when chosing entities.", uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(
ECompartmentType))]
5 protected ref array<ECompartmentType> m_aCompartmentsTypes;
7 [
Attribute(
desc:
"Opens content browser and shows single characters only")]
10 [
Attribute(
desc:
"Opens content browser and shows single characters and small groups")]
13 [
Attribute(
desc:
"Opens content browser and shows single characters, small groups and medium groups")]
16 [
Attribute(
desc:
"Opens content browser and shows single characters, small groups medium groups and large groups")]
19 [
Attribute(
"5",
desc:
"This free compartment amount or higher need to be availible or more in order for 'large' filter label to be set in the content browser. Allowing those groups sizes (and lower) to be placed",
params:
"1 inf 1")]
20 protected int m_LargeGroupSize;
22 [
Attribute(
"3",
desc:
"This free compartment amount or higher need to be availible or more in order for 'medium' filter label to be set in the content browser. Allowing those groups sizes (and lower) to be placed",
params:
"1 inf 1")]
23 protected int m_MediumGroupSize;
25 [
Attribute(
"2",
desc:
"This free compartment amount or higher need to be availible or more in order for 'small' filter label to be set in the content browser. Allowing those groups sizes (and lower) to be placed. (Anything lower will be a single character)",
params:
"1 inf 1")]
26 protected int m_SmallGroupSize;
29 override bool CanBeShown(
SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,
int flags)
34 SCR_BaseCompartmentManagerComponent compartmentManager = SCR_BaseCompartmentManagerComponent.Cast(hoveredEntity.GetOwner().FindComponent(SCR_BaseCompartmentManagerComponent));
35 if (!compartmentManager)
39 return contentBrowserManager !=
null;
42 override bool CanBePerformed(
SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,
int flags)
44 SCR_BaseCompartmentManagerComponent compartmentManager = SCR_BaseCompartmentManagerComponent.Cast(hoveredEntity.GetOwner().FindComponent(SCR_BaseCompartmentManagerComponent));
46 return compartmentManager && compartmentManager.CanOccupy(m_aCompartmentsTypes,
false,
string.Empty,
false,
true);
49 override void Perform(
SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,
int flags,
int param = -1)
51 SCR_BaseCompartmentManagerComponent compartmentManager = SCR_BaseCompartmentManagerComponent.Cast(hoveredEntity.GetOwner().FindComponent(SCR_BaseCompartmentManagerComponent));
53 array<BaseCompartmentSlot> freeCompartments = {};
57 compartmentManager.GetFreeCompartmentsOfType(freeCompartments, compartmentType);
60 if (freeCompartments.IsEmpty())
63 int count = freeCompartments.Count();
67 if (count >= m_LargeGroupSize)
68 contentBrowserManager.OpenBrowserExtended(hoveredEntity, m_LargeGroupsDisplayConfig);
69 else if (count >= m_MediumGroupSize)
70 contentBrowserManager.OpenBrowserExtended(hoveredEntity, m_MediumGroupsDisplayConfig);
71 else if (count >= m_SmallGroupSize)
72 contentBrowserManager.OpenBrowserExtended(hoveredEntity, m_SmallGroupsDisplayConfig);
74 contentBrowserManager.OpenBrowserExtended(hoveredEntity, m_SingleCharacterDisplayConfig);