6 [
Attribute(
desc:
"List of only states which will be tracked. When empty, all states will be tracked.\nUsed to show only specific icons, e.g., only the default one (RENDERED) and player overlay (PLAYER).", uiwidget: UIWidgets.Flags, enums: ParamEnumArray.FromEnum(
EEditableEntityState))]
9 [
Attribute(
desc:
"List of states which will not be tracked, even when they're part of Editable Entity UI config.", uiwidget: UIWidgets.Flags, enums: ParamEnumArray.FromEnum(
EEditableEntityState))]
12 [
Attribute(
desc:
"States which are considered always active.\nUsed for example to force RENDERED state even for entities which are not shown in the scene.", uiwidget: UIWidgets.Flags, enums: ParamEnumArray.FromEnum(
EEditableEntityState))]
15 [
Attribute(
"0",
desc:
"Register all entities which meet the rules at the beginning.")]
16 protected bool m_bAddAllEntities;
19 protected ref map<SCR_EditableEntityComponent, SCR_EditableEntityBaseSlotUIComponent> m_mEntitySlots =
new map<SCR_EditableEntityComponent, SCR_EditableEntityBaseSlotUIComponent>();
20 protected bool m_bInteractive;
22 protected ref map<SCR_EntitiesEditorUIRule, ref SCR_EditableEntityUIRuleTracker> m_RuleTrackers;
28 return m_ForcedStates;
43 m_mEntitySlots.Find(entity, slot);
55 if (!forced && (entity.GetEntityStates() | m_ForcedStates) & m_States)
60 if (m_mEntitySlots.Find(entity, entitySlot))
62 entitySlot.DeleteSlot();
63 m_mEntitySlots.Remove(entity);
78 slot.InitSlot(entity);
79 m_mEntitySlots.Insert(entity, slot);
88 if (m_mEntitySlots.Contains(entity))
90 entity.Log(
"Attempting to create duplicate GUI slot for editable entity. Duplicates are not allowed!",
true, LogLevel.WARNING);
94 slot.InitSlot(entity);
95 m_mEntitySlots.Insert(entity, slot);
99 set<SCR_EditableEntityComponent> entities =
new set<SCR_EditableEntityComponent>();
100 entities.Insert(entity);
106 ruleTracker.AddEntity(entity);
116 m_mEntitySlots.Clear();
137 void InitSlotManager()
150 array<ref SCR_EntitiesEditorUIRule> rules = entityUIConfig.GetRules();
151 if (rules && !rules.IsEmpty())
154 m_RuleTrackers =
new map<SCR_EntitiesEditorUIRule, ref SCR_EditableEntityUIRuleTracker>();
159 if ((m_WhitelistedStates == 0 || (states & m_WhitelistedStates)) && (states & ~m_BlacklistedStates) != 0)
162 m_RuleTrackers.Insert(rule, ruleTracker);
163 m_bInteractive |= rule.IsInteractive();
165 if (!rule.IsDependent())
172 Print(
"UI rules not defined in SCR_EditableEntityUIConfig!", LogLevel.WARNING);
177 Print(
"SCR_EditableEntityUIConfig not defined!", LogLevel.WARNING);
186 override bool IsUnique()
192 override void HandlerAttachedScripted(Widget w)
194 super.HandlerAttachedScripted(w);
201 override void HandlerDeattached(Widget w)
203 super.HandlerDeattached(w);
215 if (m_RuleTrackers.Find(rule, ruleTracker) && ruleTracker)
217 m_RuleTrackers.Remove(rule);