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

Function Menu_ClearFocus

code/ui/ui_shared.cpp:1727–1749  ·  view source on GitHub ↗

================= Menu_ClearFocus ================= */

Source from the content-addressed store, hash-verified

1725=================
1726*/
1727itemDef_t *Menu_ClearFocus(menuDef_t *menu)
1728{
1729 int i;
1730 itemDef_t *ret = NULL;
1731
1732 if (menu == NULL)
1733 {
1734 return NULL;
1735 }
1736 for (i = 0; i < menu->itemCount; i++)
1737 {
1738 if (menu->items[i]->window.flags & WINDOW_HASFOCUS)
1739 {
1740 ret = menu->items[i];
1741 menu->items[i]->window.flags &= ~WINDOW_HASFOCUS;
1742 if (menu->items[i]->leaveFocus)
1743 {
1744 Item_RunScript(menu->items[i], menu->items[i]->leaveFocus);
1745 }
1746 }
1747 }
1748 return ret;
1749}
1750
1751// Set all the items within a given menu, with the given itemName, to the given shader
1752void Menu_SetItemBackground(const menuDef_t *menu,const char *itemName, const char *background)

Callers 2

Script_SetFocusFunction · 0.70
Item_SetFocusFunction · 0.70

Calls 1

Item_RunScriptFunction · 0.70

Tested by

no test coverage detected