Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ContextMenuButtonEditorUIComponent.c
Go to the documentation of this file.
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 {
22 SCR_ButtonTextComponent buttonTextComponent = SCR_ButtonTextComponent.Cast(m_RootWidget.FindHandler(SCR_ButtonTextComponent));
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}
bool SetIconTo(ImageWidget imageWidget)
Definition SCR_UIInfo.c:102
SCR_FieldOfViewSettings Attribute