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

◆ AreAllAllowedInputDevicesActive()

bool Input::AreAllAllowedInputDevicesActive ( out array< int > unavailableDeviceList = null)
inlineprivate

returns true if 'Gamepad' or if 'Mouse/Keyboard' control is allowed locally and on server, and the respective input devicse are connected. Gamepad takes priority.

Аргументы
unavailableDeviceListlists all devices that SHOULD be available, but aren't. Optional.

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

166 {
167 bool passed = true;
168 bool gamepad = IsActiveGamepadSelected();
169 bool mouse = IsMouseConnected();
170 bool keyboard = IsKeyboardConnected();
171 bool MnKEnabled;
172
173 if (g_Game.GetGameState() != DayZGameState.IN_GAME)
174 {
175 MnKEnabled = IsEnabledMouseAndKeyboard();
176 }
177 else if (g_Game.GetGameState() != DayZGameState.MAIN_MENU)
178 {
180 }
181 else
182 {
183 return true;
184 }
185
186 if (!MnKEnabled)
187 {
188 if (!gamepad)
189 {
190 passed = false;
191 FillUnavailableDeviceArray(EUAINPUT_DEVICE_CONTROLLER,unavailableDeviceList);
192 }
193 }
194 else
195 {
196 if (!gamepad)
197 {
198 if (!mouse)
199 {
200 passed = false;
201 FillUnavailableDeviceArray(EUAINPUT_DEVICE_MOUSE,unavailableDeviceList);
202 }
203 if (!keyboard)
204 {
205 passed = false;
206 FillUnavailableDeviceArray(EUAINPUT_DEVICE_KEYBOARD,unavailableDeviceList);
207 }
208
209 if (!passed)
210 {
211 FillUnavailableDeviceArray(EUAINPUT_DEVICE_CONTROLLER,unavailableDeviceList);
212 }
213 }
214 }
215 return passed;
216 }
DayZGame g_Game
Определения DayZGame.c:3868
void FillUnavailableDeviceArray(int device, inout array< int > filler)
Определения input.c:218
proto native bool IsKeyboardConnected()
proto native bool IsActiveGamepadSelected()
returns true if there is an active gamepad selected.
proto native bool IsEnabledMouseAndKeyboard()
proto native bool IsEnabledMouseAndKeyboardEvenOnServer()
proto native bool IsMouseConnected()

Перекрестные ссылки FillUnavailableDeviceArray(), g_Game, IsActiveGamepadSelected(), IsEnabledMouseAndKeyboard(), IsEnabledMouseAndKeyboardEvenOnServer(), IsKeyboardConnected() и IsMouseConnected().

Используется в CGame::UpdateInputDeviceDisconnectWarning().