5 protected InputManager m_InputManager;
16 protected vector m_vClickTransform[4];
17 protected bool m_bClicked;
20 override void OnHoverChange(
EEditableEntityState state, set<SCR_EditableEntityComponent> entitiesInsert, set<SCR_EditableEntityComponent> entitiesRemove)
23 super.OnHoverChange(state, entitiesInsert, entitiesRemove);
27 override void OnEditorTransformRotationModifierUp(
float value, EActionTrigger reason)
30 super.OnEditorTransformRotationModifierUp(value, reason);
34 protected void OnEditorTransformToggleDown(
float value, EActionTrigger reason)
36 if (m_TransformingManager.IsEditing())
39 OnEditorTransformDown(value, reason);
43 protected void OnEditorTransformDown(
float value, EActionTrigger reason)
49 if (m_EntityToolbar && m_EntityToolbar.IsUnderCursor() &&
m_InputManager.GetActionTriggered(
"EditorTransformRotateYawModifier"))
59 m_HoverEntity.GetOwner().GetWorldTransform(m_vClickTransform);
81 m_vClickTransform[3] = worldPos;
91 protected void OnEditorCancelTransformingUp(
float value, EActionTrigger reason)
98 protected void StartEditing()
104 if (!m_SelectedFilter.Contains(m_ActiveHoverEntity))
105 m_SelectedFilter.Replace(m_ActiveHoverEntity);
108 set<SCR_EditableEntityComponent> entities =
new set<SCR_EditableEntityComponent>();
109 m_SelectedFilter.GetEntities(entities);
112 m_TransformingManager.StartEditing(
m_HoverEntity, entities, m_vClickTransform);
116 protected void ConfirmEditing()
118 if (!m_TransformingManager.IsEditing() && !m_bClicked)
135 if (!m_TransformingManager.ConfirmEditing())
138 m_TransformingManager.CancelEditing();
143 protected void CancelEditing()
145 if (!m_bClicked && !m_TransformingManager.IsEditing())
148 if (m_TransformingManager)
149 m_TransformingManager.CancelEditing();
155 protected void Clean()
160 m_ActiveHoverEntity =
null;
164 protected void OnTransformationEnd()
170 protected void OnInputDeviceIsGamepad(
bool isGamepad)
180 protected void OnMenuUpdate(
float tDelta)
213 override void HandlerAttachedScripted(Widget w)
215 super.HandlerAttachedScripted(w);
225 if (!m_TransformingManager)
228 m_TransformingManager.GetOnTransformationConfirm().Insert(OnTransformationEnd);
229 m_TransformingManager.GetOnTransformationCancel().Insert(OnTransformationEnd);
250 menu.GetOnMenuUpdate().Insert(OnMenuUpdate);
251 menu.GetOnMenuFocusGained().Insert(Clean);
254 ArmaReforgerScripted game =
GetGame();
261 m_InputManager.AddActionListener(
"EditorTransform", EActionTrigger.DOWN, OnEditorTransformDown);
262 m_InputManager.AddActionListener(
"EditorTransform", EActionTrigger.UP, ConfirmEditing);
264 m_InputManager.AddActionListener(
"EditorTransformToggle", EActionTrigger.DOWN, OnEditorTransformToggleDown);
268 m_InputManager.AddActionListener(
"EditorConfirmTransforming", EActionTrigger.DOWN, ConfirmEditing);
269 m_InputManager.AddActionListener(
"EditorCancelTransforming", EActionTrigger.DOWN, OnCancelDown);
270 m_InputManager.AddActionListener(
"EditorCancelTransforming", EActionTrigger.UP, OnEditorCancelTransformingUp);
273 game.OnInputDeviceIsGamepadInvoker().Insert(OnInputDeviceIsGamepad);
281 void OnMapOpen(MapConfiguration config)
287 override void HandlerDeattached(Widget w)
289 super.HandlerDeattached(w);
291 if (m_TransformingManager)
293 m_TransformingManager.GetOnTransformationConfirm().Remove(OnTransformationEnd);
294 m_TransformingManager.GetOnTransformationCancel().Remove(OnTransformationEnd);
300 menu.GetOnMenuUpdate().Remove(OnMenuUpdate);
301 menu.GetOnMenuFocusGained().Remove(Clean);
304 ArmaReforgerScripted game =
GetGame();
309 m_InputManager.RemoveActionListener(
"EditorTransform", EActionTrigger.DOWN, OnEditorTransformDown);
310 m_InputManager.RemoveActionListener(
"EditorTransform", EActionTrigger.UP, ConfirmEditing);
312 m_InputManager.RemoveActionListener(
"EditorTransformToggle", EActionTrigger.DOWN, OnEditorTransformToggleDown);
316 m_InputManager.RemoveActionListener(
"EditorConfirmTransforming", EActionTrigger.DOWN, ConfirmEditing);
317 m_InputManager.RemoveActionListener(
"EditorCancelTransforming", EActionTrigger.DOWN, OnCancelDown);
318 m_InputManager.RemoveActionListener(
"EditorCancelTransforming", EActionTrigger.UP, OnEditorCancelTransformingUp);
321 game.OnInputDeviceIsGamepadInvoker().Remove(OnInputDeviceIsGamepad);
331 if (m_TransformingManager.CanBeTransformed())