| 109 | extern bool g_block_all_except_movement; |
| 110 | |
| 111 | void CLevel::IR_OnKeyboardPress(int key) |
| 112 | { |
| 113 | if (CImGuiEditor::Get().Editor_KeyPress(key)) |
| 114 | return; |
| 115 | |
| 116 | if (GamePersistent().OnKeyboardPress(key)) |
| 117 | return; |
| 118 | |
| 119 | EGameActions _curr = get_binded_action(key); |
| 120 | |
| 121 | if (m_blocked_actions.find(_curr) != m_blocked_actions.end()) |
| 122 | return; // Real Wolf. 14.10.2014 |
| 123 | |
| 124 | const bool b_ui_exist = (Has_HUD() && HUD().GetUI()); |
| 125 | |
| 126 | switch (_curr) |
| 127 | { |
| 128 | case kSCREENSHOT: |
| 129 | Render->Screenshot(); |
| 130 | return; |
| 131 | |
| 132 | case kCONSOLE: |
| 133 | Console->Show(); |
| 134 | return; |
| 135 | |
| 136 | case kQUIT: { |
| 137 | if (b_ui_exist && HUD().GetUI()->MainInputReceiver()) |
| 138 | { |
| 139 | if (HUD().GetUI()->MainInputReceiver()->IR_OnKeyboardPress(key)) |
| 140 | return; // special case for mp and main_menu |
| 141 | |
| 142 | if (MainMenu()->IsActive() || !Device.Paused()) |
| 143 | HUD().GetUI()->StartStopMenu(HUD().GetUI()->MainInputReceiver(), true); |
| 144 | } |
| 145 | else |
| 146 | Console->Execute("main_menu"); |
| 147 | return; |
| 148 | } |
| 149 | |
| 150 | case kPAUSE: |
| 151 | if (!g_block_pause) |
| 152 | { |
| 153 | Device.Pause(!Device.Paused(), TRUE, TRUE, "li_pause_key"); |
| 154 | } |
| 155 | return; |
| 156 | } |
| 157 | |
| 158 | if (g_bDisableAllInput) |
| 159 | return; |
| 160 | |
| 161 | if (g_block_all_except_movement) |
| 162 | { |
| 163 | if (!(_curr < kCAM_1 || _curr == kPAUSE || _curr == kSCREENSHOT || _curr == kQUIT || _curr == kCONSOLE)) |
| 164 | return; |
| 165 | } |
| 166 | |
| 167 | if (!b_ui_exist) |
| 168 | return; |
nothing calls this directly
no test coverage detected