MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Menus_HandleOOBClick

Function Menus_HandleOOBClick

code/ui/ui_shared.cpp:10122–10157  ·  view source on GitHub ↗

================= Menus_HandleOOBClick ================= */

Source from the content-addressed store, hash-verified

10120=================
10121*/
10122void 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=================

Callers 1

Menu_HandleKeyFunction · 0.70

Calls 6

Menu_RunCloseScriptFunction · 0.70
Menu_OverActiveItemFunction · 0.70
Menu_HandleMouseMoveFunction · 0.70
Menu_HandleKeyFunction · 0.70
Display_VisibleMenuCountFunction · 0.70
Display_CloseCinematicsFunction · 0.70

Tested by

no test coverage detected