Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ActionTooltipEditorUIComponent.c
Go to the documentation of this file.
1
2
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}
Widget GetWidget()
override bool SetTooltip(SCR_UIInfo info, Managed instance=null)
SCR_FieldOfViewSettings Attribute