9 float m_fActionIconScale;
11 protected RichTextWidget m_wText;
14 protected Widget m_wSeparator;
18 override void HandlerAttached(Widget w)
20 super.HandlerAttached(w);
22 m_wText = RichTextWidget.Cast(
m_wRoot.FindAnyWidget(
"Text"));
23 m_wSeparator =
m_wRoot.FindAnyWidget(
"Separator");
29 if (!
data || !
data.m_Entry || !
data.m_SettingsKeybindModule)
32 SCR_KeyBindingEntry entry =
data.m_Entry;
40 if (
data.m_eDevice == EInputDeviceType.GAMEPAD)
42 if (!entry.m_sActionNameGamepadOptional.IsEmpty())
43 actionName = entry.m_sActionNameGamepadOptional;
45 actionName = entry.m_sActionName;
47 if (!entry.m_sPresetGamepadOptional.IsEmpty())
48 preset = entry.m_sPresetGamepadOptional;
50 preset = entry.m_sPreset;
52 deviceString =
data.m_SettingsKeybindModule.GetGamepadDeviceString();
54 if (!preset.IsEmpty())
55 finalPreset =
data.m_SettingsKeybindModule.GetGamepadPresetPrefix()+preset;
57 else if (
data.m_eDevice == EInputDeviceType.KEYBOARD)
59 actionName = entry.m_sActionName;
60 preset = entry.m_sPreset;
61 deviceString =
data.m_SettingsKeybindModule.GetKeyboardDeviceString();
63 if (!preset.IsEmpty())
64 finalPreset =
data.m_SettingsKeybindModule.GetPrimaryPresetPrefix()+preset;
70 string binding =
string.Format(
71 "<action name='%1' preset='%2' device='%3' scale='%4' index='%5' state='%6'/>",
75 m_fActionIconScale.ToString(),
76 data.m_iIndex.ToString(),
80 m_wText.SetText(binding);
84 m_ActionDisplayData =
data;
87 m_wSeparator.SetVisible(
data.m_iIndex <
data.m_iLastIndex);
93 return m_ActionDisplayData;