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

◆ SetElementTitle() [2/3]

void ScriptedWidgetEventHandler::SetElementTitle ( ButtonWidget btnWidget,
UAInput pInput,
int iDeviceFlags )
inlineprotected

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

66 {
67 string output;
68 int a, i, countbind = 0;
69
70 for( a = 0; a < pInput.AlternativeCount(); a++ )
71 {
72 pInput.SelectAlternative(a);
73 if( pInput.IsCombo() )
74 {
75 if( pInput.BindingCount() > 0 )
76 {
77 if( pInput.Binding(0) != 0 && pInput.CheckBindDevice(0,iDeviceFlags) )
78 {
79 if( countbind > 0 )
80 output += ", ";
81
82 output += GetUApi().GetButtonName( pInput.Binding(0) );
83 countbind++;
84
85 for( i = 1; i < pInput.BindingCount(); i++ )
86 {
87 if( pInput.Binding(i) != 0 )
88 {
89 output += " + " + GetUApi().GetButtonName( pInput.Binding(i) );
90 countbind++;
91 }
92 }
93
94 }
95 }
96 }
97 else
98 {
99 if( pInput.BindingCount() > 0 )
100 {
101 if( pInput.Binding(0) != 0 && pInput.CheckBindDevice(0,iDeviceFlags) )
102 {
103 if( countbind > 0 )
104 output += ", ";
105
106 output += GetUApi().GetButtonName( pInput.Binding(0) );
107 countbind++;
108 }
109 }
110 }
111 }
112
113 // nothing may be available - we do not want "null" or "0" in string
114 if( countbind > 0 )
115 btnWidget.SetText(output);
116 else
117 btnWidget.SetText("");
118 }
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().