Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ActionTooltipEditorUIComponent.c
Go to the documentation of this file.
1 
4 {
5  [Attribute()]
6  protected string m_sShortcutWidgetName;
7 
8  //------------------------------------------------------------------------------------------------
9  override bool SetTooltip(SCR_UIInfo info, Managed instance = null)
10  {
11  TextWidget shortcutWidget = TextWidget.Cast(GetWidget().FindAnyWidget(m_sShortcutWidgetName));
12  if (shortcutWidget)
13  {
14  string shortcut;
15  SCR_BaseEditorAction action = SCR_BaseEditorAction.Cast(instance);
16  if (action)
17  {
18  //--- Instance action
19  shortcut = action.GetShortcut();
20  }
21  else
22  {
23  //--- UI info action
24  SCR_InputActionUIInfo actionInfo = SCR_InputActionUIInfo.Cast(info);
25  if (actionInfo)
26  shortcut = actionInfo.GetActionName();
27  }
28 
29  if (!shortcut.IsEmpty())
30  {
31  shortcutWidget.SetText(string.Format("<action name='%1'/>", shortcut));
32  shortcutWidget.SetVisible(true);
33  }
34  else
35  {
36  shortcutWidget.SetVisible(false);
37  }
38  }
39 
40  return super.SetTooltip(info, instance);
41  }
42 }
SCR_InputActionUIInfo
Definition: SCR_InputActionUIInfo.c:2
SCR_BaseEditorAction
Definition: SCR_BaseEditorAction.c:24
SCR_BaseTooltipEditorUIComponent
Definition: SCR_BaseTooltipEditorUIComponent.c:3
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_UIInfo
Definition: SCR_UIInfo.c:7
SCR_ActionTooltipEditorUIComponent
Definition: SCR_ActionTooltipEditorUIComponent.c:3
GetWidget
protected Widget GetWidget()
Definition: SCR_VonDisplay.c:155