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

Function UI_SetItemColor

code/ui/ui_shared.cpp:2391–2427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2389}
2390
2391void UI_SetItemColor(itemDef_t *item,const char *itemname,const char *name,vec4_t color)
2392{
2393 itemDef_t *item2;
2394 int i,j;
2395 vec4_t *out;
2396 int count = Menu_ItemsMatchingGroup((menuDef_t *) item->parent, itemname);
2397
2398 for (j = 0; j < count; j++)
2399 {
2400 item2 = Menu_GetMatchingItemByNumber((menuDef_t *) item->parent, j, itemname);
2401 if (item2 != NULL)
2402 {
2403 out = NULL;
2404 if (Q_stricmp(name, "backcolor") == 0)
2405 {
2406 out = &item2->window.backColor;
2407 }
2408 else if (Q_stricmp(name, "forecolor") == 0)
2409 {
2410 out = &item2->window.foreColor;
2411 item2->window.flags |= WINDOW_FORECOLORSET;
2412 }
2413 else if (Q_stricmp(name, "bordercolor") == 0)
2414 {
2415 out = &item2->window.borderColor;
2416 }
2417
2418 if (out)
2419 {
2420 for (i = 0; i < 4; i++)
2421 {
2422 (*out)[i] = color[i];
2423 }
2424 }
2425 }
2426 }
2427}
2428
2429/*
2430=================

Callers 4

UI_ShutdownForceHelpFunction · 0.85
UI_AffectForcePowerLevelFunction · 0.85
Script_SetItemColorFunction · 0.85

Calls 3

Q_stricmpFunction · 0.85
Menu_ItemsMatchingGroupFunction · 0.70

Tested by

no test coverage detected