| 560 | } |
| 561 | } |
| 562 | bool CUIPdaWnd::OnKeyboard(int dik, EUIMessages keyboard_action) |
| 563 | { |
| 564 | if (WINDOW_KEY_PRESSED == keyboard_action && IsShown()) |
| 565 | { |
| 566 | if (psActorFlags.test(AF_3D_PDA)) |
| 567 | { |
| 568 | CPda* pda = Actor()->GetPDA(); |
| 569 | if (pda && pda->Is3DPDA()) |
| 570 | { |
| 571 | EGameActions action = get_binded_action(dik); |
| 572 | |
| 573 | if (action == kQUIT) // "Hack" to make Esc key open main menu instead of simply hiding the PDA UI |
| 574 | { |
| 575 | if (pda->GetState() == CPda::eHiding || pda->GetState() == CPda::eHidden) |
| 576 | { |
| 577 | Console->Execute("main_menu"); |
| 578 | return false; |
| 579 | } |
| 580 | else if (pda->m_bZoomed) |
| 581 | { |
| 582 | pda->m_bZoomed = false; |
| 583 | HUD().GetUI()->SetMainInputReceiver(nullptr, false); |
| 584 | return true; |
| 585 | } |
| 586 | else |
| 587 | { |
| 588 | Actor()->inventory().Activate(NO_ACTIVE_SLOT); |
| 589 | return true; |
| 590 | } |
| 591 | } |
| 592 | } |
| 593 | } |
| 594 | } |
| 595 | return inherited::OnKeyboard(dik, keyboard_action); |
| 596 | } |
nothing calls this directly
no test coverage detected