Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_BaseTooltipTargetEditorUIComponent.c
Go to the documentation of this file.
1 
4 {
5  [Attribute("0", UIWidgets.ComboBox, "", enums: ParamEnumArray.FromEnum(EEditorTooltip))]
6  protected EEditorTooltip m_TooltipType;
7 
8 // //------------------------------------------------------------------------------------------------
9 // EEditorTooltip GetTooltipType()
10 // {
11 // return m_TooltipType;
12 // }
13 
14  //------------------------------------------------------------------------------------------------
15  void SetTooltipType(EEditorTooltip tooltipType)
16  {
17  m_TooltipType = tooltipType;
18  }
19 
20  //------------------------------------------------------------------------------------------------
21  protected SCR_UIInfo GetInfo();
22 
23  //------------------------------------------------------------------------------------------------
24  protected Managed GetTarget();
25 
26  //------------------------------------------------------------------------------------------------
27  protected void ShowTooltip()
28  {
29  SCR_TooltipManagerEditorUIComponent tooltipManager = SCR_TooltipManagerEditorUIComponent.Cast(GetRootComponent().FindComponent(SCR_TooltipManagerEditorUIComponent, true));
30  if (tooltipManager)
31  tooltipManager.SetInfo(GetInfo(), m_TooltipType, GetTarget());
32  }
33 
34  //------------------------------------------------------------------------------------------------
35  protected void HideTooltip()
36  {
37  if (!GetInfo())
38  return;
39 
41  if (tooltipManager)
42  tooltipManager.ResetInfo(GetInfo());
43  }
44 
45  //------------------------------------------------------------------------------------------------
46  protected void RefreshTooltip()
47  {
48  SCR_TooltipManagerEditorUIComponent tooltipManager = SCR_TooltipManagerEditorUIComponent.Cast(GetRootComponent().FindComponent(SCR_TooltipManagerEditorUIComponent, true));
49  if (tooltipManager)
50  tooltipManager.RefreshInfo(GetInfo(), m_TooltipType, GetTarget());
51  }
52 
53  //------------------------------------------------------------------------------------------------
54  override bool OnFocus(Widget w, int x, int y)
55  {
56  ShowTooltip();
57  return false;
58  }
59 
60  //------------------------------------------------------------------------------------------------
61  override bool OnFocusLost(Widget w, int x, int y)
62  {
63  HideTooltip();
64  return false;
65  }
66 
67  //------------------------------------------------------------------------------------------------
68  override bool OnMouseEnter(Widget w, int x, int y)
69  {
70  return OnFocus(w, x, y);
71  }
72 
73  //------------------------------------------------------------------------------------------------
74  override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
75  {
76  return OnFocusLost(w, x, y);
77  }
78 
79  //------------------------------------------------------------------------------------------------
80  override bool IsUnique()
81  {
82  return false;
83  }
84 
85  //------------------------------------------------------------------------------------------------
86  override void HandlerDeattached(Widget w)
87  {
88  if (GetRootComponent())
89  HideTooltip();
90 
91  super.HandlerDeattached(w);
92  }
93 }
EEditorTooltip
EEditorTooltip
Definition: SCR_TooltipManagerEditorUIComponent.c:397
GetInfo
override SCR_UIInfo GetInfo(IEntity owner=null)
Definition: SCR_EditablePlayerDelegateComponent.c:140
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_UIInfo
Definition: SCR_UIInfo.c:7
SCR_BaseEditorUIComponent
Definition: SCR_BaseEditorUIComponent.c:3
SCR_TooltipManagerEditorUIComponent
Definition: SCR_TooltipManagerEditorUIComponent.c:3
SCR_BaseTooltipTargetEditorUIComponent
Definition: SCR_BaseTooltipTargetEditorUIComponent.c:3