DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ SetElementTitle() [3/3]

bool ScriptedWidgetEventHandler::SetElementTitle ( UAInput pInput,
int iDeviceFlags,
out string output )
inlineprotected

assemble all active bindings at widget element

См. определение в файле ControlMappingKeybinds.c строка 74

75 {
76 int a, i, countbind = 0;
77
78 for (a = 0; a < pInput.AlternativeCount(); a++)
79 {
80 pInput.SelectAlternative(a);
81 if (pInput.IsCombo())
82 {
83 if (pInput.BindingCount() > 0)
84 {
85 if (pInput.Binding(0) != 0 && pInput.CheckBindDevice(0,iDeviceFlags))
86 {
87 if (countbind > 0)
88 output += ", ";
89
90 output += GetUApi().GetButtonName(pInput.Binding(0));
91 countbind++;
92
93 for (i = 1; i < pInput.BindingCount(); i++)
94 {
95 if (pInput.Binding(i) != 0)
96 {
97 output += " + " + GetUApi().GetButtonName(pInput.Binding(i));
98 countbind++;
99 }
100 }
101
102 }
103 }
104 }
105 else
106 {
107 if (pInput.BindingCount() > 0)
108 {
109 if (pInput.Binding(0) != 0 && pInput.CheckBindDevice(0,iDeviceFlags))
110 {
111 if (countbind > 0)
112 output += ", ";
113
114 output += GetUApi().GetButtonName(pInput.Binding(0));
115 countbind++;
116 }
117 }
118 }
119
120 }
121
122 return (countbind > 0);
123 }
proto native UAInputAPI GetUApi()
proto native int Binding(int iIndex)
proto native int BindingCount()
proto native int AlternativeCount()
proto native owned string GetButtonName(int iHash)
proto native void SelectAlternative(int iIndex)
proto native bool IsCombo()
proto native bool CheckBindDevice(int iIndex, int iDeviceFlags)

Перекрестные ссылки UAInput::AlternativeCount(), UAInput::Binding(), UAInput::BindingCount(), UAInput::CheckBindDevice(), UAInputAPI::GetButtonName(), GetUApi(), UAInput::IsCombo() и UAInput::SelectAlternative().

Используется в Reload() и TutorialKeybinds().