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

Function Menu_SetItemBackground

code/ui/ui_shared.cpp:1752–1773  ·  view source on GitHub ↗

Set all the items within a given menu, with the given itemName, to the given shader

Source from the content-addressed store, hash-verified

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)
1753{
1754 itemDef_t *item;
1755 int j, count;
1756
1757 if (!menu) // No menu???
1758 {
1759 return;
1760 }
1761
1762 count = Menu_ItemsMatchingGroup( (menuDef_t *) menu, itemName);
1763
1764 for (j = 0; j < count; j++)
1765 {
1766 item = Menu_GetMatchingItemByNumber( (menuDef_t *) menu, j, itemName);
1767 if (item != NULL)
1768 {
1769// item->window.background = DC->registerShaderNoMip(background);
1770 item->window.background = ui.R_RegisterShaderNoMip(background);
1771 }
1772 }
1773}
1774
1775// Set all the items within a given menu, with the given itemName, to the given text
1776void Menu_SetItemText(const menuDef_t *menu,const char *itemName, const char *text)

Callers 1

Script_SetItemBackgroundFunction · 0.70

Calls 2

Menu_ItemsMatchingGroupFunction · 0.70

Tested by

no test coverage detected