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

◆ GetControlMappingInfo()

array< ref JsonControlMappingInfo > UIScriptedMenu::GetControlMappingInfo ( )
inlineprotected

PC variant (also used for MSS build when mouse and keyboard are then active input device).

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

407 {
408 array<ref JsonControlMappingInfo> controlMappingInfo = new array<ref JsonControlMappingInfo>;
409 string filePath;
410
413 filePath = PATH_MOUSEKEY;
414 else
415 filePath = PATH_MOUSEKEY_720P;
416
417 string profileName = "";
418 m_Input.GetProfileName(m_Input.GetCurrentProfile(), profileName);
419
420 #ifdef PLATFORM_CONSOLE
421 bool controllerActive = m_Input.GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
422 if (controllerActive)
423 {
424 if (profileName == "#STR_UAPRESET_0" || profileName == "#STR_USER")
425 {
426 #ifdef PLATFORM_MSSTORE
428 filePath = PATH_X1_OLD;
429 else
430 filePath = PATH_X1_OLD_720P;
431 #endif
432 #ifdef PLATFORM_XBOX
434 filePath = PATH_X1_OLD;
435 else
436 filePath = PATH_X1_OLD_720P;
437 #endif
438 #ifdef PLATFORM_PS4
439 filePath = PATH_PS_OLD;
440 #endif
441 }
442 else if (profileName == "#STR_UAPRESET_1")
443 {
444 #ifdef PLATFORM_MSSTORE
446 filePath = PATH_X1_NEW;
447 else
448 filePath = PATH_X1_NEW_720p;
449 #endif
450 #ifdef PLATFORM_XBOX
452 filePath = PATH_X1_NEW;
453 else
454 filePath = PATH_X1_NEW_720p;
455 #endif
456 #ifdef PLATFORM_PS4
457 filePath = PATH_PS_NEW;
458 #endif
459 }
460 else
461 {
462 ErrorEx("Invalid file path!");
463 filePath = "";
464 }
465 }
466 #endif
467 FileHandle file_handle = OpenFile(filePath, FileMode.READ);
468 JsonSerializer js = new JsonSerializer();
469
470 string js_error = "";
471 string line_content = "";
472 string content = "";
473 if (file_handle)
474 {
475 while (FGets(file_handle, line_content) >= 0)
476 {
477 content += line_content;
478 }
479 CloseFile(file_handle);
480
481 if (js.ReadFromString(controlMappingInfo, content, js_error))
482 {
483 return controlMappingInfo;
484 }
485 else
486 {
487 ErrorEx("JSON ERROR => [TutorialsMenu]: " + js_error);
488 }
489 }
490 else
491 {
492 ErrorEx("FILEHANDLE ERROR => [TutorialsMenu]: " + js_error);
493 }
494
495 return controlMappingInfo;
496 }
proto bool ReadFromString(void variable_in, string jsonString, out string error)
Json string deserialization to script variable.
const string PATH_PS_OLD
Определения TutorialsMenu.c:9
const string PATH_MOUSEKEY
Определения TutorialsMenu.c:3
const string PATH_X1_NEW
Определения TutorialsMenu.c:7
bool m_LowResTutorialMode
Определения TutorialsMenu.c:35
const string PATH_PS_NEW
Определения TutorialsMenu.c:10
const string PATH_X1_NEW_720p
Определения TutorialsMenu.c:8
const string PATH_MOUSEKEY_720P
Определения TutorialsMenu.c:4
const string PATH_X1_OLD
Определения TutorialsMenu.c:5
Input m_Input
Определения TutorialsMenu.c:33
const string PATH_X1_OLD_720P
Определения TutorialsMenu.c:6
enum ShapeType ErrorEx
FileMode
Определения EnSystem.c:383
proto void CloseFile(FileHandle file)
Close the File.
proto int FGets(FileHandle file, string var)
Get line from file, every next call of this function returns next line.
proto FileHandle OpenFile(string name, FileMode mode)
Opens File.
int[] FileHandle
Определения EnSystem.c:390
EInputDeviceType
Определения input.c:3

Перекрестные ссылки CloseFile(), ErrorEx, FGets(), m_Input, m_LowResTutorialMode, OpenFile(), PATH_MOUSEKEY, PATH_MOUSEKEY_720P, PATH_PS_NEW, PATH_PS_OLD, PATH_X1_NEW, PATH_X1_NEW_720p, PATH_X1_OLD, PATH_X1_OLD_720P и JsonSerializer::ReadFromString().

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