10 ref SCR_SortedArray<SCR_BaseEditorAction> m_aActions;
14class SCR_EditorActionList
17 ref array<ref SCR_BaseEditorAction>
m_Actions;
34 int GetActions(out notnull array<SCR_BaseEditorAction> outActions)
63 void SetShortcuts(SCR_BaseActionsEditorComponent manager,
bool toAdd)
69 action.AddShortcut(manager);
76 action.RemoveShortcut();
92 SCR_SortedArray<SCR_BaseEditorAction> actionsSorted =
new SCR_SortedArray<SCR_BaseEditorAction>();
95 for (
int i = 0, count = list.m_Actions.Count(); i < count; i++)
97 action = list.m_Actions[i];
99 actionsSorted.Insert(action.
GetOrder(), action);
108 SCR_SortedArray<SCR_EditorActionGroup> actionGroupsSorted =
new SCR_SortedArray<SCR_EditorActionGroup>();
111 for (
int g = 0; g < actionGroupCount; g++)
114 actionGroup.m_aActions =
new SCR_SortedArray<SCR_BaseEditorAction>();
115 actionGroupsSorted.Insert(actionGroup.m_iOrder, actionGroup);
116 actionGroupsMap.Insert(actionGroup.m_ActionGroup, actionGroup);
123 for (
int a = 0, count = list.m_Actions.Count(); a < count; a++)
125 action = list.m_Actions[a];
129 actionGroup.m_aActions.Insert(action.
GetOrder(), action);
131 Debug.Error2(
"SCR_BaseActionsEditorComponentClass.SCR_BaseActionsEditorComponentClass()",
string.Format(
"Cannot register action %1, its group %2 is not configured!",
Type(),
typename.EnumToString(
EEditorActionGroup, action.
GetActionGroup())));
137 for (
int g; g < actionGroupCount; g++)
139 actionGroup = actionGroupsSorted[g];
140 for (
int a, actionCount = actionGroup.m_aActions.Count(); a < actionCount; a++)
159 protected ref set<SCR_EditableEntityComponent>
m_SelectedEntities =
new set<SCR_EditableEntityComponent>();
172 int GetActions(out notnull array<SCR_BaseEditorAction> actions)
188 void EvaluateActions(notnull array<SCR_BaseEditorAction> actions,
vector cursorWorldPosition, out notnull array<ref SCR_EditorActionData> filteredActions, out
int flags = 0)
190 filteredActions.Clear();
213 array<SCR_BaseEditorAction> actions = {};
216 return filteredActions.Count();
259 vector cursorWorldPosition;
275 if (
GetGame().GetMenuManager().IsAnyDialogOpen())
319 int actionIndex = prefabData.
FindAction(action);
320 if (actionIndex == -1)
323 RplId hoveredEntityID = -1;
324 array<RplId> selectedEntityIds = {};
325 SerializeEntities(hoveredEntityID, selectedEntityIds);
333 action.
Perform(hoveredEntityComponent, selectedEntityComponents, cursorWorldPosition,
flags, param);
362 Print(
"Action with index: " + actionIndex +
" not found on server",
LogLevel.ERROR);
367 set<SCR_EditableEntityComponent> selectedEntityComponents =
new set<SCR_EditableEntityComponent>;
368 DeSerializeEntities(hoveredEntityID, selectedEntityIds, hoveredEntityComponent, selectedEntityComponents);
370 if (!action.
CanBeShown(hoveredEntityComponent, selectedEntityComponents, cursorWorldPosition,
flags))
373 if (!action.
CanBePerformed(hoveredEntityComponent, selectedEntityComponents, cursorWorldPosition,
flags))
376 ActionPerform(action, hoveredEntityComponent, selectedEntityComponents, cursorWorldPosition,
flags, param);
393 Print(
"Action with index: " + actionIndex +
" returned from server, not found on client",
LogLevel.ERROR);
400 private void SerializeEntities(out
RplId hoveredEntityId, out array<RplId> selectedEntityIds)
418 RplId selectedEntityId;
419 if (!GetRplIdFromEditableEntity(selectedEntity, selectedEntityId))
421 Print(
"Entity " + selectedEntity.GetDisplayName() +
" does not have replication component or is not registered for replication",
LogLevel.WARNING);
424 selectedEntityIds.Insert(selectedEntityId);
429 private bool GetRplIdFromEditableEntity(SCR_EditableEntityComponent entity, out
RplId entityRplId)
431 entityRplId = Replication.FindItemId(entity);
432 return entityRplId != -1;
436 private void DeSerializeEntities(
RplId hoveredEntityId, array<RplId> selectedEntityIds, out SCR_EditableEntityComponent hoveredEntityComponent, out set<SCR_EditableEntityComponent> selectedEntityComponents)
439 if (hoveredEntityId != -1)
441 if (!GetEditableEntityFromRplId(hoveredEntityId, hoveredEntityComponent))
442 Print(
string.Format(
"Hovered entity with RplID: %1 not found on server", hoveredEntityId),
LogLevel.NORMAL);
446 foreach (
RplId selectedEntityRplId : selectedEntityIds)
448 SCR_EditableEntityComponent selectedEntityComponent;
449 if (!GetEditableEntityFromRplId(selectedEntityRplId, selectedEntityComponent))
451 Print(
string.Format(
"Selected entity with RplID: %1 not found on server", selectedEntityRplId),
LogLevel.NORMAL );
454 selectedEntityComponents.Insert(selectedEntityComponent);
459 private bool GetEditableEntityFromRplId(
RplId entityRplId, out SCR_EditableEntityComponent editableEntityComponent)
461 Managed entityComponent = Replication.FindItem(entityRplId);
462 if (!entityComponent)
464 Print(
string.Format(
"Entity with RplID: %1 not found on server", entityRplId),
LogLevel.NORMAL);
468 editableEntityComponent = SCR_EditableEntityComponent.Cast(entityComponent);
469 return editableEntityComponent != null;
475 SCR_BaseActionsEditorComponentClass prefabData = SCR_BaseActionsEditorComponentClass.Cast(GetEditorComponentData());
479 SCR_EntitiesManagerEditorComponent entitiesManager = SCR_EntitiesManagerEditorComponent.Cast(SCR_EntitiesManagerEditorComponent.GetInstance(SCR_EntitiesManagerEditorComponent));
486 m_MenuLayoutManager = SCR_MenuLayoutEditorComponent.Cast(SCR_MenuLayoutEditorComponent.GetInstance(SCR_MenuLayoutEditorComponent));
494 SCR_BaseActionsEditorComponentClass prefabData = SCR_BaseActionsEditorComponentClass.Cast(GetEditorComponentData());
SCR_EAIThreatSectorFlags flags
ArmaReforgerScripted GetGame()
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
override void EOnEditorDeactivate()
SCR_BaseActionsEditorComponentClass m_HoverManager
bool ActionCanBePerformed(SCR_BaseEditorAction action, vector cursorWorldPosition, int flags)
void ActionPerformInstantlyNoDialog(SCR_BaseEditorAction action, vector cursorWorldPosition, int flags=0)
SCR_EditableEntityComponent m_HoveredEntity
void ActionPerformInstantly(SCR_BaseEditorAction action, int flags=0)
SCR_MenuLayoutEditorComponent m_MenuLayoutManager
void ActionPerformRpc(SCR_BaseEditorAction action, vector cursorWorldPosition, int flags, int param=-1)
int ValidateSelection(bool isInstant)
void ActionPerformServer(int actionIndex, RplId hoveredEntityID, array< RplId > selectedEntityIds, vector cursorWorldPosition, int flags, int param)
bool ActionCanBeShown(SCR_BaseEditorAction action, vector cursorWorldPosition, int flags)
SCR_BaseEditableEntityFilter m_SelectedManager
void ActionPerform(SCR_BaseEditorAction action, vector cursorWorldPosition, int flags)
SCR_EditableEntityComponent GetHoveredEntity()
void ActionPerformLocal(SCR_BaseEditorAction action, SCR_EditableEntityComponent hoveredEntityComponent, set< SCR_EditableEntityComponent > selectedEntityComponents, vector cursorWorldPosition, int flags, int param)
void ActionPerformOwner(int actionIndex, vector cursorWorldPosition, int flags, int param)
Server callback for when action is executed succesfully, calls PerformOwner function on action for e....
int GetAndEvaluateActions(vector cursorWorldPosition, out notnull array< ref SCR_EditorActionData > filteredActions, out int flags=0)
ref set< SCR_EditableEntityComponent > m_SelectedEntities
TraceFlags GetInstantActionTraceFlags()
RplComponent m_RplComponent
class SCR_CampaignHintStorage SCR_BaseContainerCustomTitleEnum(EHint, "m_eHintId")
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Replication item identifier.
int GetActions(out notnull array< SCR_BaseEditorAction > outActions)
void SCR_BaseActionsEditorComponentClass(IEntityComponentSource componentSource, IEntitySource parentSource, IEntitySource prefabSource)
int FindAction(SCR_BaseEditorAction action)
ref array< ref SCR_EditorActionGroup > m_ActionGroups
ref array< SCR_BaseEditorAction > m_ActionsSorted
void SetShortcuts(SCR_BaseActionsEditorComponent manager, bool toAdd)
ref array< ref SCR_EditorActionList > m_ActionsLists
SCR_BaseEditorAction GetAction(int index)
bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags)
void PerformOwner(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags, int param=-1)
void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags, int param=-1)
bool CanBePerformed(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags)
array< ref SCR_BaseEditorEffect > GetEffects()
EEditorActionGroup GetActionGroup()
bool CheckAndSetCooldown()
SCR_BaseEditableEntityFilter GetFilter(EEditableEntityState state, bool showError=false)
AIBaseUtilityComponentClass AIComponentClass EvaluateActions()
Evaluate all actions and return the highest evaluated action which is not suspended....
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
SCR_FieldOfViewSettings Attribute
RplRole
Role of replicated node (and all items in it) within the replication system.
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.