Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ContextMenuButtonEditorUIComponent.c
Go to the documentation of this file.
1 class SCR_ContextMenuButtonEditorUIComponent : ScriptedWidgetComponent
2 {
3  [Attribute()]
4  string m_sButtonName;
5 
6  [Attribute()]
7  string m_sButtonIconName;
8 
9  [Attribute()]
10  string m_sShortcutTextName;
11 
12  private Widget m_RootWidget;
13  private ImageWidget m_ButtonIconWidget;
14  private TextWidget m_ShortcutTextWidget;
15 
16  //------------------------------------------------------------------------------------------------
20  void SetData(SCR_UIInfo info, string shortcutAction, bool canBePerformed)
21  {
23  buttonTextComponent.SetText(info.GetName());
24  buttonTextComponent.SetEnabled(canBePerformed);
25  info.SetIconTo(m_ButtonIconWidget);
26  SetShortcutText(shortcutAction);
27  }
28 
29  //------------------------------------------------------------------------------------------------
30  protected void SetShortcutText(string shortcutAction)
31  {
32  string shortcutText = string.Empty;
33  if (shortcutAction != string.Empty)
34  {
35  shortcutText = string.Format("<action name='%1'/>", shortcutAction);
36  }
37 
38  m_ShortcutTextWidget.SetText(shortcutText);
39  }
40 
41  //------------------------------------------------------------------------------------------------
42  override void HandlerAttached(Widget w)
43  {
44  m_RootWidget = w;
45  m_ButtonIconWidget = ImageWidget.Cast(w.FindAnyWidget(m_sButtonIconName));
46  m_ShortcutTextWidget = TextWidget.Cast(w.FindAnyWidget(m_sShortcutTextName));
47  }
48 }
m_RootWidget
protected Widget m_RootWidget
Definition: SCR_BinocularsComponent.c:10
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_ContextMenuButtonEditorUIComponent
Definition: SCR_ContextMenuButtonEditorUIComponent.c:1
SCR_ButtonTextComponent
Definition: SCR_ButtonTextComponent.c:2
SCR_UIInfo
Definition: SCR_UIInfo.c:7