9 [
Attribute(
"0", UIWidgets.ComboBox,
"List of entity types who are ignored even if 'm_Type' is valid.",
"", ParamEnumArray.FromEnum(
EEditableEntityType) )]
10 protected ref array<EEditableEntityType> m_aTypeBlackList;
15 [
Attribute(
desc:
"Order offsets applied to individual states. Can be used to sort items beyond just their type.")]
16 protected ref array<ref SCR_EntityToolbarStateOffset> m_aStateOffsets;
21 [
Attribute(
desc:
"When enabled, only direct children of currently selected layer will be shown.")]
22 protected bool m_bOnlyDirectChildren;
25 protected ref array<EEditableEntityType> m_aTypeOrder;
28 protected string m_sTypeTabsWidgetName;
30 [
Attribute(
desc:
"List of entity types matching tabs defined in 'm_sTypeTabsWidgetName' widget. Also includes black list which are ignored even if type is valid.")]
31 protected ref array<ref SCR_EntityToolbarTypeList> m_aEntityTypeTabs;
33 protected bool m_bHasTabs;
34 protected bool m_bHasEntities;
35 protected ref SCR_SortedArray<SCR_EditableEntityComponent> m_Entities =
new SCR_SortedArray<SCR_EditableEntityComponent>();
37 protected ref map<SCR_EditableEntityComponent, Widget> m_ItemsMap =
new map<SCR_EditableEntityComponent, Widget>();
51 if (!CreateItem(itemWidget, item))
57 Print(
string.Format(
"'%1' must contain SCR_EditableEntityLinkUIComponent!", m_ItemLayout), LogLevel.WARNING);
58 itemWidget.RemoveFromHierarchy();
66 entityLink.SetLinkedEntity(entity);
68 itemWidget.SetName(entity.ToString());
73 protected void Clear()
80 protected void OnChanged(
EEditableEntityState state, set<SCR_EditableEntityComponent> entitiesInsert, set<SCR_EditableEntityComponent> entitiesRemove)
86 protected void OnEditorSetSelection()
105 override protected void ShowEntries(Widget contentWidget,
int indexStart,
int indexEnd)
109 indexEnd = Math.Min(indexEnd,
m_Entities.Count());
110 for (
int i = indexStart; i < indexEnd; i++)
112 CreateItem(m_Entities[i]);
117 protected override bool IsUnique()
123 override protected void SetToolbarVisible(
bool show)
125 super.SetToolbarVisible(show || m_bHasEntities);
129 override protected void Refresh()
135 set<SCR_EditableEntityComponent> entities =
new set<SCR_EditableEntityComponent>();
136 int count = filter.GetEntities(entities);
152 order = 100 + entity.GetEntityType();
156 if (entity.HasEntityState(stateOffset.m_State))
157 order += stateOffset.m_iOrderOffset;
172 m_Pagination.SetEntryCount(
m_Entities.Count());
178 override void OnRepeat()
187 filter.Replace(m_RepeatEntity);
197 super.CopyPage(linkedComponent);
201 override void OnMenuUpdate(
float timeSlice)
203 super.OnMenuUpdate(timeSlice);
208 override bool OnFocus(Widget w,
int x,
int y)
223 if (teleportComponent)
224 teleportComponent.TeleportCamera(pos);
229 return super.OnFocus(w, x, y);
233 override void HandlerAttachedScripted(Widget w)
246 filter.GetOnChanged().Insert(OnChanged);
253 filter.GetOnChanged().Insert(OnChanged);
256 InputManager inputManager =
GetGame().GetInputManager();
258 inputManager.AddActionListener(
"EditorSetSelection", EActionTrigger.DOWN, OnEditorSetSelection);
260 if (m_sTypeTabsWidgetName)
262 Widget typeTabsWidget = w.FindAnyWidget(m_sTypeTabsWidgetName);
268 m_TabView.GetOnContentSelect().Insert(OnTypeTab);
272 OnTypeTab(
null,
null, 0);
276 super.HandlerAttachedScripted(w);
281 if (transformingManager)
282 transformingManager.GetOnTransformationStart().Insert(CloseDialog);
287 override void HandlerDeattached(Widget w)
289 super.HandlerDeattached(w);
295 filter.GetOnChanged().Remove(OnChanged);
301 filter.GetOnChanged().Insert(OnChanged);
304 InputManager inputManager =
GetGame().GetInputManager();
306 inputManager.RemoveActionListener(
"EditorSetSelection", EActionTrigger.DOWN, OnEditorSetSelection);
311 if (transformingManager)
312 transformingManager.GetOnTransformationStart().Remove(CloseDialog);
318 class SCR_EntityToolbarTypeList
320 [
Attribute(
"-1", uiwidget: UIWidgets.ComboBox,
"Entity type which are shown in tabs defined in 'm_sTypeTabsWidgetName' widget.", enums:
SCR_Enum.GetList(
EEditableEntityType,
new ParamEnum(
"<ALL>",
"-1")) )]
323 [
Attribute(
"0", UIWidgets.ComboBox,
"List of entity types who are ignored even if 'm_Type' is valid.",
"", ParamEnumArray.FromEnum(
EEditableEntityType) )]
335 void GetTypeBlackList(out notnull array<EEditableEntityType> blackList)
344 [
Attribute(
"-1", uiwidget: UIWidgets.ComboBox,
"Entity type which are shown in tabs defined in 'm_sTypeTabsWidgetName' widget.", enums: ParamEnumArray.FromEnum(
EEditableEntityState) )]