Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_TaskListFocus.c
Go to the documentation of this file.
1 class SCR_TaskListFocusComponent : ScriptedWidgetComponent
2 {
3  //------------------------------------------------------------------------------------------------
4  override void HandlerAttached(Widget w)
5  {
6  if (GetGame().GetInputManager().IsUsingMouseAndKeyboard())
7  return;
8 
9  SetMapContextAllowed(false);
10  }
11 
12  //------------------------------------------------------------------------------------------------
13  override bool OnMouseEnter(Widget w, int x, int y)
14  {
15  SetMapContextAllowed(false);
16  return false;
17  }
18 
19  //------------------------------------------------------------------------------------------------
20  override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
21  {
22  if (enterW)
23  {
24  // enterW is null in map, but in deploy menu mouse enters a root widget of deploy screen so to filter it out we check if the enterW has a deployHandler.
25  SCR_DeployMenuHandler deployMenu = SCR_DeployMenuHandler.Cast(enterW.FindHandler(SCR_DeployMenuHandler));
26  if (!deployMenu)
27  return false;
28  }
29 
30  SetMapContextAllowed(true);
31  return false;
32  }
33 
34  //------------------------------------------------------------------------------------------------
35  private void SetMapContextAllowed(bool val)
36  {
37  SCR_MapEntity mapEntity = SCR_MapEntity.GetMapInstance();
38  if (!mapEntity)
39  return;
40 
41  SCR_MapTaskListUI taskListUI = SCR_MapTaskListUI.Cast(mapEntity.GetMapUIComponent(SCR_MapTaskListUI));
42  if (!taskListUI)
43  return;
44 
45  taskListUI.SetMapContextAllowed(val);
46  }
47 }
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_DeployMenuHandler
Definition: SCR_DeployMenuHandler.c:6
SCR_TaskListFocusComponent
Definition: SCR_TaskListFocus.c:1
SCR_MapEntity
Map entity.
Definition: SCR_MapEntity.c:20
SCR_MapTaskListUI
Definition: SCR_MapTaskListUI.c:1
GetInputManager
protected InputManager GetInputManager()
Definition: SCR_BaseManualCameraComponent.c:65