Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
EditorBrowserDialogUI.c
Go to the documentation of this file.
1 
4 {
5  const string WIDGET_BUTTON_CLOSE = "CloseButton";
6 
7  protected void CloseWithoutPlacing()
8  {
10  if (placingManager)
11  {
12  placingManager.SetPlacingFlag(EEditorPlacingFlags.CHARACTER_PLAYER, false);
13  placingManager.SetInstantPlacing(null);
14  }
15 
16  CloseSelf();
17  }
18 
19  override void OnMenuOpen()
20  {
21  Widget rootWidget = GetRootWidget();
22  if (!rootWidget) return;
23 
24  ScriptInvoker onClose = ButtonActionComponent.GetOnAction(rootWidget, WIDGET_BUTTON_CLOSE);
25  if (onClose) onClose.Insert(CloseWithoutPlacing);
26 
28  if (placingManager)
29  {
30  SCR_EditorManagerEntity editorManager = placingManager.GetManager();
31  if (editorManager)
32  editorManager.GetOnDeactivate().Insert(CloseWithoutPlacing);
33  }
34 
35  InputManager inputManager = GetGame().GetInputManager();
36  if (inputManager)
37  inputManager.AddActionListener("EditorContentBrowserClose", EActionTrigger.DOWN, CloseWithoutPlacing);
38  }
39  override void OnMenuClose()
40  {
42  if (placingManager)
43  {
44  SCR_EditorManagerEntity editorManager = placingManager.GetManager();
45  if (editorManager)
46  editorManager.GetOnDeactivate().Remove(CloseWithoutPlacing);
47  }
48  InputManager inputManager = GetGame().GetInputManager();
49  if (inputManager)
50  inputManager.RemoveActionListener("EditorContentBrowserClose", EActionTrigger.DOWN, CloseWithoutPlacing);
51  }
52 };
EditorBrowserDialogUI
Definition: EditorBrowserDialogUI.c:3
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
GetRootWidget
Widget GetRootWidget()
Definition: SCR_UITaskManagerComponent.c:160
EditorMenuBase
Definition: EditorMenuBase.c:7
EEditorPlacingFlags
EEditorPlacingFlags
Definition: EEditorPlacingFlags.c:1
ButtonActionComponent
Component to execute action when the button or its shortcut is pressed.
Definition: ButtonActionComponent.c:2
SCR_PlacingEditorComponent
Definition: SCR_PlacingEditorComponent.c:118
SCR_EditorManagerEntity
Definition: SCR_EditorManagerEntity.c:26