Replaced all menu line lengths with defines in menu.inc

*Moved the including of menu.inc up to allow all modules to use its defines.
This commit is contained in:
Greyscale
2009-07-27 13:25:23 -07:00
parent 75d72fb3f2
commit b7018e9fe8
8 changed files with 62 additions and 54 deletions

View File

@ -51,8 +51,8 @@ bool:WeaponsMenuMain(client)
SetMenuTitle(menu_weapons_main, "%t\n ", "Weapons menu restrict main title");
decl String:restrict[64];
decl String:zmarket[64];
decl String:restrict[MENU_LINE_SMALL_LENGTH];
decl String:zmarket[MENU_LINE_SMALL_LENGTH];
Format(restrict, sizeof(restrict), "%t", "Weapons menu restrict main restrict");
Format(zmarket, sizeof(zmarket), "%t", "Weapons menu restrict main market");
@ -144,7 +144,7 @@ WeaponsMenuTypes(client)
// If there are no weapons, add an "(Empty)" line.
if (size == 0)
{
decl String:empty[64];
decl String:empty[MENU_LINE_SMALL_LENGTH];
Format(empty, sizeof(empty), "%t", "Menu empty");
AddMenuItem(menu_weapons_types, "empty", empty, ITEMDRAW_DISABLED);
@ -206,8 +206,8 @@ WeaponsMenuTypeWeapons(client)
SetMenuTitle(menu_weapons_typeweapons, "%t\n ", "Weapons menu restrict types weapon type title", typename);
decl String:restrictall[64];
decl String:unrestrictall[64];
decl String:restrictall[MENU_LINE_REG_LENGTH];
decl String:unrestrictall[MENU_LINE_REG_LENGTH];
Format(restrictall, sizeof(restrictall), "%t", "Weapons menu restrict types restrict all", typename);
Format(unrestrictall, sizeof(unrestrictall), "%t\n ", "Weapons menu restrict types unrestrict all", typename);
@ -216,8 +216,8 @@ WeaponsMenuTypeWeapons(client)
AddMenuItem(menu_weapons_typeweapons, "restrictall", restrictall, MenuGetItemDraw(!RestrictIsTypeUniform(true, g_iWeaponsCurType[client])));
AddMenuItem(menu_weapons_typeweapons, "unrestrictall", unrestrictall, MenuGetItemDraw(!RestrictIsTypeUniform(false, g_iWeaponsCurType[client])));
decl String:typeweapon[WEAPONS_MAX_LENGTH];
decl String:display[WEAPONS_MAX_LENGTH];
decl String:typeweapon[MENU_LINE_SMALL_LENGTH];
decl String:display[MENU_LINE_SMALL_LENGTH + 2]; // +2 to allow room for the [ ] if its restricted.
// Get an array populated with all weapons of the given type.
new Handle:arrayTypeWeapons;
@ -291,7 +291,7 @@ public WeaponsMenuTypeWeaponsHandle(Handle:menu_weapons_typeweapons, MenuAction:
default:
{
// Get weappon name.
decl String:typeweapon[WEAPONS_MAX_LENGTH];
decl String:typeweapon[MENU_LINE_REG_LENGTH];
GetMenuItem(menu_weapons_typeweapons, slot, typeweapon, sizeof(typeweapon));
// Get weapon index.
@ -356,7 +356,7 @@ WeaponsMenuZMarket(client)
SetMenuTitle(menu_weapons_market, "%t\n ", "Weapons menu restrict zmarket title");
decl String:buyzone[64];
decl String:buyzone[MENU_LINE_REG_LENGTH];
decl String:buyzonesetting[8];
// Get "yes" or "no" settings from respective cvar.

View File

@ -258,11 +258,11 @@ bool:ZMarketMenuMain(client)
new bool:zmarketrebuyauto = GetConVarBool(g_hCvarsList[CVAR_WEAPONS_ZMARKET_REBUY_AUTO]);
// Add "Get Current Loadout" option.
decl String:getloadout[WEAPONS_MAX_LENGTH];
decl String:viewloadout[WEAPONS_MAX_LENGTH];
decl String:rebuy[WEAPONS_MAX_LENGTH];
decl String:rebuyauto[WEAPONS_MAX_LENGTH];
decl String:weaponslist[WEAPONS_MAX_LENGTH];
decl String:getloadout[MENU_LINE_REG_LENGTH];
decl String:viewloadout[MENU_LINE_REG_LENGTH];
decl String:rebuy[MENU_LINE_REG_LENGTH];
decl String:rebuyauto[MENU_LINE_REG_LENGTH];
decl String:weaponslist[MENU_LINE_REG_LENGTH];
// Get auto-rebuy setting.
decl String:rebuyautosetting[8];
@ -399,7 +399,7 @@ bool:ZMarketMenuLoadout(client)
WeaponsClassnameToDisplay(rebuyweapons[Slot_NVGs], sizeof(rebuyweapons[]), nvgsweapon, sizeof(nvgsweapon));
// Get the empty translation.
decl String:empty[64];
decl String:empty[MENU_LINE_SMALL_LENGTH];
Format(empty, sizeof(empty), "%t", "Weapons menu zmarket loadout empty");
// If the client doesn't have a weapon in this slot, then set the weapon to the empty translation.
@ -428,12 +428,12 @@ bool:ZMarketMenuLoadout(client)
decl String:nvgsbool[8];
ConfigBoolToSetting(bool:nvgsweapon[0], nvgsbool, sizeof(nvgsbool));
decl String:primary[64];
decl String:secondary[64];
decl String:melee[64];
decl String:projectile[64];
decl String:explosive[64];
decl String:nvgs[64];
decl String:primary[MENU_LINE_REG_LENGTH];
decl String:secondary[MENU_LINE_REG_LENGTH];
decl String:melee[MENU_LINE_REG_LENGTH];
decl String:projectile[MENU_LINE_REG_LENGTH];
decl String:explosive[MENU_LINE_REG_LENGTH];
decl String:nvgs[MENU_LINE_REG_LENGTH];
// Format all the lines of the menu.
Format(primary, sizeof(primary), "%t", "Weapons menu zmarket loadout primary", primaryweapon);
@ -525,7 +525,7 @@ ZMarketMenuTypes(client)
// If there are no weapons, add an "(Empty)" line.
if (size == 0)
{
decl String:empty[64];
decl String:empty[MENU_LINE_SMALL_LENGTH];
Format(empty, sizeof(empty), "%t", "Menu empty");
AddMenuItem(menu_zmarket_types, "empty", empty, ITEMDRAW_DISABLED);
@ -605,8 +605,8 @@ ZMarketMenuTypeWeapons(client)
SetMenuTitle(menu_zmarket_typeweapons, "%t\n ", "Weapons menu zmarket types weapon type title", typename);
decl String:typeweapon[WEAPONS_MAX_LENGTH];
decl String:typeweapondisplay[WEAPONS_MAX_LENGTH];
decl String:display[128];
decl String:typeweapondisplay[MENU_LINE_REG_LENGTH];
decl String:display[MENU_LINE_BIG_LENGTH];
// Get an array populated with all weapons of the given type.
new Handle:arrayTypeWeapons;