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

◆ OnKeyPress()

void PluginBase::OnKeyPress ( int key)
inlineprivate

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

133 {
134 //Print("OnKeyPress "+ key );
135
136 for ( int i = 0; i < m_KeyBindings.Count(); ++i )
137 {
138 KeyBinding key_binding = m_KeyBindings.Get(i);
139
140 if ( !IsCurrentUIPageValid( key_binding.GetUIMenuID() ) )
141 {
142 continue;
143 }
144
145 bool key1_match = false;
146 bool key2_match = false;
147
148 if ( key_binding.GetKey1() > -1 )
149 {
150 if ( IsKeyPressed(key_binding.GetKey1()) )
151 {
152 // Key1 is down
153 key1_match = true;
154 }
155 }
156 else
157 {
158 // Key1 is not set
159 key1_match = true;
160 }
161
162 if ( key_binding.GetKey2() > -1 )
163 {
164 if ( IsKeyPressed(key_binding.GetKey2()) )
165 {
166 // Key2 is down
167 key2_match = true;
168 }
169 }
170 else
171 {
172 // Key2 is not set
173 key2_match = true;
174 }
175
176 if ( key1_match && key2_match )
177 {
178 //Log( "Call Method -> key press: " + itoa(key) + " " + key_binding.GetInfoDescription() );
179
180 PluginBase m = GetPlugin(key_binding.GetCallbackTarget().ToType());
181 g_Game.GameScript.CallFunction(m, key_binding.GetCallbackFunction(), NULL, 0);
182
183 break;
184 }
185 }
186 }
DayZGame g_Game
Определения DayZGame.c:4074
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:326
string GetCallbackFunction()
Определения KeyBinding.c:42
int GetKey1()
Определения KeyBinding.c:27
int GetKey2()
Определения KeyBinding.c:32
int GetUIMenuID()
Определения KeyBinding.c:22
string GetCallbackTarget()
Определения KeyBinding.c:37
void PluginBase()
ref array< ref KeyBinding > m_KeyBindings
Определения PluginKeyBinding.c:287
bool IsCurrentUIPageValid(int ui_page_request)
Определения PluginKeyBinding.c:310
bool IsKeyPressed(int key)
Определения PluginKeyBinding.c:380
proto native ToType()
Returns internal type representation. Can be used in runtime, or cached in variables and used for fas...

Перекрестные ссылки g_Game, KeyBinding::GetCallbackFunction(), KeyBinding::GetCallbackTarget(), KeyBinding::GetKey1(), KeyBinding::GetKey2(), GetPlugin(), KeyBinding::GetUIMenuID(), IsCurrentUIPageValid(), IsKeyPressed(), m_KeyBindings, PluginBase() и string::ToType().