Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_TaskOverlayButton.c
Go to the documentation of this file.
1 class SCR_TaskOverlayButton : ScriptedWidgetComponent
2 {
3  protected SCR_MapUITask m_MapUiTask;
4 
5 
6  //------------------------------------------------------------------------------------------------
7  override event bool OnMouseEnter(Widget w, int x, int y)
8  {
9  if (m_MapUiTask && m_MapUiTask.m_wHorizLayout && !m_MapUiTask.m_wHorizLayout.IsEnabled()) // buttons are disabled
10  m_MapUiTask.m_wHorizLayout.SetEnabled(true);
11 
12  return false;
13  }
14 
15  //------------------------------------------------------------------------------
16  override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
17  {
18  if (!m_MapUiTask)
19  return false;
20 
21  ButtonWidget assignButton = ButtonWidget.Cast(m_MapUiTask.GetMapWidget().FindAnyWidget("TaskTitleButton"));
22  Widget overlayWidget = m_MapUiTask.GetMapWidget().FindAnyWidget("OverlayWidget");
23  Widget assignee = Widget.Cast(m_MapUiTask.GetMapWidget().FindAnyWidget("Assignee"));
24  Widget iconHover = Widget.Cast(m_MapUiTask.GetMapWidget().FindAnyWidget("TaskIconHover"));
25 
26  if (!assignButton || !overlayWidget || !assignee || !iconHover)
27  return false;
28 
29  if (enterW != overlayWidget && enterW != assignButton)
30  {
31  assignButton.SetVisible(false);
32 
33  assignee.SetEnabled(false);
34  assignee.SetOpacity(0);
35 
36  iconHover.SetEnabled(false);
37  iconHover.SetOpacity(0);
38 
39  m_MapUiTask.m_wHorizLayout.SetEnabled(false);
40  }
41 
42  return false;
43  }
44 
45  //------------------------------------------------------------------------------
46  void SetRootWidgetHandler(SCR_MapUITask mapUiTask)
47  {
48  m_MapUiTask = mapUiTask;
49  }
50 };
SCR_TaskOverlayButton
Definition: SCR_TaskOverlayButton.c:1
SCR_MapUITask
Definition: SCR_MapUITask.c:2