From 64c49df505404be4f0f76009205055691545303d Mon Sep 17 00:00:00 2001 From: Richard Helgeby Date: Sat, 22 May 2010 16:13:42 +0200 Subject: [PATCH] Made cvar for minimum dx level. --- .../cfg/sourcemod/zombiereloaded/zombiereloaded.cfg | 4 ++++ src/zr/cvars.inc | 2 ++ src/zr/overlays.inc | 12 ++++-------- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cstrike/cfg/sourcemod/zombiereloaded/zombiereloaded.cfg b/cstrike/cfg/sourcemod/zombiereloaded/zombiereloaded.cfg index 191108c..6c5dee0 100644 --- a/cstrike/cfg/sourcemod/zombiereloaded/zombiereloaded.cfg +++ b/cstrike/cfg/sourcemod/zombiereloaded/zombiereloaded.cfg @@ -395,6 +395,10 @@ zr_damage_suicide_after_infect "1" // Default: "1.0" zr_overlays_update_time "1.0" +// Minimum DirectX level allowed for overlays (mat_dxlevel). +// Default: "80" +zr_overlays_min_dxlevel "80" + // ---------------------------------------------------------------------------- // Round End (core) diff --git a/src/zr/cvars.inc b/src/zr/cvars.inc index 0c29bf3..dbff337 100644 --- a/src/zr/cvars.inc +++ b/src/zr/cvars.inc @@ -90,6 +90,7 @@ enum CvarsList Handle:CVAR_SAYHOOKS_QUIET_FILTER, Handle:CVAR_SAYHOOKS_QUIET_FLAGS, Handle:CVAR_OVERLAYS_UPDATE_TIME, + Handle:CVAR_OVERLAYS_MIN_DXLEVEL, Handle:CVAR_ROUNDEND_OVERLAY, Handle:CVAR_ROUNDEND_OVERLAY_ZOMBIE, Handle:CVAR_ROUNDEND_OVERLAY_HUMAN, @@ -355,6 +356,7 @@ CvarsCreate() // Overlays (core) // =========================== g_hCvarsList[CVAR_OVERLAYS_UPDATE_TIME] = CreateConVar("zr_overlays_update_time", "1.0", "How often to update overlays on players. [0.0 = Disabled]"); + g_hCvarsList[CVAR_OVERLAYS_MIN_DXLEVEL] = CreateConVar("zr_overlays_min_dxlevel", "80", "Minimum DirectX level allowed for overlays (mat_dxlevel)."); // =========================== diff --git a/src/zr/overlays.inc b/src/zr/overlays.inc index db096f7..008e2ec 100644 --- a/src/zr/overlays.inc +++ b/src/zr/overlays.inc @@ -25,11 +25,6 @@ * ============================================================================ */ -/** - * Minimum dx level required to see overlays. - */ -#define OVERLAYS_DXL_MIN 90 - /** * Maximum amount of overlay channels. */ @@ -202,10 +197,11 @@ OverlaysClientUpdateOverlay(client, OverlaysChannel:channel = OVERLAYS_CHANNEL_N return; } - // If client doesn't meet DXLevel requirement, then tell client, then stop. - if (g_iOverlaysDXL[client] < OVERLAYS_DXL_MIN) + // If client doesn't meet DXLevel requirement, then tell client and stop. + new minDxLevel = GetConVarInt(g_hCvarsList[CVAR_OVERLAYS_MIN_DXLEVEL]); + if (g_iOverlaysDXL[client] < minDxLevel) { - TranslationPrintCenterText(client, "Overlays not supported", g_iOverlaysDXL[client], OVERLAYS_DXL_MIN); + TranslationPrintCenterText(client, "Overlays not supported", g_iOverlaysDXL[client], minDxLevel); return; }