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

Function Item_YesNo_HandleKey

code/ui/ui_shared.cpp:10731–10744  ·  view source on GitHub ↗

================= Item_YesNo_HandleKey ================= */

Source from the content-addressed store, hash-verified

10729=================
10730*/
10731qboolean Item_YesNo_HandleKey(itemDef_t *item, int key)
10732{
10733 if (Rect_ContainsPoint(&item->window.rect, DC->cursorx, DC->cursory) && item->window.flags & WINDOW_HASFOCUS && item->cvar)
10734 {
10735 if (key == A_MOUSE1 || key == A_ENTER || key == A_MOUSE2 || key == A_MOUSE3)
10736 {
10737 DC->setCVar(item->cvar, va("%i", !DC->getCVarValue(item->cvar)));
10738 return qtrue;
10739 }
10740 }
10741
10742 return qfalse;
10743
10744}
10745
10746/*
10747=================

Callers 1

Item_HandleKeyFunction · 0.70

Calls 2

Rect_ContainsPointFunction · 0.70
vaFunction · 0.50

Tested by

no test coverage detected