scripting/dm_equipment.sp
changeset 40 c7e7450fa6be
parent 39 009784b8e659
child 74 7753784c4d12
     1.1 --- a/scripting/dm_equipment.sp	Wed Nov 14 07:46:34 2007 +0000
     1.2 +++ b/scripting/dm_equipment.sp	Wed Nov 14 08:01:10 2007 +0000
     1.3 @@ -104,7 +104,7 @@
     1.4  	g_NVOffset = FindSendPropOffs("CCSPlayer", "m_bHasNightVision");
     1.5  	g_HealthOffset = FindSendPropOffs("CCSPlayer", "m_iHealth");
     1.6  	
     1.7 -	g_hEquipMenu = CreateMenu(Menu_EquipHandler, MenuAction_DrawItem);
     1.8 +	g_hEquipMenu = CreateMenu(Menu_EquipHandler, MenuAction_DrawItem|MenuAction_DisplayItem);
     1.9  	SetMenuTitle(g_hEquipMenu, "Weapon Options:");
    1.10  	SetMenuExitButton(g_hEquipMenu, false);
    1.11  	AddMenuItem(g_hEquipMenu, "", "New weapons");
    1.12 @@ -438,6 +438,21 @@
    1.13  		}
    1.14  		g_GunMenuAvailable[param1] = false;
    1.15  	}
    1.16 +	else if (action == MenuAction_DisplayItem)
    1.17 +	{
    1.18 +		decl style;
    1.19 +		decl String:info[12], String:lang_phrase[32];
    1.20 +		
    1.21 +		if (!GetMenuItem(menu, param2, info, sizeof(info), style, lang_phrase, sizeof(lang_phrase)))
    1.22 +		{
    1.23 +			return 0;
    1.24 +		}
    1.25 +		
    1.26 +		decl String:t_phrase[64];
    1.27 +		Format(t_phrase, sizeof(t_phrase), "%T", lang_phrase, param1);
    1.28 +		
    1.29 +		return RedrawMenuItem(t_phrase);
    1.30 +	}
    1.31  	
    1.32  	return 0;
    1.33  }
    1.34 @@ -457,6 +472,15 @@
    1.35  	{
    1.36  		GivePrimary(param1, param2);
    1.37  	}
    1.38 +	else if (action == MenuAction_Display)
    1.39 +	{
    1.40 +		new Handle:hPanel = Handle:param2;
    1.41 +		decl String:title[128];
    1.42 +		
    1.43 +		Format(title, sizeof(title), "%T:", "Primary weapon", param1);
    1.44 +		
    1.45 +		SetPanelTitle(hPanel, title);
    1.46 +	}
    1.47  	
    1.48  	return 0;
    1.49  }
    1.50 @@ -488,6 +512,15 @@
    1.51  			DisplayMenu(g_hPrimaryMenu, param1, MENU_TIME_FOREVER);
    1.52  		}
    1.53  	}
    1.54 +	else if (action == MenuAction_Display)
    1.55 +	{
    1.56 +		new Handle:hPanel = Handle:param2;
    1.57 +		decl String:title[128];
    1.58 +		
    1.59 +		Format(title, sizeof(title), "%T:", "Secondary weapon", param1);
    1.60 +		
    1.61 +		SetPanelTitle(hPanel, title);
    1.62 +	}
    1.63  	
    1.64  	return 0;
    1.65  }
    1.66 @@ -798,7 +831,7 @@
    1.67  	{
    1.68  		CloseHandle(g_hPrimaryMenu);
    1.69  	}
    1.70 -	g_hPrimaryMenu = CreateMenu(Menu_PrimaryHandler, MenuAction_DrawItem);
    1.71 +	g_hPrimaryMenu = CreateMenu(Menu_PrimaryHandler, MenuAction_DrawItem|MenuAction_Display);
    1.72  	SetMenuTitle(g_hPrimaryMenu, "Primary weapon:");
    1.73  	for (new i=0; i<g_PrimaryCount; i++)
    1.74  	{
    1.75 @@ -813,7 +846,7 @@
    1.76  	{
    1.77  		CloseHandle(g_hSecondaryMenu);
    1.78  	}
    1.79 -	g_hSecondaryMenu = CreateMenu(Menu_SecondaryHandler, MenuAction_DrawItem);
    1.80 +	g_hSecondaryMenu = CreateMenu(Menu_SecondaryHandler, MenuAction_DrawItem|MenuAction_Display);
    1.81  	SetMenuTitle(g_hSecondaryMenu, "Secondary weapon:");
    1.82  	for (new i=0; i<g_SecondaryCount; i++)
    1.83  	{