7 bool m_UseEntityTypeFilter;
16 if (!entity.GetPos(posWorld))
return false;
18 vector posScreen = workspace.ProjWorldToScreenNative(posWorld, entity.GetOwner().GetWorld());
19 return (posScreen[2] > 0 && posScreen[0] > 0 && posScreen[0] < screenW && posScreen[1] > 0 && posScreen[1] < screenH);
22 override bool CanBeShown(
SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,
int flags)
24 if (m_UseEntityTypeFilter && hoveredEntity ==
null)
31 override bool CanBePerformed(
SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,
int flags)
36 override void Perform(
SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,
int flags,
int param = -1)
41 if (!entitiesManager || !selectedEntitiesManager)
46 if (m_UseEntityTypeFilter)
48 m_FilterType = hoveredEntity.GetEntityType();
51 WorkspaceWidget workspace =
GetGame().GetWorkspace();
54 screenW = workspace.GetWidth();
55 screenH = workspace.GetHeight();
57 set<SCR_EditableEntityComponent> filteredEntities =
new set<SCR_EditableEntityComponent>;
58 entitiesManager.GetEntities(m_EditableEntityFilter, filteredEntities);
60 for (
int i = 0; i < filteredEntities.Count(); i++)
62 if (m_UseEntityTypeFilter && filteredEntities[i].
GetEntityType() != m_FilterType)
66 if (m_OnlyInView && !IsEntityIsInView(workspace, filteredEntities[i], screenW, screenH))
70 selectedEntitiesManager.Add(filteredEntities[i]);