DayZ 1.30
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 строка 113

114 {
115 int a, i, countbind = 0;
116
117 for (a = 0; a < pInput.AlternativeCount(); a++)
118 {
119 pInput.SelectAlternative(a);
120 if (pInput.IsCombo())
121 {
122 if (pInput.BindingCount() > 0)
123 {
124 if (pInput.Binding(0) != 0 && pInput.CheckBindDevice(0,iDeviceFlags))
125 {
126 if (countbind > 0)
127 output += ", ";
128
129 output += GetUApi().GetButtonName(pInput.Binding(0));
130 countbind++;
131
132 for (i = 1; i < pInput.BindingCount(); i++)
133 {
134 if (pInput.Binding(i) != 0)
135 {
136 output += " + " + GetUApi().GetButtonName(pInput.Binding(i));
137 countbind++;
138 }
139 }
140
141 }
142 }
143 }
144 else
145 {
146 if (pInput.BindingCount() > 0)
147 {
148 if (pInput.Binding(0) != 0 && pInput.CheckBindDevice(0,iDeviceFlags))
149 {
150 if (countbind > 0)
151 output += ", ";
152
153 output += GetUApi().GetButtonName(pInput.Binding(0));
154 countbind++;
155 }
156 }
157 }
158
159 }
160
161 return (countbind > 0);
162 }
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().

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