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

Function UI_WeaponHelpActive

code/ui/ui_main.cpp:5545–5572  ·  view source on GitHub ↗

if this is the first time into the weapon allocation screen, show the INSTRUCTION screen

Source from the content-addressed store, hash-verified

5543
5544// if this is the first time into the weapon allocation screen, show the INSTRUCTION screen
5545static void UI_WeaponHelpActive( void )
5546{
5547 int tier_storyinfo = Cvar_VariableIntegerValue( "tier_storyinfo" );
5548 menuDef_t *menu;
5549
5550 menu = Menu_GetFocused(); // Get current menu
5551
5552 if (!menu)
5553 {
5554 return;
5555 }
5556
5557 // First time, show instructions
5558 if (tier_storyinfo==1)
5559 {
5560 UI_SetItemVisible(menu,"weapon_button",qfalse);
5561
5562 UI_SetItemVisible(menu,"inst_stuff",qtrue);
5563
5564 }
5565 // just act like normal
5566 else
5567 {
5568 UI_SetItemVisible(menu,"weapon_button",qtrue);
5569
5570 UI_SetItemVisible(menu,"inst_stuff",qfalse);
5571 }
5572}
5573
5574static void UI_InitWeaponSelect( void )
5575{

Callers 1

UI_RunMenuScriptFunction · 0.85

Calls 3

UI_SetItemVisibleFunction · 0.85
Menu_GetFocusedFunction · 0.70

Tested by

no test coverage detected