. Find weapons button and make active/inactive (Used by Force Power Allocation screen)
| 4673 | |
| 4674 | //. Find weapons button and make active/inactive (Used by Force Power Allocation screen) |
| 4675 | static void UI_ForcePowerWeaponsButton(qboolean activeFlag) |
| 4676 | { |
| 4677 | menuDef_t *menu; |
| 4678 | menu = Menu_GetFocused(); // Get current menu |
| 4679 | |
| 4680 | if (!menu) |
| 4681 | { |
| 4682 | return; |
| 4683 | } |
| 4684 | |
| 4685 | #ifndef JK2_MODE |
| 4686 | if (!activeFlag) { |
| 4687 | // total light and dark powers are at maximum level 3 ( 3 levels * ( 4ls + 4ds ) = 24 ) |
| 4688 | if ( UI_CountForcePowers() >= 24 ) |
| 4689 | activeFlag = qtrue; |
| 4690 | } |
| 4691 | #endif |
| 4692 | |
| 4693 | // Find weaponsbutton |
| 4694 | itemDef_t *item; |
| 4695 | item = (itemDef_s *) Menu_FindItemByName(menu, "weaponbutton"); |
| 4696 | if (item) |
| 4697 | { |
| 4698 | // Make it active |
| 4699 | if (activeFlag) |
| 4700 | { |
| 4701 | item->window.flags &= ~WINDOW_INACTIVE; |
| 4702 | } |
| 4703 | else |
| 4704 | { |
| 4705 | item->window.flags |= WINDOW_INACTIVE; |
| 4706 | } |
| 4707 | } |
| 4708 | } |
| 4709 | |
| 4710 | void UI_SetItemColor(itemDef_t *item,const char *itemname,const char *name,vec4_t color); |
| 4711 |
no test coverage detected