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

Function UI_WeaponAllocBeginButton

code/ui/ui_main.cpp:5497–5525  ·  view source on GitHub ↗

. Find weapons allocation screen BEGIN button and make active/inactive

Source from the content-addressed store, hash-verified

5495
5496//. Find weapons allocation screen BEGIN button and make active/inactive
5497static void UI_WeaponAllocBeginButton(qboolean activeFlag)
5498{
5499 menuDef_t *menu;
5500 menu = Menu_GetFocused(); // Get current menu
5501
5502 if (!menu)
5503 {
5504 return;
5505 }
5506
5507 int weap = Cvar_VariableIntegerValue( "weapon_menu" );
5508
5509 // Find begin button
5510 itemDef_t *item;
5511 item = Menu_GetMatchingItemByNumber(menu, weap, "beginmission");
5512
5513 if (item)
5514 {
5515 // Make it active
5516 if (activeFlag)
5517 {
5518 item->window.flags &= ~WINDOW_INACTIVE;
5519 }
5520 else
5521 {
5522 item->window.flags |= WINDOW_INACTIVE;
5523 }
5524 }
5525}
5526
5527// If we have both weapons and the throwable weapon, turn on the begin mission button,
5528// otherwise, turn it off

Callers 2

UI_InitWeaponSelectFunction · 0.85

Calls 3

Menu_GetFocusedFunction · 0.70

Tested by

no test coverage detected