Added a shortcut to zmarket loadout in ZCookies, added joinclass to suicide intercept as default.

This commit is contained in:
Greyscale 2009-07-23 15:40:39 -07:00
parent 637c04aa21
commit 37fe9fae8b
4 changed files with 32 additions and 9 deletions

View File

@ -984,6 +984,11 @@
"en" "Human/Zombie Class Overlay: {1}"
}
"ZCookies zmarket loadout"
{
"en" "ZMarket Loadout"
}
// ===========================
// ZSpawn (module)
// ===========================

View File

@ -336,8 +336,8 @@ zr_damage_suicide_mzombie "1"
zr_damage_suicide_human "0"
// List of client commands to intercept as suicide attempts. [Delimiter: ", "]
// Default: "kill, spectate, jointeam"
zr_damage_suicide_cmds "kill, spectate, jointeam"
// Default: "kill, spectate, jointeam, joinclass"
zr_damage_suicide_cmds "kill, spectate, jointeam, joinclass"
// ----------------------------------------------------------------------------

View File

@ -313,7 +313,7 @@ CvarsCreate()
g_hCvarsList[CVAR_DAMAGE_SUICIDE_ZOMBIE] = CreateConVar("zr_damage_suicide_zombie", "0", "Intercept suicide commands attempted by zombies.");
g_hCvarsList[CVAR_DAMAGE_SUICIDE_MZOMBIE] = CreateConVar("zr_damage_suicide_mzombie", "1", "Intercept suicide commands attempted by mother zombies.");
g_hCvarsList[CVAR_DAMAGE_SUICIDE_HUMAN] = CreateConVar("zr_damage_suicide_human", "0", "Intercept suicide commands attempted by humans.");
g_hCvarsList[CVAR_DAMAGE_SUICIDE_CMDS] = CreateConVar("zr_damage_suicide_cmds", "kill, spectate, jointeam", "List of client commands to intercept as suicide attempts. [Delimiter: \", \"]");
g_hCvarsList[CVAR_DAMAGE_SUICIDE_CMDS] = CreateConVar("zr_damage_suicide_cmds", "kill, spectate, jointeam, joinclass", "List of client commands to intercept as suicide attempts. [Delimiter: \", \"]");
// ===========================

View File

@ -62,22 +62,26 @@ ZCookiesMenuMain(client)
decl String:autorebuy[64];
decl String:zhp[64];
decl String:overlay[64];
decl String:zmarket[64];
// Translate each line into client's language.
Format(autorebuy, sizeof(autorebuy), "%t", "ZCookies menu main auto-rebuy", autorebuyenabled);
Format(zhp, sizeof(zhp), "%t", "ZCookies menu main zhp", zhpenabled);
Format(overlay, sizeof(overlay), "%t", "ZCookies menu main overlay", overlayenabled);
Format(zmarket, sizeof(zmarket), "%t", "ZCookies zmarket loadout");
// Get conditional values for each option.
new bool:weapons = GetConVarBool(g_hCvarsList[CVAR_WEAPONS]); // For auto-rebuy.
new bool:zmarketrebuyauto = GetConVarBool(g_hCvarsList[CVAR_WEAPONS_ZMARKET_REBUY_AUTO]); // For auto-rebuy.
new bool:zhpcvar = GetConVarBool(g_hCvarsList[CVAR_ZHP]); // For ZHP.
new bool:overlaytoggle = GetConVarBool(g_hCvarsList[CVAR_CLASSES_OVERLAY_TOGGLE]); // For class overlay.
new bool:zmarketenabled = GetConVarBool(g_hCvarsList[CVAR_WEAPONS_ZMARKET]); // For ZMarket loadout.
// Add items to menu.
AddMenuItem(zcookies_menu_main, "autorebuy", autorebuy, MenuGetItemDraw(weapons && zmarketrebuyauto));
AddMenuItem(zcookies_menu_main, "zhp", zhp, MenuGetItemDraw(zhpcvar));
AddMenuItem(zcookies_menu_main, "overlay", overlay, MenuGetItemDraw(overlaytoggle));
AddMenuItem(zcookies_menu_main, "zmarket", zmarket, MenuGetItemDraw(zmarketenabled));
// Create a "Back" button to the main menu.
SetMenuExitBackButton(zcookies_menu_main, true);
@ -100,6 +104,8 @@ public ZCookiesMenuMainHandle(Handle:menu, MenuAction:action, client, slot)
// Client selected an option.
if (action == MenuAction_Select)
{
new bool:resend = true;
switch(slot)
{
// Toggled auto-rebuy
@ -125,11 +131,23 @@ public ZCookiesMenuMainHandle(Handle:menu, MenuAction:action, client, slot)
CookiesSetClientCookieBool(client, g_hOverlayEnabledCookie, overlayenabled);
}
}
// Opened ZMarket loadout.
case 3:
{
// Show a client their current loadout.
ZMarketMenuLoadout(client);
// Don't resend ZCookies.
resend = false;
}
}
if (resend)
{
// Re-send menu.
ZCookiesMenuMain(client);
}
}
// Client closed the menu.
if (action == MenuAction_Cancel)
{