================= Menus_HandleOOBClick ================= */
| 10120 | ================= |
| 10121 | */ |
| 10122 | void Menus_HandleOOBClick(menuDef_t *menu, int key, qboolean down) |
| 10123 | { |
| 10124 | if (menu) |
| 10125 | { |
| 10126 | int i; |
| 10127 | // basically the behaviour we are looking for is if there are windows in the stack.. see if |
| 10128 | // the cursor is within any of them.. if not close them otherwise activate them and pass the |
| 10129 | // key on.. force a mouse move to activate focus and script stuff |
| 10130 | if (down && menu->window.flags & WINDOW_OOB_CLICK) |
| 10131 | { |
| 10132 | Menu_RunCloseScript(menu); |
| 10133 | menu->window.flags &= ~(WINDOW_HASFOCUS | WINDOW_VISIBLE); |
| 10134 | } |
| 10135 | |
| 10136 | for (i = 0; i < menuCount; i++) |
| 10137 | { |
| 10138 | if (Menu_OverActiveItem(&Menus[i], DC->cursorx, DC->cursory)) |
| 10139 | { |
| 10140 | Menu_RunCloseScript(menu); |
| 10141 | menu->window.flags &= ~(WINDOW_HASFOCUS | WINDOW_VISIBLE); |
| 10142 | // Menus_Activate(&Menus[i]); |
| 10143 | Menu_HandleMouseMove(&Menus[i], DC->cursorx, DC->cursory); |
| 10144 | Menu_HandleKey(&Menus[i], key, down); |
| 10145 | } |
| 10146 | } |
| 10147 | |
| 10148 | if (Display_VisibleMenuCount() == 0) |
| 10149 | { |
| 10150 | if (DC->Pause) |
| 10151 | { |
| 10152 | DC->Pause(qfalse); |
| 10153 | } |
| 10154 | } |
| 10155 | Display_CloseCinematics(); |
| 10156 | } |
| 10157 | } |
| 10158 | |
| 10159 | /* |
| 10160 | ================= |
no test coverage detected