26 [
Attribute(
"1",
desc:
"When disabled, the action will not appear in action list.\nUse to temporary hide actions without losing their configuration.")]
38 [
Attribute(
desc:
"Lower number is higher priority in the order")]
44 [
Attribute(defvalue:
"true",
desc:
"If false will not execute the shortcut via toolbar when pressed")]
48 protected ref array<ref SCR_BaseEditorEffect>
m_Effects;
53 [
Attribute(
"0",
desc:
"Cooldown to prevent spamming of action. Leave zero or less to ignore, time in seconds.",
params:
"0, inf, 0.05")]
61 [
Attribute(
"1",
desc:
"If true will show notification if trying to perform the action if the cooldown is active.")]
79 Print(
string.Format(
"CanBeShown condition method not overridden for action %1, action won't show",
Type()),
LogLevel.WARNING);
280class SCR_EditorActionData
283 private bool m_CanBePerformed;
287 return m_EditorAction;
290 bool GetCanBePerformed()
292 return m_CanBePerformed;
297 m_EditorAction = action;
298 m_CanBePerformed = canPerform;
315 //------------------------------------------------------------------------------------------------
316 static void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
318 snapshot.Serialize(packet, 4);
321 //------------------------------------------------------------------------------------------------
322 static bool Decode(ScriptBitSerializer packet, ScriptCtx ctx, SSnapSerializerBase snapshot)
324 return snapshot.Serialize(packet, 4);
327 //------------------------------------------------------------------------------------------------
328 static bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx ctx)
330 return lhs.CompareSnapshots(rhs, 4);
333 //------------------------------------------------------------------------------------------------
334 static bool PropCompare(SCR_BaseEditorActionParameters prop, SSnapSerializerBase snapshot, ScriptCtx ctx)
336 return snapshot.Compare(prop.m_iTestInt, 4);
339 //------------------------------------------------------------------------------------------------
340 static bool Extract(SCR_BaseEditorActionParameters prop, ScriptCtx ctx, SSnapSerializerBase snapshot)
342 snapshot.SerializeBytes(prop.m_iTestInt, 4);
347 //------------------------------------------------------------------------------------------------
348 static bool Inject(SSnapSerializerBase snapshot, ScriptCtx ctx, SCR_BaseEditorActionParameters prop)
350 snapshot.SerializeBytes(prop.m_iTestInt, 4);
355class SCR_ContextActionParameters : SCR_BaseEditorActionParameters
357 vector m_CursorWorldPosition = "100 100 100";
359 void SCR_ContextActionParameters(vector cursorWorldPosition)
361 m_CursorWorldPosition = cursorWorldPosition;
364 //################################################################################################
366 //------------------------------------------------------------------------------------------------
367 static override void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
369 snapshot.Serialize(packet, 16);
372 //------------------------------------------------------------------------------------------------
373 static override bool Decode(ScriptBitSerializer packet, ScriptCtx ctx, SSnapSerializerBase snapshot)
375 return snapshot.Serialize(packet, 16);
378 //------------------------------------------------------------------------------------------------
379 static override bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx ctx)
381 return lhs.CompareSnapshots(rhs, 16);
384 //------------------------------------------------------------------------------------------------
385 static bool PropCompare(SCR_ContextActionParameters prop, SSnapSerializerBase snapshot, ScriptCtx ctx)
387 return SCR_BaseEditorActionParameters.PropCompare(prop, snapshot, ctx)
388 && snapshot.Compare(prop.m_CursorWorldPosition[0], 4)
389 && snapshot.Compare(prop.m_CursorWorldPosition[1], 4)
390 && snapshot.Compare(prop.m_CursorWorldPosition[2], 4);
393 //------------------------------------------------------------------------------------------------
394 static bool Extract(SCR_ContextActionParameters prop, ScriptCtx ctx, SSnapSerializerBase snapshot)
396 SCR_BaseEditorActionParameters.Extract(prop, ctx, snapshot);
397 snapshot.SerializeBytes(prop.m_CursorWorldPosition[0], 4);
398 snapshot.SerializeBytes(prop.m_CursorWorldPosition[1], 4);
399 snapshot.SerializeBytes(prop.m_CursorWorldPosition[2], 4);
404 //------------------------------------------------------------------------------------------------
405 static bool Inject(SSnapSerializerBase snapshot, ScriptCtx ctx, SCR_ContextActionParameters prop)
407 SCR_BaseEditorActionParameters.Inject(snapshot, ctx, prop);
409 prop.m_CursorWorldPosition = vector.Zero;
410 snapshot.SerializeBytes(temp, 4);
411 prop.m_CursorWorldPosition[0] = temp;
412 snapshot.SerializeBytes(temp, 4);
413 prop.m_CursorWorldPosition[1] = temp;
414 snapshot.SerializeBytes(temp, 4);
415 prop.m_CursorWorldPosition[2] = temp;
420class SCR_WaypointActionParameters : SCR_ContextActionParameters
425class SCR_ToolbarActionParameters : SCR_ContextActionParameters
427 int m_iPlacedEntityId;
428 bool m_bShortcutTriggered;
430 void SCR_ToolbarActionParameters(vector cursorWorldPosition, bool shortcutTriggered = false, int placedEntityId = -1)
432 m_CursorWorldPosition = cursorWorldPosition;
433 m_iPlacedEntityId = placedEntityId;
434 m_bShortcutTriggered = shortcutTriggered;
437 //################################################################################################
439 //------------------------------------------------------------------------------------------------
440 static override void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
442 snapshot.Serialize(packet, 20);
445 //------------------------------------------------------------------------------------------------
446 static override bool Decode(ScriptBitSerializer packet, ScriptCtx ctx, SSnapSerializerBase snapshot)
448 return snapshot.Serialize(packet, 20);
451 //------------------------------------------------------------------------------------------------
452 static override bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx ctx)
454 return lhs.CompareSnapshots(rhs, 20);
457 //------------------------------------------------------------------------------------------------
458 static bool PropCompare(SCR_ToolbarActionParameters prop, SSnapSerializerBase snapshot, ScriptCtx ctx)
460 return SCR_ContextActionParameters.PropCompare(prop, snapshot, ctx)
461 && snapshot.Compare(prop.m_iPlacedEntityId, 4);
464 //------------------------------------------------------------------------------------------------
465 static bool Extract(SCR_ToolbarActionParameters prop, ScriptCtx ctx, SSnapSerializerBase snapshot)
467 SCR_ContextActionParameters.Extract(prop, ctx, snapshot);
468 snapshot.SerializeBytes(prop.m_iPlacedEntityId, 4);
472 //------------------------------------------------------------------------------------------------
473 static bool Inject(SSnapSerializerBase snapshot, ScriptCtx ctx, SCR_ToolbarActionParameters prop)
475 SCR_ContextActionParameters.Inject(snapshot, ctx, prop);
476 snapshot.SerializeBytes(prop.m_iPlacedEntityId, 4);
SCR_EAIThreatSectorFlags flags
ArmaReforgerScripted GetGame()
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
@ COMMAND_SPAWN_POINT
Spawn points in command bar.
@ COMMAND_TASK
Tasks in command bar.
@ COMMAND_WAYPOINT
Waypoints in command bar.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void AddShortcut(SCR_BaseActionsEditorComponent actionsManager)
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)
bool m_bShowOnCooldownNotification
EEditorActionType GetActionType()
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)
float m_fCooldownUpdateFreq
float m_fCurrentCooldownTime
void SetShortcutRef(string shortcutRef)
array< ref SCR_BaseEditorEffect > GetEffects()
ref array< ref SCR_BaseEditorEffect > m_Effects
EEditorActionGroup m_ActionGroup
bool m_bEnableShortcutLogics
EEditorActionType m_ActionType
EEditorActionGroup GetActionGroup()
SCR_BaseActionsEditorComponent m_ActionsManager
bool CheckAndSetCooldown()
void ~SCR_BaseEditorAction()
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
@ NONE
When Shape is created and not initialized yet.
SCR_FieldOfViewSettings Attribute
@ SIMULATION
dynamic bodies are colliding and are simulated
@ DYNAMIC
Include entities without enf::EntityFlags.TFL_STATIC.