DayZ 1.28
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 строка 173

174 {
175 bool passed = true;
176 bool gamepad = IsActiveGamepadSelected();
177 bool mouse = IsMouseConnected();
178 bool keyboard = IsKeyboardConnected();
179 bool MnKEnabled;
180
181 if (g_Game.GetGameState() != DayZGameState.IN_GAME)
182 {
183 MnKEnabled = IsEnabledMouseAndKeyboard();
184 }
185 else if (g_Game.GetGameState() != DayZGameState.MAIN_MENU)
186 {
188 }
189 else
190 {
191 return true;
192 }
193
194 if (!MnKEnabled)
195 {
196 if (!gamepad)
197 {
198 passed = false;
199 FillUnavailableDeviceArray(EUAINPUT_DEVICE_CONTROLLER,unavailableDeviceList);
200 }
201 }
202 else
203 {
204 if (!gamepad)
205 {
206 if (!mouse)
207 {
208 passed = false;
209 FillUnavailableDeviceArray(EUAINPUT_DEVICE_MOUSE,unavailableDeviceList);
210 }
211 if (!keyboard)
212 {
213 passed = false;
214 FillUnavailableDeviceArray(EUAINPUT_DEVICE_KEYBOARD,unavailableDeviceList);
215 }
216
217 if (!passed)
218 {
219 FillUnavailableDeviceArray(EUAINPUT_DEVICE_CONTROLLER,unavailableDeviceList);
220 }
221 }
222 }
223 return passed;
224 }
DayZGame g_Game
Определения DayZGame.c:3868
void FillUnavailableDeviceArray(int device, inout array< int > filler)
Определения input.c:226
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().