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

Function Menu_OverActiveItem

code/ui/ui_shared.cpp:10002–10047  ·  view source on GitHub ↗

================= Menu_OverActiveItem ================= */

Source from the content-addressed store, hash-verified

10000=================
10001*/
10002static qboolean Menu_OverActiveItem(menuDef_t *menu, float x, float y)
10003{
10004 if (menu && menu->window.flags & (WINDOW_VISIBLE | WINDOW_FORCED))
10005 {
10006 if (Rect_ContainsPoint(&menu->window.rect, x, y))
10007 {
10008 int i;
10009 for (i = 0; i < menu->itemCount; i++)
10010 {
10011 // turn off focus each item
10012 // menu->items[i].window.flags &= ~WINDOW_HASFOCUS;
10013
10014 if (!(menu->items[i]->window.flags & (WINDOW_VISIBLE | WINDOW_FORCED)))
10015 {
10016 continue;
10017 }
10018
10019 if (menu->items[i]->window.flags & WINDOW_DECORATION)
10020 {
10021 continue;
10022 }
10023
10024 if (Rect_ContainsPoint(&menu->items[i]->window.rect, x, y))
10025 {
10026 itemDef_t *overItem = menu->items[i];
10027 if (overItem->type == ITEM_TYPE_TEXT && overItem->text)
10028 {
10029 if (Rect_ContainsPoint(&overItem->window.rect, x, y))
10030 {
10031 return qtrue;
10032 }
10033 else
10034 {
10035 continue;
10036 }
10037 }
10038 else
10039 {
10040 return qtrue;
10041 }
10042 }
10043 }
10044 }
10045 }
10046 return qfalse;
10047}
10048
10049/*
10050=================

Callers 1

Menus_HandleOOBClickFunction · 0.70

Calls 1

Rect_ContainsPointFunction · 0.70

Tested by

no test coverage detected